# Audio Problems Intel 82801JD HDA Controller



## uii (Sep 22, 2018)

*Hello,*

I'am new to FreeBSD and installed the Mate Desktop and Ardour5 which works great, beside my problem with my soundcard.
The soundcard has at the backside of my box two stereo out channels, but only one is regognized by the system.
The problem also occurs in a webbrowser while playing an audio stream.

At the front of my box there is a headphone jack which did work once, but I never managed it to work again.
I tried the command:
sysctl hw.snd.default_unit=0  and
sysctl hw.snd.default_unit=1

Can anyone please help me to activate the second channel 3 and 4. 
Channels 1 and 2 are working just fine?

Thanks for reading and any help.

This is the output of my system:


```
$  cat /dev/sndstat
Installed devices:
pcm0: <Analog Devices AD1882 (Analog)> (play/rec) default
pcm1: <Analog Devices AD1882 (Front Analog Headphones)> (play)
No devices installed from userspace.


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


$ pciconf -lVv -a hdac0
hdac0@pci0:0:27:0:    class=0x040300 card=0x304817aa chip=0x3a6e8086 rev=0x02 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = '82801JD/DO (ICH10 Family) HD Audio Controller'
    class      = multimedia
    subclass   = HDA


$ sysctl -a | grep snd
device    snd_cmi
device    snd_csa
device    snd_emu10kx
device    snd_es137x
device    snd_hda
device    snd_ich
device    snd_via8233
hw.snd.maxautovchans: 16
hw.snd.default_unit: 0
hw.snd.version: 2009061500/amd64
hw.snd.default_auto: 0
hw.snd.verbose: 0
hw.snd.vpc_mixer_bypass: 1
hw.snd.feeder_rate_quality: 1
hw.snd.feeder_rate_round: 25
hw.snd.feeder_rate_max: 2016000
hw.snd.feeder_rate_min: 1
hw.snd.feeder_rate_polyphase_max: 183040
hw.snd.feeder_rate_presets: 100:8:0.85 100:36:0.92 100:164:0.97
hw.snd.feeder_eq_exact_rate: 0
hw.snd.feeder_eq_presets: PEQ:16000,0.2500,62,0.2500:-9,9,1.0:44100,48000,88200,96000,176400,192000
hw.snd.basename_clone: 1
hw.snd.compat_linux_mmap: 0
hw.snd.syncdelay: -1
hw.snd.usefrags: 0
hw.snd.vpc_reset: 0
hw.snd.vpc_0db: 45
hw.snd.vpc_autoreset: 1
hw.snd.timeout: 5
hw.snd.latency_profile: 1
hw.snd.latency: 5
hw.snd.report_soft_matrix: 1
hw.snd.report_soft_formats: 1


$dmesg | grep -i hda
hdac0: <Intel 82801JD HDA Controller> mem 0xfc520000-0xfc523fff irq 16 at device 27.0 on pci0
hdacc0: <Analog Devices AD1882 HDA CODEC> at cad 2 on hdac0
hdaa0: <Analog Devices AD1882 Audio Function Group> at nid 1 on hdacc0
hdaa0: Adding 58 (nid=35): Max connection reached! max=32
pcm0: <Analog Devices AD1882 (Analog)> at nid 18 and 23,20,24,21 on hdaa0
pcm1: <Analog Devices AD1882 (Front Analog Headphones)> at nid 17 on hdaa0


$sysctl -a | grep hda
device    snd_hda
dev.pcm.1.%parent: hdaa0
dev.pcm.0.%parent: hdaa0
dev.hdaa.0.reconfig: 0
dev.hdaa.0.gpo_config:
dev.hdaa.0.gpo_state:
dev.hdaa.0.gpio_config: 0=keep 1=keep
dev.hdaa.0.gpio_state: 0=disabled 1=disabled
dev.hdaa.0.gpi_state:
dev.hdaa.0.config: forcestereo,ivref50,ivref80,ivref100,ivref,vref
dev.hdaa.0.nid60: audio selector
dev.hdaa.0.nid59: vendor widget [DISABLED]
dev.hdaa.0.nid58: audio selector
dev.hdaa.0.nid57: audio selector
dev.hdaa.0.nid56: vendor widget [DISABLED]
dev.hdaa.0.nid55: audio selector
dev.hdaa.0.nid54: vendor widget [DISABLED]
dev.hdaa.0.nid53: vendor widget [DISABLED]
dev.hdaa.0.nid52: vendor widget [DISABLED]
dev.hdaa.0.nid51: vendor widget [DISABLED]
dev.hdaa.0.nid50: vendor widget [DISABLED]
dev.hdaa.0.nid49: vendor widget [DISABLED]
dev.hdaa.0.nid48: vendor widget [DISABLED]
dev.hdaa.0.nid47: vendor widget [DISABLED]
dev.hdaa.0.nid46: vendor widget [DISABLED]
dev.hdaa.0.nid45: audio mixer [DISABLED]
dev.hdaa.0.nid44: audio mixer [DISABLED]
dev.hdaa.0.nid43: vendor widget [DISABLED]
dev.hdaa.0.nid42: audio mixer [DISABLED]
dev.hdaa.0.nid41: audio mixer
dev.hdaa.0.nid40: vendor widget [DISABLED]
dev.hdaa.0.nid39: audio mixer [DISABLED]
dev.hdaa.0.nid38: audio mixer [DISABLED]
dev.hdaa.0.nid37: vendor widget [DISABLED]
dev.hdaa.0.nid36_original: 0x41016011 as=1 seq=1 device=Line-out conn=None ctype=1/8 loc=Rear color=Orange misc=0
dev.hdaa.0.nid36_config: 0x41016011 as=1 seq=1 device=Line-out conn=None ctype=1/8 loc=Rear color=Orange misc=0
dev.hdaa.0.nid36: pin: Line-out (None) [DISABLED]
dev.hdaa.0.nid35: vendor widget [DISABLED]
dev.hdaa.0.nid34: audio mixer
dev.hdaa.0.nid33: audio selector
dev.hdaa.0.nid32: audio mixer
dev.hdaa.0.nid31: vendor widget [DISABLED]
dev.hdaa.0.nid30: audio mixer [DISABLED]
dev.hdaa.0.nid29: audio mixer [DISABLED]
dev.hdaa.0.nid28: vendor widget [DISABLED]
dev.hdaa.0.nid27_original: 0x4145f1a0 as=10 seq=0 device=SPDIF-out conn=None ctype=Optical loc=Rear color=Other misc=1
dev.hdaa.0.nid27_config: 0x4145f1a0 as=10 seq=0 device=SPDIF-out conn=None ctype=Optical loc=Rear color=Other misc=1
dev.hdaa.0.nid27: pin: SPDIF-out (None) [DISABLED]
dev.hdaa.0.nid26_original: 0x91f711f0 as=15 seq=0 device=Other conn=Fixed ctype=Analog loc=0x11 color=Black misc=1
dev.hdaa.0.nid26_config: 0x91f711f0 as=15 seq=0 device=Other conn=Fixed ctype=Analog loc=0x11 color=Black misc=1
dev.hdaa.0.nid26: beep widget
dev.hdaa.0.nid25: power widget [DISABLED]
dev.hdaa.0.nid24_original: 0x99331122 as=2 seq=2 device=CD conn=Fixed ctype=ATAPI loc=Onboard color=Black misc=1
dev.hdaa.0.nid24_config: 0x99331122 as=2 seq=2 device=CD conn=Fixed ctype=ATAPI loc=Onboard color=Black misc=1
dev.hdaa.0.nid24: pin: CD (Fixed)
dev.hdaa.0.nid23_original: 0x01a19020 as=2 seq=0 device=Mic conn=Jack ctype=1/8 loc=Rear color=Pink misc=0
dev.hdaa.0.nid23_config: 0x01a19020 as=2 seq=0 device=Mic conn=Jack ctype=1/8 loc=Rear color=Pink misc=0
dev.hdaa.0.nid23: pin: Mic (Pink Jack)
dev.hdaa.0.nid22_original: 0x41011012 as=1 seq=2 device=Line-out conn=None ctype=1/8 loc=Rear color=Black misc=0
dev.hdaa.0.nid22_config: 0x41011012 as=1 seq=2 device=Line-out conn=None ctype=1/8 loc=Rear color=Black misc=0
dev.hdaa.0.nid22: pin: Line-out (None) [DISABLED]
dev.hdaa.0.nid21_original: 0x0181302e as=2 seq=14 device=Line-in conn=Jack ctype=1/8 loc=Rear color=Blue misc=0
dev.hdaa.0.nid21_config: 0x0181302e as=2 seq=14 device=Line-in conn=Jack ctype=1/8 loc=Rear color=Blue misc=0
dev.hdaa.0.nid21: pin: Line-in (Blue Jack)
dev.hdaa.0.nid20_original: 0x02a19021 as=2 seq=1 device=Mic conn=Jack ctype=1/8 loc=Front color=Pink misc=0
dev.hdaa.0.nid20_config: 0x02a19021 as=2 seq=1 device=Mic conn=Jack ctype=1/8 loc=Front color=Pink misc=0
dev.hdaa.0.nid20: pin: Mic (Pink Jack)
dev.hdaa.0.nid19_original: 0x911711f0 as=15 seq=0 device=Speaker conn=Fixed ctype=Analog loc=0x11 color=Black misc=1
dev.hdaa.0.nid19_config: 0x911711f0 as=15 seq=0 device=Speaker conn=Fixed ctype=Analog loc=0x11 color=Black misc=1
dev.hdaa.0.nid19: pin: Speaker (Fixed) [DISABLED]
dev.hdaa.0.nid18_original: 0x01014010 as=1 seq=0 device=Line-out conn=Jack ctype=1/8 loc=Rear color=Green misc=0
dev.hdaa.0.nid18_config: 0x01014010 as=1 seq=0 device=Line-out conn=Jack ctype=1/8 loc=Rear color=Green misc=0
dev.hdaa.0.nid18: pin: Line-out (Green Jack)
dev.hdaa.0.nid17_original: 0x02214030 as=3 seq=0 device=Headphones conn=Jack ctype=1/8 loc=Front color=Green misc=0
dev.hdaa.0.nid17_config: 0x02214030 as=3 seq=0 device=Headphones conn=Jack ctype=1/8 loc=Front color=Green misc=0
dev.hdaa.0.nid17: pin: Headphones (Green Jack)
dev.hdaa.0.nid16: beep widget
dev.hdaa.0.nid15: vendor widget [DISABLED]
dev.hdaa.0.nid14: vendor widget [DISABLED]
dev.hdaa.0.nid13: audio selector
dev.hdaa.0.nid12: audio selector
dev.hdaa.0.nid11: audio selector [DISABLED]
dev.hdaa.0.nid10: vendor widget [DISABLED]
dev.hdaa.0.nid9: audio input
dev.hdaa.0.nid8: audio input
dev.hdaa.0.nid7: vendor widget [DISABLED]
dev.hdaa.0.nid6: vendor widget [DISABLED]
dev.hdaa.0.nid5: audio output [DISABLED]
dev.hdaa.0.nid4: audio output
dev.hdaa.0.nid3: audio output
dev.hdaa.0.nid2: audio output [DISABLED]
dev.hdaa.0.%parent: hdacc0
dev.hdaa.0.%pnpinfo: type=0x01 subsystem=0x17aa3048
dev.hdaa.0.%location: nid=1
dev.hdaa.0.%driver: hdaa
dev.hdaa.0.%desc: Analog Devices AD1882 Audio Function Group
dev.hdaa.%parent:
dev.hdacc.0.%parent: hdac0
dev.hdacc.0.%pnpinfo: vendor=0x11d4 device=0x1882 revision=0x03 stepping=0x00
dev.hdacc.0.%location: cad=2
dev.hdacc.0.%driver: hdacc
dev.hdacc.0.%desc: Analog Devices AD1882 HDA CODEC
dev.hdacc.%parent:
dev.hdac.0.polling: 0
dev.hdac.0.pindump: 0
dev.hdac.0.%parent: pci0
dev.hdac.0.%pnpinfo: vendor=0x8086 device=0x3a6e subvendor=0x17aa subdevice=0x3048 class=0x040300
dev.hdac.0.%location: slot=27 function=0 dbsf=pci0:0:27:0
dev.hdac.0.%driver: hdac
dev.hdac.0.%desc: Intel 82801JD HDA Controller
dev.hdac.%parent:
```


