snd_hda.7.20080905 with ad1988b

Jochen Keil jochen.keil at
Tue Sep 9 18:55:46 UTC 2008


just wanted to report that

$ sudo sysctl -w hw.snd.default_unit=2
hw.snd.default_unit: 0 -> 2

did the trick for me (saw this in another email here on that list).

Now my FreeBSD box is making noise over digital (optical) S/PDIF output 
although there are no devices (at least) i cannot see in /dev.
Thank you so very much for that.

Unfortunately i cannot get AC3 passthrough to work.

If i try with mplayer all i hear is some (real) noise.. like.. the 
stream doesn't get decoded and played raw. (Had the same issue with 
Windows XP until they came up with a new driver version).
I installed audio/oss (another hint from this list ;) and passthrough 
worked. Only problem now: can't get stereo output.
The oss driver from the ports seems to be able to change to ac3 while trying this with snd_hda (sysctl 
-w didn't work.

This is what mplayer tells me when i try to force the codec to hwac3:
Forced audio codec: hwac3
Opening audio decoder: [hwac3] AC3/DTS pass-through S/PDIF
No accelerated IMDCT transform found
hwac3: switched to AC3, 448000 bps, 48000 Hz
AUDIO: 48000 Hz, 2 ch, ac3, 448.0 kbit/29.17% (ratio: 56000->192000)
Selected audio codec: [hwac3] afm: hwac3 (AC3 through S/PDIF)
[AO OSS] Can't set audio device /dev/dsp to ac3 output, trying s16le...
AO: [oss] 48000Hz 2ch s16le (2 bytes per sample)
[format] Sample format big-endian AC3 not yet supported
[libaf] Reinitialization did not work, audio filter 'format' returned 
error code -2
Couldn't find matching filter/ao format!

Interestingly enough i already got it somehow working by accident before 
i knew of hw.snd.default_unit. I can't reproduce it though.
Any hints on this?
I'd be glad to provide more info if you want/need.

At last i wanted to mention that with "I didn't get that whole nid stuff 
though.." i wanted to express that i didn't (and still don't) really 
understand what it means/does/is.. classical misunderstanding :)


Jochen Keil wrote:
 > i've patched and built snd_hda.
 > Unfortunately there are no pcm oder dsp devices in /dev, thus i cannot
 > use sound output.

Driver tells that they are there. Probably you just don't see them.

 > Attached you'll find dmesg.verbose and cat /dev/sndstat:
 > $ cat /dev/sndstat
 > FreeBSD Audio Driver (newpcm: 32bit 2007061600/i386)
 > Installed devices:
 > pcm0: <HDA codec #0 Analog Devices AD1988B PCM #0> at hdac0 cad 0 kld
 > snd_hda [20080905_0107] [MPSAFE] (1p:1v/1r:1v channels duplex default)

This is a playback via 4 connectors (7.1 in theory) and line, mic, cd,
mix, monitor recording.

 > pcm1: <HDA codec #0 Analog Devices AD1988B PCM #1> at hdac0 cad 0 kld
 > snd_hda [20080905_0107] [MPSAFE] (1p:1v/0r:0v channels)

This is Headphones connector playback. Strange that BIOS vendor
configured respective microphone as part of pcm0 but not pcm1. Also this
Headphones could be configured for sound redirection from pcm0 output,
but it also wasn't done. So if you wish - you have a wide range of
experiments possible.

 > pcm2: <HDA codec #0 Analog Devices AD1988B PCM #2> at hdac0 cad 0 kld
 > snd_hda [20080905_0107] [MPSAFE] (1p:1v/0r:0v channels)

This is SPDIF playback.

 > I'd be glad to help you with further information, just tell me what you
 > need/i'm supposed to do.

Just try to use it. :)

 > I didn't get that whole nid stuff though..

Logs were wrapped. Those nid stuff may be dumped with
sysctl dev.hdac.0.pindump=1

Alexander Motin

More information about the freebsd-multimedia mailing list