# No sound on any device



## larhama (Dec 7, 2020)

I can't get audio to work on FreeBSD 12.2:


```
$ dmesg | grep audio
uaudio0 on uhub2
uaudio0: <Emotiva TA-100> on usbus1
uaudio0: Play[0]: 96000 Hz, 2 ch, 24-bit S-LE PCM format, 2x8ms buffer.
uaudio0: Play[0]: 88200 Hz, 2 ch, 24-bit S-LE PCM format, 2x8ms buffer.
uaudio0: Play[0]: 48000 Hz, 2 ch, 24-bit S-LE PCM format, 2x8ms buffer.
uaudio0: Play[0]: 44100 Hz, 2 ch, 24-bit S-LE PCM format, 2x8ms buffer.
uaudio0: Play[0]: 32000 Hz, 2 ch, 24-bit S-LE PCM format, 2x8ms buffer.
uaudio0: Record[0]: 96000 Hz, 2 ch, 24-bit S-LE PCM format, 2x8ms buffer.
uaudio0: Record[0]: 88200 Hz, 2 ch, 24-bit S-LE PCM format, 2x8ms buffer.
uaudio0: Record[0]: 48000 Hz, 2 ch, 24-bit S-LE PCM format, 2x8ms buffer.
uaudio0: Record[0]: 44100 Hz, 2 ch, 24-bit S-LE PCM format, 2x8ms buffer.
uaudio0: Record[0]: 32000 Hz, 2 ch, 24-bit S-LE PCM format, 2x8ms buffer.
uaudio0: No MIDI sequencer.
pcm6: <USB audio> on uaudio0
uaudio0: HID volume keys found.
```


```
$ cat /dev/sndstat 
Installed devices:
pcm0: <NVIDIA (0x0060) (HDMI/DP 8ch)> (play)
pcm1: <NVIDIA (0x0060) (HDMI/DP 8ch)> (play)
pcm2: <NVIDIA (0x0060) (HDMI/DP 8ch)> (play)
pcm3: <NVIDIA (0x0060) (HDMI/DP 8ch)> (play)
pcm4: <Realtek ALC892 (Rear Analog 7.1/2.0)> (play/rec)
pcm5: <Realtek ALC892 (Front Analog)> (play/rec) default
pcm6: <USB audio> (play/rec)
Installed devices from userspace:
dsp: <Virtual OSS> (play/rec)
```
`$ sysctl dev.hdac.1.pindump=1`
`$ dmesg`

```
hdaa1: Dumping AFG pins:
hdaa1: nid   0x    as seq device       conn  jack    loc        color   misc
hdaa1: 17 4037d540 4  0  CD            None  Analog  0x00       Res.D   5 DISA
hdaa1:     Caps:    OUT             
hdaa1: 18 411111f0 15 0  Speaker       None  1/8     Rear       Black   1 DISA
hdaa1:     Caps: IN                 
hdaa1: 20 01015010 1  0  Line-out      Jack  1/8     Rear       Red     0
hdaa1:     Caps: IN OUT HP EAPD      Sense: 0x00000000 (disconnected)
hdaa1: 21 01011012 1  2  Line-out      Jack  1/8     Rear       Black   0
hdaa1:     Caps: IN OUT              Sense: 0x00000000 (disconnected)
hdaa1: 22 01011011 1  1  Line-out      Jack  1/8     Rear       Black   0
hdaa1:     Caps: IN OUT              Sense: 0x00000000 (disconnected)
hdaa1: 23 01011014 1  4  Line-out      Jack  1/8     Rear       Black   0
hdaa1:     Caps: IN OUT              Sense: 0x00000000 (disconnected)
hdaa1: 24 01a11030 3  0  Mic           Jack  1/8     Rear       Black   0
hdaa1:     Caps: IN OUT         VREF Sense: 0x00000000 (disconnected)
hdaa1: 25 02a19040 4  0  Mic           Jack  1/8     Front      Pink    0
hdaa1:     Caps: IN OUT HP      VREF Sense: 0x00000000 (disconnected)
hdaa1: 26 0181103f 3  15 Line-in       Jack  1/8     Rear       Black   0
hdaa1:     Caps: IN OUT         VREF Sense: 0x00000000 (disconnected)
hdaa1: 27 02214020 2  0  Headphones    Jack  1/8     Front      Green   0
hdaa1:     Caps: IN OUT HP EAPD VREF Sense: 0x80000000 (connected)
hdaa1: 28 411111f0 15 0  Speaker       None  1/8     Rear       Black   1 DISA
hdaa1:     Caps: IN                  Sense: 0x00000000 (disconnected)
hdaa1: 30 411111f0 15 0  Speaker       None  1/8     Rear       Black   1 DISA
hdaa1:     Caps:    OUT             
hdaa1: 31 411111f0 15 0  Speaker       None  1/8     Rear       Black   1 DISA
hdaa1:     Caps: IN                 
hdaa1: NumGPIO=2 NumGPO=0 NumGPI=0 GPIWake=0 GPIUnsol=1
hdaa1:  GPIO0: disabled
hdaa1:  GPIO1: disabled
```