----------



## shepper (Sep 22, 2018)

See example 4 of snd_hda(4)
Two newbie cautions:
1.  The man page is highly technical and for most requires some study.
2.  The hardware that provides snd_hda has about 40 different pin-outs (aka nwids) and manufacturers wire them differently. ie Asus may wire nwid 22 to the internal speakers while Apple uses nwid 23.  A verbose dmesg will list how your hardware manufacturer wired the nwids.  At boot, FreeBSD interogates and groups (associate, as=) the nwids by location.  They are not always grouped correctly or as you would like them.  The man page describes obtaining the verbose dmesg and how to change nwid as= and seq=.

If you have issues post back with the hw.snd portion of your verbose dmesg.


----------



## uii (Sep 23, 2018)

Thanks, but pointing to snd_hda(4) didn't bring the solution for me.
I wonder what does "No devices installed from userspace" mean?

`# cat /dev/sndstat
Installed devices:
pcm0: <Analog Devices AD1882 (Analog)> (play/rec) default
pcm1: <Analog Devices AD1882 (Front Analog Headphones)> (play)
No devices installed from userspace.`

Here is the verbose message:
`hdac0: <Intel 82801JD HDA Controller> mem 0xfc520000-0xfc523fff irq 16 at device 27.0 on pci0
hdac0: PCI card vendor: 0x17aa, device: 0x3048
hdac0: HDA Driver Revision: 20120126_0002
hdac0: Config options: on=0x00000000 off=0x00000000
hdac0: attempting to allocate 1 MSI vectors (1 supported)
hdac0: using IRQ 265 for MSI
hdac0: Caps: OSS 4, ISS 4, BSS 0, NSDO 1, 64bit, CORB 256, RIRB 256
random: harvesting attach, 8 bytes (4 bits) from hdac0
hdacc0: <Analog Devices AD1882 HDA CODEC> at cad 2 on hdac0
hdaa0: <Analog Devices AD1882 Audio Function Group> at nid 1 on hdacc0
hdaa0: Subsystem ID: 0x17aa3048
hdaa0: NumGPIO=2 NumGPO=0 NumGPI=0 GPIWake=0 GPIUnsol=1
hdaa0:  GPIO0: disabled
hdaa0:  GPIO1: disabled
hdaa0: WARNING: nid=29 has cnid outside of the AFG range j=0 entnum=4 index=0 res=0x00000b01
hdaa0: Adding 58 (nid=35): Max connection reached! max=32
hdaa0: Original pins configuration:
hdaa0: nid   0x    as seq device       conn  jack    loc        color   misc
hdaa0: 17 02214030 3  0  Headphones    Jack  1/8     Front      Green   0
hdaa0: 18 01014010 1  0  Line-out      Jack  1/8     Rear       Green   0
hdaa0: 19 911711f0 15 0  Speaker       Fixed Analog  0x11       Black   1
hdaa0: 20 02a19021 2  1  Mic           Jack  1/8     Front      Pink    0
hdaa0: 21 0181302e 2  14 Line-in       Jack  1/8     Rear       Blue    0
hdaa0: 22 41011012 1  2  Line-out      None  1/8     Rear       Black   0
hdaa0: 23 01a19020 2  0  Mic           Jack  1/8     Rear       Pink    0
hdaa0: 24 99331122 2  2  CD            Fixed ATAPI   Onboard    Black   1
hdaa0: 26 91f711f0 15 0  Other         Fixed Analog  0x11       Black   1
hdaa0: 27 4145f1a0 10 0  SPDIF-out     None  Optical Rear       Other   1
hdaa0: 36 41016011 1  1  Line-out      None  1/8     Rear       Orange  0
hdaa0: Patching widget caps nid=26 0x00400000 -> 0x00700000
hdaa0: Patched pins configuration:
hdaa0: nid   0x    as seq device       conn  jack    loc        color   misc
hdaa0: 17 02214030 3  0  Headphones    Jack  1/8     Front      Green   0
hdaa0: 18 01014010 1  0  Line-out      Jack  1/8     Rear       Green   0
hdaa0: 19 911711f0 15 0  Speaker       Fixed Analog  0x11       Black   1
hdaa0: 20 02a19021 2  1  Mic           Jack  1/8     Front      Pink    0
hdaa0: 21 0181302e 2  14 Line-in       Jack  1/8     Rear       Blue    0
hdaa0: 22 41011012 1  2  Line-out      None  1/8     Rear       Black   0 DISA
hdaa0: 23 01a19020 2  0  Mic           Jack  1/8     Rear       Pink    0
hdaa0: 24 99331122 2  2  CD            Fixed ATAPI   Onboard    Black   1
hdaa0: 27 4145f1a0 10 0  SPDIF-out     None  Optical Rear       Other   1 DISA
hdaa0: 36 41016011 1  1  Line-out      None  1/8     Rear       Orange  0 DISA
hdaa0: 4 associations found:
hdaa0: Association 0 (1) out:
hdaa0:  Pin nid=18 seq=0
hdaa0: Association 1 (2) in:
hdaa0:  Pin nid=23 seq=0
hdaa0:  Pin nid=20 seq=1
hdaa0:  Pin nid=24 seq=2
hdaa0:  Pin nid=21 seq=14
hdaa0: Association 2 (3) out:
hdaa0:  Pin nid=17 seq=0
hdaa0: Association 3 (15) out:
hdaa0:  Pin nid=19 seq=0
hdaa0: Tracing association 0 (1)
hdaa0:  Pin 18 traced to DAC 4
hdaa0: Association 0 (1) trace succeeded
hdaa0: Tracing association 1 (2)
hdaa0:  Pin 23 traced to ADC 8
hdaa0:  Pin 20 traced to ADC 8
hdaa0:  Pin 24 traced to ADC 8
hdaa0:  Pin 21 traced to ADC 8
hdaa0: Association 1 (2) trace succeeded
hdaa0: Tracing association 2 (3)
hdaa0:  Pin 17 traced to DAC 3
hdaa0: Association 2 (3) trace succeeded
hdaa0: Tracing association 3 (15)
hdaa0:  Unable to trace pin 19 seq 0 with min nid 0
hdaa0: Association 3 (15) trace failed
hdaa0: Looking for additional DAC for association 0 (1)
hdaa0: Looking for additional ADC for association 1 (2)
hdaa0:  ADC 9 considered equal to ADC 8
hdaa0: Looking for additional DAC for association 2 (3)
hdaa0: Tracing input monitor
hdaa0:  Tracing nid 32 to out
hdaa0:  nid 32 is input monitor
hdaa0: Tracing other input monitors
hdaa0:  Tracing nid 20 to out
hdaa0:  Tracing nid 21 to out
hdaa0:  Tracing nid 23 to out
hdaa0:  Tracing nid 24 to out
hdaa0: Tracing beeper
hdaa0: Pin sense: nid=17 sense=0xffffffff (connected)
hdaa0: Pin sense: nid=18 sense=0xffffffff (connected)
hdaa0: Pin sense: nid=21 sense=0xffffffff (connected)
hdaa0: FG config/quirks: forcestereo ivref50 ivref80 ivref100 ivref
pcm0: <Analog Devices AD1882 (Analog)> at nid 18 and 23,20,24,21 on hdaa0
pcm1: <Analog Devices AD1882 (Front Analog Headphones)> at nid 17 on hdaa0
random: harvesting attach, 8 bytes (4 bits) from hdaa0
random: harvesting attach, 8 bytes (4 bits) from hdacc0
hdaa0: Pin sense: nid=17 sense=0x7fffffff (disconnected)
hdaa0: Pin sense: nid=20 sense=0xffffffff (connected)
hdaa0: Pin sense: nid=20 sense=0x7fffffff (disconnected)
hdaa0: Pin sense: nid=17 sense=0xffffffff (connected)`

