[Solved] Cannot set my default sound card right

Support with sound and multimedia cards on GhostBSD
Post Reply
strider
Posts: 13
Joined: Sat Jan 12, 2019 8:14 am
Location: Antwerp, Belgium

[Solved] Cannot set my default sound card right

Post by strider »

Here is the output of cat /dev/sndstat :

Code: Select all

pcm0: <Conexant CX20585 (Left Analog)> (play/rec) default
pcm1: <Conexant CX20585 (Analog)> (play/rec)
No devices installed from userspace.
And the snippet from dmesg related to sound :

Code: Select all

hdacc0: <Conexant CX20585 HDA CODEC> at cad 0 on hdac0
hdaa0: <Conexant CX20585 Audio Function Group> at nid 1 on hdacc0
pcm0: <Conexant CX20585 (Left Analog)> at nid 25 and 27 on hdaa0
pcm1: <Conexant CX20585 (Analog)> at nid 31 and 35 on hdaa0
In /dev I find :

Code: Select all

/dev/dsp0.1	/dev/dsp1.1
However by default my sound goes to the /dev/dsp0 device and I do not have any sound on boot.

The sysctl variable controlling this is has the following value :

Code: Select all

hw.snd.default_unit: 0
When I try to play a song : mpg123 -a /dev/dsp1.1 song.mp3
the song plays very nice.
Adapting the sysctl variable to 1 in my session works also. I do not have to specify a device anymore for mpg123. However when I start youtube after setting the sysctl variable to 1, I still do have sound. I have to start up the pulse audio volume control, select the right device and then turn the volume up (since it is at zero) before I get any sound.

And than last of all : setting the sysctl variable in /boot/loader.conf does not work. If I reboot my sysctl variable is still zero instead of 1 as specified in the loader.conf file.

The kernel uses the snd_hda driver (which is compiled in the kernel).

I'm puzzled ...
Last edited by strider on Sun Feb 03, 2019 4:48 pm, edited 1 time in total.
User avatar
NevilleGoddard
Developer
Posts: 517
Joined: Thu Dec 22, 2016 10:30 pm
Location: Japan

Re: Cannot set my default sound card right

Post by NevilleGoddard »

You have to set the default sound unit in /etc/sysctl.conf not loader.conf.
See here. https://www.freebsd.org/doc/handbook/sound-setup.html
strider
Posts: 13
Joined: Sat Jan 12, 2019 8:14 am
Location: Antwerp, Belgium

Re: Cannot set my default sound card right

Post by strider »

Neville,
I indeed figured that out in the meantime (my bad). Loader.conf is for sysctl variables that you can change ONLY at boot time. For those you can change after boot (with the sysctl command), one should use systcl.conf ... I'm starting to getting to know how FreeBSD works ... quite logical in fact.

For the rest of my problems, I already have some solutions too ... I'll post them once I get everything cleared out:)
strider
Posts: 13
Joined: Sat Jan 12, 2019 8:14 am
Location: Antwerp, Belgium

Re: Cannot set my default sound card right

Post by strider »

Ok, here is what I did to get this problem solved :
- set default soundcard to /dev/dsp1 via /etc/sysctl.conf (see previous post)
- Once that is done, I rebooted and got the boot sound of GhostBSD for the first time ...
- FF still didn't have sound though (I opened YouTube to check it). However, while a video was playing, I opened pulseaudio control applet (pavucontrol) and it showed in the playback section FF with the output to /dev/dsp0. I changed that to /dev/dsp1 and voilà. Apparently pulseaudio remembers that selection, even after reboot. So I got sound in FF.
- However, the sound volume control panel appliet in MATE still did not work. This is a know problem : https://github.com/mate-desktop/mate-media/issues/96.
- Since I noticed others on this forum also had problems with controlling volume under MATE, I installed XFCE instead (which I prefer above MATE btw, but that's a question of preference):

Code: Select all

pkg install xfce4
and the volume control and the sound daemon (to control the sound via your keyboard) for pulseaudio :

Code: Select all

pkg install xfce4-pulseaudio-plugin
pkg install xfce4-volumed-pulse
I then added the volume daemon to my startup and added the plugin to my XFCE4 panel.

And now everything works !
User avatar
NevilleGoddard
Developer
Posts: 517
Joined: Thu Dec 22, 2016 10:30 pm
Location: Japan

Re: [Solved] Cannot set my default sound card right

Post by NevilleGoddard »

Great!
How is xfce going?
Any problems?
Post Reply