Solved Can't change sound output

Hi,

New to freebsd, I can't change sound output => Always on the speaker
Here are some outputs :
root@bsdjmlm:~ # dmesg |grep pcm
pcm0: <NVIDIA (0x0051) (HDMI/DP 8ch)> at nid 4 on hdaa0
pcm1: <NVIDIA (0x0051) (HDMI/DP 8ch)> at nid 5 on hdaa0
pcm2: <Realtek ALC221 (Analog)> at nid 23 and 26,27 on hdaa1
pcm3: <Realtek ALC221 (Analog 2.0+HP)> at nid 20,33 on hdaa1
pcm4: <Intel Skylake (HDMI/DP 8ch)> at nid 3 on hdaa2
pcm5: <USB audio> on uaudio0

pcm6: <USB audio> on uaudio1
root@bsdjmlm:~ # kldstat

Id Refs Address Size Name
1 98 0xffffffff80200000 1d345b0 kernel
2 1 0xffffffff81f35000 6cd8 uplcom.ko
3 2 0xffffffff81f3c000 a088 ucom.ko
4 1 0xffffffff81f47000 a2f8 ng_ubt.ko
5 3 0xffffffff81f52000 13f40 ng_hci.ko
6 3 0xffffffff81f66000 4318 ng_bluetooth.ko
7 4 0xffffffff81f6b000 16cf0 netgraph.ko
8 1 0xffffffff82b10000 3558 fdescfs.ko
9 1 0xffffffff82b14000 73c0 linprocfs.ko
10 6 0xffffffff82b1c000 be70 linux_common.ko
11 1 0xffffffff82b28000 440c linsysfs.ko
12 1 0xffffffff82b2d000 e6df0 nvidia-modeset.ko
13 1 0xffffffff82e00000 db7e50 nvidia.ko
14 2 0xffffffff82c14000 31a10 linux.ko
15 1 0xffffffff82c46000 12e08 fusefs.ko
16 1 0xffffffff82c59000 3390 acpi_wmi.ko
17 1 0xffffffff82c5d000 3250 ichsmb.ko
18 1 0xffffffff82c61000 2178 smbus.ko
19 1 0xffffffff82c64000 2110 pchtherm.ko
20 1 0xffffffff82c67000 2dc30 linux64.ko
21 1 0xffffffff82c95000 2278 pty.ko
22 1 0xffffffff82c98000 3360 uhid.ko
23 1 0xffffffff82c9c000 4364 ums.ko
24 1 0xffffffff82ca1000 33c0 usbhid.ko
25 1 0xffffffff82ca5000 3380 hidbus.ko
26 1 0xffffffff82ca9000 e5ac snd_uaudio.ko
27 1 0xffffffff82cb8000 3360 wmt.ko
28 1 0xffffffff82cbc000 5bd8 autofs.ko

29 1 0xffffffff82cc2000 2a68 mac_ntpd.ko

cat /dev/sndstat
FreeBSD Audio Driver (64bit 2009061500/amd64)
Installed devices:
pcm0: <NVIDIA (0x0051) (HDMI/DP 8ch)> on hdaa0 (1p:1v/0r:0v)
pcm1: <NVIDIA (0x0051) (HDMI/DP 8ch)> on hdaa0 (1p:1v/0r:0v)
pcm2: <Realtek ALC221 (Analog)> on hdaa1 (1p:1v/1r:1v)
pcm3: <Realtek ALC221 (Analog 2.0+HP)> on hdaa1 (1p:1v/0r:0v)
pcm4: <Intel Skylake (HDMI/DP 8ch)> on hdaa2 (1p:1v/0r:0v)
pcm5: <USB audio> at ? kld snd_uaudio (0p:0v/1r:1v)

pcm6: <USB audio> at ? kld snd_uaudio (1p:1v/1r:1v) default
If I try to change => seems to work (default changes) but the output is always the speaker !

root@bsdjmlm:~ # sysctl hw.snd.default_unit=3
hw.snd.default_unit: 6 -> 3
root@bsdjmlm:~ # cat /dev/sndstat
FreeBSD Audio Driver (64bit 2009061500/amd64)
Installed devices:
pcm0: <NVIDIA (0x0051) (HDMI/DP 8ch)> on hdaa0 (1p:1v/0r:0v)
pcm1: <NVIDIA (0x0051) (HDMI/DP 8ch)> on hdaa0 (1p:1v/0r:0v)
pcm2: <Realtek ALC221 (Analog)> on hdaa1 (1p:1v/1r:1v)
pcm3: <Realtek ALC221 (Analog 2.0+HP)> on hdaa1 (1p:1v/0r:0v) default
pcm4: <Intel Skylake (HDMI/DP 8ch)> on hdaa2 (1p:1v/0r:0v)
pcm5: <USB audio> at ? kld snd_uaudio (0p:0v/1r:1v)