hdaa0: WARNING: nid=29 has cnid outside of the AFG range j=0 entnum=4 index=0 res=0x00000b01
*outside of the AFG range?*

The example in the *snd_hda(4) *manual doesn't explain to me where the variable "cad0" comes from.

*Example* *1*
     Setting the device.hints(5) options

     hint.hdac.0.*cad0*.nid20.config="as=1"
     hint.hdac.0.*cad0*.nid21.config="as=2"


How do I know what kernel modul is needed?
Could* snd*_*ich*  Intel ICH AC'97   and compatible bridge device driver the right one?
Well the box plays sound already. If I wouldn't need two ouputs, I would consider it as working perfectly out of the box?


----------



## shepper (Sep 23, 2018)

Part of this depends on your speaker setup.  You have the option of using the 2nd, presently non-functional rear jack as a Subwoofer (Center/LFE) or Rear sound (Quadro).
From snd_hda(4).

For  multichannel input/output associations sequence
numbers encode    channel    pairs positions: 0 - Front,
1 -    Center/LFE, 2 - Back, 3 - Front Wide Center,
4    - Side.     Standard combinations are: (0) - Stereo; (0, 2),
(0, 4)   - Quadro; (0,    1, 2), (0, 1, 4) - 5.1;    (0, 1, 2, 4) - 7.1.

