[Solved] Cannot set my default sound card right

Support with sound and multimedia cards on GhostBSD
Post Reply
strider
Posts: 12
Joined: Sat Jan 12, 2019 8:14 am
Location: Antwerp, Belgium
Has thanked: 1 time
Been thanked: 2 times

[Solved] Cannot set my default sound card right

Post by strider » Wed Jan 23, 2019 5:43 pm

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.

NevilleGoddard
Developer
Posts: 488
Joined: Thu Dec 22, 2016 10:30 pm
Location: Japan
Has thanked: 8 times
Been thanked: 12 times

Re: Cannot set my default sound card right

Post by NevilleGoddard » Sun Jan 27, 2019 6:15 am

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
These users thanked the author NevilleGoddard for the post:
liam (Sun Jan 27, 2019 2:17 pm)
Rating: 50%

strider
Posts: 12
Joined: Sat Jan 12, 2019 8:14 am
Location: Antwerp, Belgium
Has thanked: 1 time
Been thanked: 2 times

Re: Cannot set my default sound card right

Post by strider » Wed Jan 30, 2019 5:51 pm

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:)
These users thanked the author strider for the post:
liam (Wed Jan 30, 2019 10:57 pm)
Rating: 50%

strider
Posts: 12
Joined: Sat Jan 12, 2019 8:14 am
Location: Antwerp, Belgium
Has thanked: 1 time
Been thanked: 2 times

Re: Cannot set my default sound card right

Post by strider » Sun Feb 03, 2019 4:47 pm

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 !
These users thanked the author strider for the post:
liam (Sun Feb 03, 2019 9:02 pm)
Rating: 50%

NevilleGoddard
Developer
Posts: 488
Joined: Thu Dec 22, 2016 10:30 pm
Location: Japan
Has thanked: 8 times
Been thanked: 12 times

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

Post by NevilleGoddard » Sun Feb 03, 2019 5:57 pm

Great!
How is xfce going?
Any problems?

Post Reply