pcm6: <USB audio> at ? kld snd_uaudio (1p:1v/1r:1v)


Same effect if I change in the sysctl.conf and reboot
I've also tried to load snd_driver but no effect !
If I try to plug an headphone and change from pcm2 to pcm3 => nothing change also.

Thanks in advance.
Regards
 
Hi,

Yes !
If I start pulseaudio, It works when I change the default sink .
set-default-sink 1 -> hdmi output
set-default-sink 2 -> speaker
set-default-sink 3 -> headphone (jack on PC)
set-default-sink 5 -> USB headphone

Here are my "sinks"
>>> list-sinks
6 sink(s) available.
index: 0
name: <oss_output.dsp0>
driver: <module-oss.c>
flags: HARDWARE HW_VOLUME_CTRL LATENCY
state: SUSPENDED
suspend cause: IDLE
priority: 0
volume: front-left: 65536 / 100%, front-right: 65536 / 100%
balance 0.00
base volume: 65536 / 100%
volume steps: 101
muted: no
current latency: 0.00 ms
max request: 16 KiB
max rewind: 0 KiB
monitor source: 0
sample spec: s16le 2ch 44100Hz
channel map: front-left,front-right
Stereo
used by: 0
linked by: 0
fixed latency: 92.88 ms
module: 6
properties:
device.string = "/dev/dsp0"
device.api = "oss"
device.description = "0 - NVIDIA (0x0051) (HDMI/DP 8ch)"
device.access_mode = "mmap"
device.buffering.buffer_size = "16384"
device.buffering.fragment_size = "4096"
device.icon_name = "audio-card"
index: 1
name: <oss_output.dsp1>
driver: <module-oss.c>
flags: HARDWARE HW_VOLUME_CTRL LATENCY
state: SUSPENDED
suspend cause: IDLE
priority: 0
volume: front-left: 65536 / 100%, front-right: 65536 / 100%
balance 0.00
base volume: 65536 / 100%
volume steps: 101
muted: no
current latency: 0.00 ms
max request: 16 KiB
max rewind: 0 KiB
monitor source: 1
sample spec: s16le 2ch 44100Hz
channel map: front-left,front-right
Stereo
used by: 0
linked by: 0
fixed latency: 92.88 ms
module: 7
properties:
device.string = "/dev/dsp1"
device.api = "oss"
device.description = "1 - NVIDIA (0x0051) (HDMI/DP 8ch)"
device.access_mode = "mmap"
device.buffering.buffer_size = "16384"
device.buffering.fragment_size = "4096"
device.icon_name = "audio-card"
* index: 2
name: <oss_output.dsp2>
driver: <module-oss.c>
flags: HARDWARE HW_VOLUME_CTRL LATENCY
state: RUNNING
suspend cause: (none)
priority: 0
volume: front-left: 38010 / 58%, front-right: 38010 / 58%
balance 0.00
base volume: 65536 / 100%
volume steps: 101
muted: no
current latency: 71.70 ms
max request: 16 KiB
max rewind: 0 KiB
monitor source: 3
sample spec: s16le 2ch 44100Hz
channel map: front-left,front-right
Stereo
used by: 1
linked by: 1
fixed latency: 92.88 ms
module: 8
properties:
device.string = "/dev/dsp2"
device.api = "oss"
device.description = "2 - Realtek ALC221 (Analog)"
device.access_mode = "mmap"
device.buffering.buffer_size = "16384"
device.buffering.fragment_size = "4096"
device.icon_name = "audio-card"
index: 3
name: <oss_output.dsp3>
driver: <module-oss.c>
flags: HARDWARE HW_VOLUME_CTRL LATENCY
state: SUSPENDED
suspend cause: IDLE
priority: 0
volume: front-left: 33423 / 51%, front-right: 33423 / 51%
balance 0.00
base volume: 65536 / 100%
volume steps: 101
muted: no
current latency: 0.00 ms
max request: 16 KiB
max rewind: 0 KiB
monitor source: 4
sample spec: s16le 2ch 44100Hz
channel map: front-left,front-right
Stereo
used by: 0
linked by: 0
fixed latency: 92.88 ms
module: 9
properties:
device.string = "/dev/dsp3"
device.api = "oss"
device.description = "3 - Realtek ALC221 (Analog 2.0+HP)"
device.access_mode = "mmap"
device.buffering.buffer_size = "16384"
device.buffering.fragment_size = "4096"
device.icon_name = "audio-card"
index: 4
name: <oss_output.dsp4>
driver: <module-oss.c>
flags: HARDWARE HW_VOLUME_CTRL LATENCY
state: SUSPENDED
suspend cause: IDLE
priority: 0
volume: front-left: 65536 / 100%, front-right: 65536 / 100%
balance 0.00
base volume: 65536 / 100%
volume steps: 101
muted: no
current latency: 0.00 ms
max request: 16 KiB
max rewind: 0 KiB
monitor source: 5
sample spec: s16le 2ch 44100Hz
channel map: front-left,front-right
Stereo
used by: 0
linked by: 0
fixed latency: 92.88 ms
module: 10
properties:
device.string = "/dev/dsp4"
device.api = "oss"
device.description = "4 - Intel Skylake (HDMI/DP 8ch)"
device.access_mode = "mmap"
device.buffering.buffer_size = "16384"
device.buffering.fragment_size = "4096"
device.icon_name = "audio-card"
index: 5
name: <oss_output.dsp6>
driver: <module-oss.c>
flags: HARDWARE HW_VOLUME_CTRL LATENCY
state: SUSPENDED
suspend cause: IDLE
priority: 0
volume: front-left: 49152 / 75%, front-right: 49152 / 75%
balance 0.00
base volume: 65536 / 100%
volume steps: 101
muted: no
current latency: 0.00 ms
max request: 16 KiB
max rewind: 0 KiB
monitor source: 8
sample spec: s16le 2ch 44100Hz
channel map: front-left,front-right
Stereo
used by: 0
linked by: 0
fixed latency: 92.88 ms
module: 12
properties:
device.string = "/dev/dsp6"
device.api = "oss"
device.description = "6 - USB audio"
device.access_mode = "mmap"
device.buffering.buffer_size = "16384"
device.buffering.fragment_size = "4096"