Userspace devices typically are usb sound dongles.
I searched your warning for nwid 29 and got this hit on the German forums:
FreeBSD.DE Mixer for HDA5.1 sound



uii said:


> hdaa0: 17 02214030 3 0 Headphones Jack 1/8 Front Green 0
> hdaa0: 18 01014010 1 0 Line-out Jack 1/8 Rear Green 0
> hdaa0: 19 911711f0 15 0 Speaker Fixed Analog 0x11 Black 1
> hdaa0: 20 02a19021 2 1 Mic Jack 1/8 Front Pink 0
> ...



Question: what are the colors of the back jacks?  I'm assuming nwid 18 is Green and the one that works.  Your pin dump shows additional Rear Black and Orange output jacks

As far as the Front Headphones, if you put it in the same association as the rear sound and assign it a seq of 15, it should jack sense and mute the rear output(s)  when the headphone is plugged in.


----------



## uii (Sep 23, 2018)

Thanks for your advice and your patience.
Now I understand the basic principle and was able configure the soundcard. 
My main problem was, that I couldn't figure out the meaning of "cad0". 
The link you provided, made it by the examples clear for me.


----------



## uii (Sep 25, 2018)

Hello shepper,
hope you read this and you can help me again.

I have 2 jacks at the front. Green and pink.
and 3 jacks at the rear side. Blue, green and pink.