----------



## SirDice (Dec 8, 2020)

Where are your speakers attached? Are they built into the monitor? Or are you using an external speaker set connected to the analog pins?


----------



## larhama (Dec 8, 2020)

I have 3 audio outputs, realtek to my headphones, Nvidia hdmi to my screen and Emotiva ta-100 integrated amp with built-in dac that I use as my main audio device. I would like to get them all working if possible but the external usb dac is the most important one.


----------



## larhama (Dec 8, 2020)

$ mixer
Mixer vol      is currently set to 100:100
Mixer pcm      is currently set to 100:100
Mixer speaker  is currently set to  74:74
Mixer line     is currently set to   1:1
Mixer mic      is currently set to  67:67
Mixer mix      is currently set to  74:74
Mixer rec      is currently set to  35:35
Mixer igain    is currently set to   0:0
Mixer ogain    is currently set to 100:100
Recording source: mic

mixer levels all seem to be ok too, so that must not be it.  Just can't figure this one out...


----------



## SirDice (Dec 8, 2020)

larhama said:


> I would like to get them all working if possible but the external usb dac is the most important one.


`sysctl hw.snd.default_unit=6`









						Chapter 8. Multimedia
					

FreeBSD supports a wide variety of sound cards, allowing users to enjoy high fidelity output from a FreeBSD system




					www.freebsd.org


----------



## larhama (Dec 8, 2020)

sysctl hw.snd.default_unit=6
cat file_example_WAV_1MG.wav > /dev/dsp
doesn't still produce anything audible...


----------



## SirDice (Dec 8, 2020)

/dev/dsp is connect to a virtual_oss(8) device, that's for bluetooth audio. Focus on the connected pcm devices first. Figure out which of the pcm is connected to your monitor. Each of the 4 devices (pcm0 to pcm3) corresponds to a particular display connector on your video card. You'll have to test which one corresponds to the connector that's actually connected to your monitor.


----------



## larhama (Dec 8, 2020)

pcm2 is my nvidia -> screen. that works when outputting to that device from vlc and gnome settings has /dev/dsp4 selected for audio output. Gnome itself is unable to output audio and web browsers too, since I don't know how to select device from the browser for outputting sound. There are 18 virtual audio output devices one can select from vlc and 6 dsp devices in gnome settings. I guess I now have to find the right combination to get my dac working... sigh


----------



## SirDice (Dec 8, 2020)

larhama said:


> pcm2 is my nvidia -> screen.


Then set `sysctl hw.snd.default_unit=2`. To make it permanent, add `hw.snd.default_unit=2` to /etc/sysctl.conf.



larhama said:


> Gnome itself is unable to output audio and web browsers too


Those will just use whichever audio device is set with `hw.snd.default_unit`.


----------



## larhama (Dec 8, 2020)

I got my dac working by sending nvidia->screen->optical out->dac. Not ideal but at least some progress. Thanks for the help.


----------