device.icon_name = "audio-card"

It should be great to have a simple gui audio-mixer because audio-mixer does not do the job !
Many thanx
Regards
 
I reinstalled my system last night and was having audio issues. I use a USB Scarlett Solo on my main system. I checked dmesg to get the audio unit and save "hw.snd.default_unit=X" (X being my audio card number) to /etc/sysctl.conf I had to reboot for it to work though. I'm not sure if that's because it's USB or not but it works the same as always now. Not sure if any of that is helpful.
 
Hi,
Sndiod -> No effect ! Try to install then start > no more sound change.

The only way to change output is to start pulseaudio (why not !) and use pacmd.
hw.snd.default_unit changes but with no effect.
regards
 
Hi,
Sndiod -> No effect ! Try to install then start > no more sound change.

The only way to change output is to start pulseaudio (why not !) and use pacmd.
hw.snd.default_unit changes but with no effect.
regards
Try adding hw.snd.default_unit=X (X being the card number) to your /etc/sysctl.conf and restarting your system or your sound system. That's what I had to do yesterday. Which was strange because it usually changes right away.
 
Try adding hw.snd.default_unit=X (X being the card number) to your /etc/sysctl.conf and restarting your system or your sound system. That's what I had to do yesterday. Which was strange because it usually changes right away.
OP has done that, last bit of post #1

By the way, you can implement /etc/sysctl.conf changes by restarting sysctl - service sysctl restart

No idea why the OP's system isn't honouring the sound card default change, but it is just a default I suppose. Could be something to do with the nid and the pins but that's a bit deep for me for a Friday night.
 
Hi,

So ! I can say solved !

I've installed pulseaudio and used pavucontrol as a mixer => ouput changes with the mixer. Sound is OK.
Next for me is linux64...

Thanks for your help
Regards
 
Speaking of pavucontrol, if you figure out how to make the values over 100% persistent please post about it. I often watch tv series and have to boost the volume from firefox but when I pause the volume drops down to 100% after increasing the max volume. That's a sound issue I can't figure out.
 
Speaking of pavucontrol, if you figure out how to make the values over 100% persistent please post about it. I often watch tv series and have to boost the volume from firefox but when I pause the volume drops down to 100% after increasing the max volume. That's a sound issue I can't figure out.
Why do you need to output volume higher than line level? Can't you amplify downstream from the soundcard? Headphone amplifier or something?
 
Why do you need to output volume higher than line level? Can't you amplify downstream from the soundcard? Headphone amplifier or something?
The only times that I do move the meter beyond the maximum is on my laptop. It's not an issue on my of my systems but it would be nice to make it consistently amplified.
 
Back
Top