At the rear side, the green channel is connected to the monitor sound input.
The blue one to an audio box.

Most of the time I'm fine with the monitor sound, but sometimes I need more amplification for music.

I tried and tried, but I can't figure out how to get the same output to the blue and green jacks at the rear.

It is possible to change the order of the jacks, but I can't get them to work both at the same time.
Association 1 (2) is just for testing and not needed.

`hdaa0: Patching pin config nid=18 0x01014011 -> 0x0101401e
hdaa0: Patched pins configuration:
hdaa0: nid   0x    as seq device       conn  jack    loc        color   misc
hdaa0: 17 0221401f 1  15 Headphones    Jack  1/8     Front      Green   0
hdaa0: 18 0101401e 1  14 Line-out      Jack  1/8     Rear       Green   0
hdaa0: 19 91171100 0  0  Speaker       Fixed Analog  0x11       Black   1 DISA
hdaa0: 20 02a19001 0  1  Mic           Jack  1/8     Front      Pink    0 DISA
hdaa0: 21 01013010 1  0  Line-out      Jack  1/8     Rear       Blue    0
hdaa0: 22 41811000 0  0  Line-in       None  1/8     Rear       Black   0 DISA
hdaa0: 23 01019020 2  0  Line-out      Jack  1/8     Rear       Pink    0
hdaa0: 24 99331102 0  2  CD            Fixed ATAPI   Onboard    Black   1 DISA
hdaa0: 27 4145f100 0  0  SPDIF-out     None  Optical Rear       Other   1 DISA
hdaa0: 36 41016001 0  1  Line-out      None  1/8     Rear       Orange  0 DISA
hdaa0: 2 associations found:
hdaa0: Association 0 (1) out:
hdaa0:  Pin nid=21 seq=0
hdaa0:  Pin nid=18 seq=14
hdaa0:  Pin nid=17 seq=15
hdaa0: Association 1 (2) out:
hdaa0:  Pin nid=23 seq=0
hdaa0: Tracing association 0 (1)
hdaa0:  Pin 21 traced to DAC 3
hdaa0:  Pin 18 traced to DAC 4
hdaa0:  Pin 17 traced to DAC 3 and hpredir 0
hdaa0: Association 0 (1) trace succeeded
hdaa0: Tracing association 1 (2)
hdaa0:  Pin 23 traced to DAC 5
hdaa0: Association 1 (2) trace succeeded
hdaa0: Looking for additional DAC for association 0 (1)
hdaa0: Looking for additional DAC for association 1 (2)
hdaa0: Tracing input monitor
hdaa0: Tracing other input monitors
hdaa0: Tracing beeper
hdaa0:  nid 26 traced to out
hdaa0: Headphones redirection for association 0 nid=17 using unsolicited responses.
hdaa0: FG config/quirks: forcestereo ivref50 ivref80 ivref100 ivref
pcm0: <Analog Devices AD1882 (Analog 4ch+HP)> at nid 21,18,17 on hdaa0
pcm1: <Analog Devices AD1882 (Rear Analog Line-out)> at nid 23 on hdaa0`


```
hint.hdaa.0.nid17.config="as=1 seq=15"
hint.hdaa.0.nid18.config="as=1 seq=14 device=Line-out"
hint.hdaa.0.nid21.config="as=1 seq=0 device=Line-out"

hint.hdaa.0.nid23.config="as=2 seq=0 device=Line-out"

hint.hdaa.0.nid19.config="as=0"
hint.hdaa.0.nid20.config="as=0"
hint.hdaa.0.nid19.config="as=0"
hint.hdaa.0.nid22.config="as=0 seq=0 device=Line-in"
#hint.hdaa.0.nid23.config="as=0"
hint.hdaa.0.nid24.config="as=0"
hint.hdaa.0.nid27.config="as=0"
hint.hdaa.0.nid36.config="as=0"
```

Another question is how to change snd_hda at runtime?
It crackles, shows no errors, but it doesn't change anything. seq=14 stays seq=14 .


```
sysctl dev.hdaa.0.nid18_config="as=1 seq=1 device=Line-out"
sysctl dev.hdaa.0.reconfig=1
```
output:
`dev.hdaa.0.nid18_config: 0x0101401e as=1 seq=14 device=Line-out conn=Jack ctype=1/8 loc=Rear color=Green misc=0 -> 0x01014011 as=1 seq=1 device=Line-out conn=Jack ctype=1/8 loc=Rear color=Green misc=0
dev.hdaa.0.reconfig: 0 -> 0`

Thanks for any advice.


----------



## shepper (Oct 13, 2018)

Sorry, I did not see the last post until now.


uii said:


> hint.hdaa.0.nid18.config="as=1 seq=14 device=Line-out"


I believe this is your rear green output, seq=14 may not be a valid option - at least it is not described in snd_hda(4).
seq=14 is an option for input devices and allows you to mix two different inputs.
I would change nid18 seq to 0 and set the rear blue jack (nid21) to some seq between 0 and 3
where 0=front
           1= center Low frequency (sub woofer)
           2=back speakers
           3=front wide, center


```
hint.hdaa.0.nid17.config="as=1 seq=15"
hint.hdaa.0.nid18.config="as=1 seq=0 device=Line-out"
hint.hdaa.0.nid21.config="as=1 seq=3 device=Line-out"
```

With the above, your rear blue jack would be for the monitor speakers (in front)
and the rear blue jack auxiliary speakers in the front (front wide)


----------



## uii (Oct 13, 2018)

Thanks for your reply,

tried it, but still only one output.
I configured now it in a way, that I can switch between monitor and amplifier for music with a console command.
It's OK. Most important is, that I don't have to crawl under the desk for plugging the cables.


----------



## shepper (Oct 13, 2018)

If your inclined to avoid the console command, sound(4) has more config options.



> dev.pcm.%d.[play|rec].vchanformat
> Format for	VCHAN mixing.  All playback paths will be converted to
> this format before	the mixing process begins.  By default only 2
> channels are enabled.  Available options include:
> ...


----------



## uii (Oct 17, 2018)

Hi and thanks again

I did set my `device.hints` to:
`hint.hdaa.0.nid18.config="as=1 seq=4 device=Line-out"
hint.hdaa.0.nid21.config="as=1 seq=0 device=Line-out"`
executed:
`sysctl dev.pcm.0.play.vchanformat="s16le:4.0"`

and this surround demo does play correctly.  https://www2.iis.fraunhofer.de/AAC/ChID-BLITS-EBU.mp4

But a stereo file still uses only two speakers and I can't figure out, how to even switch the front and surround speakers.


----------

