Re: [alsa-devel] Intel HDA / ALC662 analog surround problem
You have to post the output of alsa-info.sh
Please see the attached file.
[ 0.655493] sound hdaudioC1D0: autoconfig: line_outs=1
(0x14/0x0/0x0/0x0/0x0) type:line
[ 0.655494] sound hdaudioC1D0: speaker_outs=1
(0x15/0x0/0x0/0x0/0x0)
[ 0.655495] sound hdaudioC1D0: hp_outs=1 (0x1b/0x0/0x0/0x0/0x0) [ 0.655496] sound hdaudioC1D0: mono: mono_out=0x0 [ 0.655496] sound hdaudioC1D0: dig-out=0x1e/0x0 [ 0.655497] sound hdaudioC1D0: inputs: [ 0.655498] sound hdaudioC1D0: Front Mic=0x19 [ 0.655499] sound hdaudioC1D0: Rear Mic=0x18 [ 0.655499] sound hdaudioC1D0: Line=0x1a
This is a known bug of hda_generic.c for those desktop with internal speaker and three audio jacks at rear panel (e.g. those lenovo
thinkcenter
with alc66x codec)
The driver prefer to assign volume control/dac to headphone, line out
and
internal speaker instead of line out and the other two multi io jacks
The workaround is to change the internal speaker as not connected node 0x15
Could you please advise how to do this? Is it possible from userland or
do I
have to patch something?
Would a new fixup mode definition for the kernel help and if yes, how
should
it look like, i.e. which pins should be listed? (I'm capable of
submitting a
kernel patch.)
Try early patching/hdajackretask to change node 0x15 Speaker as not connected
or
You need to increase badness of multi io so that driver select multi io
as
the best config
I've found your patch from 2013 while googling for the topic. The current kernel already sets BAD_MULTI_IO = 0x120.
Do you mean to further increase it? If so, to what value, or is increasing possible from userland?
https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/commit/sound/pc...
This patch has side effect on your configuration with three DAC as it create "Master playback volume" at node 0x02 and "Speaker+LO Playback switch at node 0x14 line out jack
Raymond,
[ 0.655493] sound hdaudioC1D0: autoconfig: line_outs=1 (0x14/0x0/0x0/0x0/0x0) type:line [ 0.655494] sound hdaudioC1D0: speaker_outs=1 (0x15/0x0/0x0/0x0/0x0) [ 0.655495] sound hdaudioC1D0: hp_outs=1 (0x1b/0x0/0x0/0x0/0x0) [ 0.655496] sound hdaudioC1D0: mono: mono_out=0x0 [ 0.655496] sound hdaudioC1D0: dig-out=0x1e/0x0 [ 0.655497] sound hdaudioC1D0: inputs: [ 0.655498] sound hdaudioC1D0: Front Mic=0x19 [ 0.655499] sound hdaudioC1D0: Rear Mic=0x18 [ 0.655499] sound hdaudioC1D0: Line=0x1a
This is a known bug of hda_generic.c for those desktop with internal speaker and three audio jacks at rear panel (e.g. those lenovo thinkcenter with alc66x codec)
The driver prefer to assign volume control/dac to headphone, line out and internal speaker instead of line out and the other two multi io jacks
Thanks to your kind help, I was able to try out several things.
First I tried the multi_io hint
echo "multi_io = yes" > /sys/class/sound/hwC1D0/hints echo 1 > /sys/class/sound/hwC1D0/reconfig
without success.
Then I tried init_verbs
echo "0x15 0x707 0" > /sys/class/sound/hwC1D0/init_verbs echo 1 > /sys/class/sound/hwC1D0/reconfig
again without success.
I went without early patching.
or You need to increase BAD_MULTI_IO from 0x120 to 0x4120 since BAD_NO_DAC 0x4000 for the driver to select config with mio=1
This was successful! But, although I'm very happy with the result and although I don't mind adding this to my private kernel patches, I'm wondering whether there isn't a better way, i.e. a way that could help others using the same or a similar motherboard.
The driver seem to avoid the playback volume control shared by internal speaker, headphone and line out, this may mean that you need a suitable name for this volume control
I don't get the meaning of that. Will I miss a volume control or do I have one with an inappropriate name?
https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/commit/sound/pc...
This patch has side effect on your configuration with three DAC as it create "Master playback volume" at node 0x02 and "Speaker+LO Playback switch at node 0x14 line out jack
This patch further improves things. I have now the following new controls:
Headphone (isn't new, but now only a toggle control, no volume control) Speaker+LO toogle control Surround volume control Center volume control LFE volume control Channel Mode allowing 2ch, 4ch, 6ch
Do "pcm playback volume" affect the volume after you change channel mode from 2ch to 6 ch so that mic and line in jacks are retasked as output ?
The master volume control affects the line out volume (which is named PCM, btw), but no other output. Muting the master, however, affects all outputs.
After changing to 4ch or 6ch, the PCM (line out) volume control acts as a "master" for surround and center/lfe.
A quick check seemed to show that all jacks or working input and output, so thank you very much indeed for your help.
Ingo
[ 0.655493] sound hdaudioC1D0: autoconfig: line_outs=1
(0x14/0x0/0x0/0x0/0x0) type:line
[ 0.655494] sound hdaudioC1D0: speaker_outs=1
(0x15/0x0/0x0/0x0/0x0)
[ 0.655495] sound hdaudioC1D0: hp_outs=1 (0x1b/0x0/0x0/0x0/0x0) [ 0.655496] sound hdaudioC1D0: mono: mono_out=0x0 [ 0.655496] sound hdaudioC1D0: dig-out=0x1e/0x0 [ 0.655497] sound hdaudioC1D0: inputs: [ 0.655498] sound hdaudioC1D0: Front Mic=0x19 [ 0.655499] sound hdaudioC1D0: Rear Mic=0x18 [ 0.655499] sound hdaudioC1D0: Line=0x1a
This is a known bug of hda_generic.c for those desktop with internal speaker and three audio jacks at rear panel (e.g. those lenovo thinkcenter with alc66x codec)
The driver prefer to assign volume control/dac to headphone, line
out and
internal speaker instead of line out and the other two multi io jacks
Thanks to your kind help, I was able to try out several things.
First I tried the multi_io hint
echo "multi_io = yes" > /sys/class/sound/hwC1D0/hints echo 1 > /sys/class/sound/hwC1D0/reconfig
without success.
Then I tried init_verbs
echo "0x15 0x707 0" > /sys/class/sound/hwC1D0/init_verbs echo 1 > /sys/class/sound/hwC1D0/reconfig
again without success.
Dynamic reconfig work if you want to change unconnected pin complex to connected pin complex, the driver seem did not disable unsolicited event when user change connected jack to unconnected.
I went without early patching.
or You need to increase BAD_MULTI_IO from 0x120 to 0x4120 since BAD_NO_DAC 0x4000 for the driver to select config with mio=1
This was successful! But, although I'm very happy with the result and although I don't mind adding this to my private kernel patches, I'm
wondering
whether there isn't a better way, i.e. a way that could help others using
the
same or a similar motherboard.
using hda-emu or debug version of alsa-driver
==> lo_type=0, wired=1, mio=1, badness=0x352 multi_outs = 14/0/0/0 : 2/0/0/0 (type LO) out path: depth=3 '02:0c:14' hp_outs = 1b/0/0/0 : 2/0/0/0 hp path: depth=3 '02:0c:1b' spk_outs = 15/0/0/0 : 3/0/0/0 spk path: depth=3 '03:0d:15' ==> lo_type=0, wired=1, mio=0, badness=0x120 multi_outs = 14/0/0/0 : 2/0/0/0 (type LO) out path: depth=3 '02:0c:14' hp_outs = 1b/0/0/0 : 4/0/0/0 hp path: depth=3 '04:0e:1b' spk_outs = 15/0/0/0 : 3/0/0/0 spk path: depth=3 '03:0d:15' send: NID=0x18, VERB=0xf00(get_parameters), PARM=0x12(amp_out_cap) receive: 0x80000000 ==> lo_type=0, wired=0, mio=1, badness=0x4112 multi_outs = 14/0/0/0 : 2/3/4/0 (type LO) out path: depth=3 '02:0c:14' multi_ios(2) = 1a/18 : 3/4 mio path: depth=3 '03:0d:1a' mio path: depth=3 '04:0e:18' hp_outs = 1b/0/0/0 : 2/0/0/0 hp path: depth=3 '02:0c:1b' spk_outs = 15/0/0/0 : 0/0/0/0 ==> lo_type=0, wired=0, mio=0, badness=0x4120 multi_outs = 14/0/0/0 : 2/0/0/0 (type LO) out path: depth=3 '02:0c:14' hp_outs = 1b/0/0/0 : 3/0/0/0 hp path: depth=3 '03:0d:1b' spk_outs = 15/0/0/0 : 0/0/0/0 ==> restoring best_cfg ==> Best config: lo_type=0, wired=1, mio=0 multi_outs = 14/0/0/0 : 2/0/0/0 (type LO) out path: depth=3 '02:0c:14' hp_outs = 1b/0/0/0 : 4/0/0/0 hp path: depth=3 '04:0e:1b' spk_outs = 15/0/0/0 : 3/0/0/0 spk path: depth=3 '03:0d:15'
The current driver select config with smallest badness but it does not contain
multi_outs = 14/0/0/0 : 2/3/4/0 (type LO) out path: depth=3 '02:0c:14' multi_ios(2) = 1a/18 : 3/4 mio path: depth=3 '03:0d:1a' mio path: depth=3 '04:0e:18'
You need an ad hoc check of increasing the badness due to multi io cannot be assigned for those realtek alc66x codecs with 3stack and internal speaker
The driver seem to avoid the playback volume control shared by internal speaker, headphone and line out, this may mean that you need a suitable name for this volume control
I don't get the meaning of that. Will I miss a volume control or do I have one with an inappropriate name?
assign different DAC to headphone and line out allow the driver to support independent headphone for those 2+2 and 7.1+2 channels HDA codecs
http://www.intel.com/support/motherboards/desktop/sb/CS-034206.htm
http://www.realtek.com.tw/products/productsView.aspx?Langid=1&PNid=14&am... Seem only those four channel codecs support 2+2 and 10 channels codecs 7.1+2
* Independent HP When this enum control is enabled, the headphone output is routed from an individual stream (the third PCM such as hw:0,2) instead of the primary stream.
https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/commit/sound/pc...
This patch has side effect on your configuration with three DAC as it create "Master playback volume" at node 0x02 and "Speaker+LO Playback switch at node 0x14 line out jack
This patch further improves things. I have now the following new controls:
Headphone (isn't new, but now only a toggle control, no volume
control)
This is because HP, Line Out and internal speaker sharing the same DAC and volume control since the other two DAC are used by retasked output jacks
Node 0x02 [Audio Output] wcaps 0x41d: Stereo Amp-Out Control: name="Master Playback Volume", index=0, device=0 ControlAmp: chs=3, dir=Out, idx=0, ofs=0 Device: name="ALC662 rev3 Analog", type="Audio", device=0 Amp-Out caps: ofs=0x57, nsteps=0x57, stepsize=0x02, mute=0 Amp-Out vals: [0x00 0x00] Converter: stream=0, channel=0 PCM: rates [0x560]: 44100 48000 96000 192000 bits [0xe]: 16 20 24 formats [0x1]: PCM Power states: D0 D1 D2 D3 Power: setting=D0, actual=D0 Node 0x03 [Audio Output] wcaps 0x41d: Stereo Amp-Out Control: name="Surround Playback Volume", index=0, device=0 ControlAmp: chs=3, dir=Out, idx=0, ofs=0 Amp-Out caps: ofs=0x57, nsteps=0x57, stepsize=0x02, mute=0 Amp-Out vals: [0x00 0x00] Converter: stream=0, channel=0 PCM: rates [0x560]: 44100 48000 96000 192000 bits [0xe]: 16 20 24 formats [0x1]: PCM Power states: D0 D1 D2 D3 Power: setting=D0, actual=D0 Node 0x04 [Audio Output] wcaps 0x41d: Stereo Amp-Out Control: name="Center Playback Volume", index=0, device=0 ControlAmp: chs=1, dir=Out, idx=0, ofs=0 Control: name="LFE Playback Volume", index=0, device=0 ControlAmp: chs=2, dir=Out, idx=0, ofs=0 Amp-Out caps: ofs=0x57, nsteps=0x57, stepsize=0x02, mute=0 Amp-Out vals: [0x00 0x00] Converter: stream=0, channel=0 PCM: rates [0x560]: 44100 48000 96000 192000 bits [0xe]: 16 20 24 formats [0x1]: PCM Power states: D0 D1 D2 D3 Power: setting=D0, actual=D0
Speaker+LO toogle control
Node 0x14 [Pin Complex] wcaps 0x40058d: Stereo Amp-Out Control: name="Speaker+LO Playback Switch", index=0, device=0 ControlAmp: chs=3, dir=Out, idx=0, ofs=0 Control: name="Line Out Jack", index=0, device=0 Amp-Out caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1 Amp-Out vals: [0x80 0x80] Pincap 0x0001003c: IN OUT HP EAPD Detect EAPD 0x2: EAPD Pin Default 0x01014010: [Jack] Line Out at Ext Rear Conn = 1/8, Color = Green DefAssociation = 0x1, Sequence = 0x0 Pin-ctls: 0x40: OUT Unsolicited: tag=02, enabled=1 Power states: D0 D1 D2 D3 Power: setting=D0, actual=D0 Connection: 1 0x0c
Surround volume control Center volume control LFE volume control Channel Mode allowing 2ch, 4ch, 6ch
Do "pcm playback volume" affect the volume after you change channel
mode
from 2ch to 6 ch so that mic and line in jacks are retasked as
output ?
The master volume control affects the line out volume (which is named PCM, btw), but no other output. Muting the master, however, affects all
outputs.
After changing to 4ch or 6ch, the PCM (line out) volume control acts as a "master" for surround and center/lfe.
Seem "master playback volume" is not the correct name when using surround 5.1 and your config lost the virtual master playback volume
Raymond,
I'm not familiar with hardware, so I had some difficulties to understand what's going on here, but then I got really curious. So I grabbed an ALC662 datasheet and studied the block diagram. Now I think that I'm beginning to understand.
[ 0.655493] sound hdaudioC1D0: autoconfig: line_outs=1 (0x14/0x0/0x0/0x0/0x0) type:line [ 0.655494] sound hdaudioC1D0: speaker_outs=1 (0x15/0x0/0x0/0x0/0x0) [ 0.655495] sound hdaudioC1D0: hp_outs=1 (0x1b/0x0/0x0/0x0/0x0) [ 0.655496] sound hdaudioC1D0: mono: mono_out=0x0 [ 0.655496] sound hdaudioC1D0: dig-out=0x1e/0x0 [ 0.655497] sound hdaudioC1D0: inputs: [ 0.655498] sound hdaudioC1D0: Front Mic=0x19 [ 0.655499] sound hdaudioC1D0: Rear Mic=0x18 [ 0.655499] sound hdaudioC1D0: Line=0x1a
This is a known bug of hda_generic.c for those desktop with internal speaker and three audio jacks at rear panel (e.g. those lenovo thinkcenter with alc66x codec)
The driver prefer to assign volume control/dac to headphone, line out and internal speaker instead of line out and the other two multi io jacks
or You need to increase BAD_MULTI_IO from 0x120 to 0x4120 since BAD_NO_DAC 0x4000 for the driver to select config with mio=1
==> lo_type=0, wired=1, mio=1, badness=0x352 multi_outs = 14/0/0/0 : 2/0/0/0 (type LO) out path: depth=3 '02:0c:14' hp_outs = 1b/0/0/0 : 2/0/0/0 hp path: depth=3 '02:0c:1b' spk_outs = 15/0/0/0 : 3/0/0/0 spk path: depth=3 '03:0d:15' ==> lo_type=0, wired=1, mio=0, badness=0x120 multi_outs = 14/0/0/0 : 2/0/0/0 (type LO) out path: depth=3 '02:0c:14' hp_outs = 1b/0/0/0 : 4/0/0/0 hp path: depth=3 '04:0e:1b' spk_outs = 15/0/0/0 : 3/0/0/0 spk path: depth=3 '03:0d:15' send: NID=0x18, VERB=0xf00(get_parameters), PARM=0x12(amp_out_cap) receive: 0x80000000 ==> lo_type=0, wired=0, mio=1, badness=0x4112 multi_outs = 14/0/0/0 : 2/3/4/0 (type LO) out path: depth=3 '02:0c:14' multi_ios(2) = 1a/18 : 3/4 mio path: depth=3 '03:0d:1a' mio path: depth=3 '04:0e:18' hp_outs = 1b/0/0/0 : 2/0/0/0 hp path: depth=3 '02:0c:1b' spk_outs = 15/0/0/0 : 0/0/0/0 ==> lo_type=0, wired=0, mio=0, badness=0x4120 multi_outs = 14/0/0/0 : 2/0/0/0 (type LO) out path: depth=3 '02:0c:14' hp_outs = 1b/0/0/0 : 3/0/0/0 hp path: depth=3 '03:0d:1b' spk_outs = 15/0/0/0 : 0/0/0/0 ==> restoring best_cfg ==> Best config: lo_type=0, wired=1, mio=0 multi_outs = 14/0/0/0 : 2/0/0/0 (type LO) out path: depth=3 '02:0c:14' hp_outs = 1b/0/0/0 : 4/0/0/0 hp path: depth=3 '04:0e:1b' spk_outs = 15/0/0/0 : 3/0/0/0 spk path: depth=3 '03:0d:15'
The current driver select config with smallest badness You need an ad hoc check of increasing the badness due to multi io cannot be assigned for those realtek alc66x codecs with 3stack and internal speaker
I think I've figured out how to safely perform a private kernel patch for it.
diff -Nur a/sound/pci/hda/hda_generic.c b/sound/pci/hda/hda_generic.c --- a/sound/pci/hda/hda_generic.c 2015-02-11 08:01:12.000000000 +0100 +++ b/sound/pci/hda/hda_generic.c 2015-03-02 22:57:34.799192329 +0100 @@ -1233,7 +1233,8 @@ dac = spec->private_dac_nids[0]; badness += bad->shared_surr_main; } else if (!i) - badness += bad->no_primary_dac; + /* no additional badness for 0x15 (speaker) without DAC (during multi-io check) */ + badness += pin == 0x15 ? 0 : bad->no_primary_dac; else badness += bad->no_dac; }
Now I'm getting the favored config:
==> lo_type=0, wired=1, mio=1, badness=0x352 multi_outs = 14/0/0/0 : 2/0/0/0 (type LO) hp_outs = 1b/0/0/0 : 2/0/0/0 spk_outs = 15/0/0/0 : 3/0/0/0 ==> lo_type=0, wired=1, mio=0, badness=0x120 multi_outs = 14/0/0/0 : 2/0/0/0 (type LO) hp_outs = 1b/0/0/0 : 4/0/0/0 spk_outs = 15/0/0/0 : 3/0/0/0 ==> lo_type=0, wired=0, mio=1, badness=0x112 multi_outs = 14/0/0/0 : 2/3/4/0 (type LO) multi_ios(2) = 1a/18 : 3/4 hp_outs = 1b/0/0/0 : 2/0/0/0 spk_outs = 15/0/0/0 : 0/0/0/0 ==> lo_type=0, wired=0, mio=0, badness=0x120 multi_outs = 14/0/0/0 : 2/0/0/0 (type LO) hp_outs = 1b/0/0/0 : 3/0/0/0 spk_outs = 15/0/0/0 : 0/0/0/0 ==> restoring best_cfg ==> Best config: lo_type=0, wired=0, mio=1 multi_outs = 14/0/0/0 : 2/3/4/0 (type LO) multi_ios(2) = 1a/18 : 3/4 hp_outs = 1b/0/0/0 : 2/0/0/0 spk_outs = 15/0/0/0 : 0/0/0/0
The master volume control affects the line out volume (which is named PCM, btw), but no other output. Muting the master, however, affects all outputs.
After changing to 4ch or 6ch, the PCM (line out) volume control acts as a "master" for surround and center/lfe.
Seem "master playback volume" is not the correct name when using surround 5.1 and your config lost the virtual master playback volume
It seems that this is fixable. Patch will follow.
By the way, there is one thing I still don't understand. After booting there is no "PCM Playback Volume" control in alsamixer. As soon as I've played some wav file, it appears. Where does it come from, i.e. is it created by kernel or alsa-lib/utils and why?
Ingo
I'm not familiar with hardware, so I had some difficulties to understand what's going on here, but then I got really curious. So I grabbed an
ALC662
datasheet and studied the block diagram. Now I think that I'm beginning to understand.
[ 0.655493] sound hdaudioC1D0: autoconfig: line_outs=1
(0x14/0x0/0x0/0x0/0x0) type:line
[ 0.655494] sound hdaudioC1D0: speaker_outs=1
(0x15/0x0/0x0/0x0/0x0)
[ 0.655495] sound hdaudioC1D0: hp_outs=1
(0x1b/0x0/0x0/0x0/0x0)
[ 0.655496] sound hdaudioC1D0: mono: mono_out=0x0 [ 0.655496] sound hdaudioC1D0: dig-out=0x1e/0x0 [ 0.655497] sound hdaudioC1D0: inputs: [ 0.655498] sound hdaudioC1D0: Front Mic=0x19 [ 0.655499] sound hdaudioC1D0: Rear Mic=0x18 [ 0.655499] sound hdaudioC1D0: Line=0x1a
This is a known bug of hda_generic.c for those desktop with
internal
speaker and three audio jacks at rear panel (e.g. those lenovo thinkcenter with alc66x codec)
The driver prefer to assign volume control/dac to headphone, line
out and
internal speaker instead of line out and the other two multi io
jacks
or You need to increase BAD_MULTI_IO from 0x120 to 0x4120 since BAD_NO_DAC 0x4000 for the driver to select config with mio=1
==> lo_type=0, wired=1, mio=1, badness=0x352 multi_outs = 14/0/0/0 : 2/0/0/0 (type LO) out path: depth=3 '02:0c:14' hp_outs = 1b/0/0/0 : 2/0/0/0 hp path: depth=3 '02:0c:1b' spk_outs = 15/0/0/0 : 3/0/0/0 spk path: depth=3 '03:0d:15' ==> lo_type=0, wired=1, mio=0, badness=0x120 multi_outs = 14/0/0/0 : 2/0/0/0 (type LO) out path: depth=3 '02:0c:14' hp_outs = 1b/0/0/0 : 4/0/0/0 hp path: depth=3 '04:0e:1b' spk_outs = 15/0/0/0 : 3/0/0/0 spk path: depth=3 '03:0d:15' send: NID=0x18, VERB=0xf00(get_parameters), PARM=0x12(amp_out_cap) receive: 0x80000000 ==> lo_type=0, wired=0, mio=1, badness=0x4112 multi_outs = 14/0/0/0 : 2/3/4/0 (type LO) out path: depth=3 '02:0c:14' multi_ios(2) = 1a/18 : 3/4 mio path: depth=3 '03:0d:1a' mio path: depth=3 '04:0e:18' hp_outs = 1b/0/0/0 : 2/0/0/0 hp path: depth=3 '02:0c:1b' spk_outs = 15/0/0/0 : 0/0/0/0 ==> lo_type=0, wired=0, mio=0, badness=0x4120 multi_outs = 14/0/0/0 : 2/0/0/0 (type LO) out path: depth=3 '02:0c:14' hp_outs = 1b/0/0/0 : 3/0/0/0 hp path: depth=3 '03:0d:1b' spk_outs = 15/0/0/0 : 0/0/0/0 ==> restoring best_cfg ==> Best config: lo_type=0, wired=1, mio=0 multi_outs = 14/0/0/0 : 2/0/0/0 (type LO) out path: depth=3 '02:0c:14' hp_outs = 1b/0/0/0 : 4/0/0/0 hp path: depth=3 '04:0e:1b' spk_outs = 15/0/0/0 : 3/0/0/0 spk path: depth=3 '03:0d:15'
The current driver select config with smallest badness You need an ad hoc check of increasing the badness due to multi io
cannot
be assigned for those realtek alc66x codecs with 3stack and internal speaker
I think I've figured out how to safely perform a private kernel patch for
it.
diff -Nur a/sound/pci/hda/hda_generic.c b/sound/pci/hda/hda_generic.c --- a/sound/pci/hda/hda_generic.c 2015-02-11 08:01:12.000000000
+0100
+++ b/sound/pci/hda/hda_generic.c 2015-03-02 22:57:34.799192329
+0100
@@ -1233,7 +1233,8 @@ dac = spec->private_dac_nids[0]; badness += bad->shared_surr_main; } else if (!i)
badness += bad->no_primary_dac;
/* no additional badness for 0x15
(speaker) without DAC (during multi-io check) */
badness += pin == 0x15 ? 0 :
bad->no_primary_dac;
else badness += bad->no_dac; }
You cannot hardcode 0x15
if (cfg->line_out_type != AUTO_PIN_SPEAKER_OUT) { err = try_assign_dacs(codec, cfg->speaker_outs, cfg->speaker_pins, spec->multiout.extra_out_nid, spec->speaker_paths, spec->extra_out_badness); if (err < 0) return err; badness += err;
Don't add err to badness when (err = 0x4000 && nid_has_volume(codec, spec->multiout.dac_nid[0],HDA_OUTPUT) && cfg->lineout_type == AUTO_PIN_LINE_OUT && cfg->line_outs == 1 && cfg->hp_outs == 1 && cfg->speaker_outs == 1 && count_multiio_pins(codec, cfg->line_out_pins[0]) == 2 && number of analog dacs == 3)
Now I'm getting the favored config:
==> lo_type=0, wired=1, mio=1, badness=0x352 multi_outs = 14/0/0/0 : 2/0/0/0 (type LO) hp_outs = 1b/0/0/0 : 2/0/0/0 spk_outs = 15/0/0/0 : 3/0/0/0 ==> lo_type=0, wired=1, mio=0, badness=0x120 multi_outs = 14/0/0/0 : 2/0/0/0 (type LO) hp_outs = 1b/0/0/0 : 4/0/0/0 spk_outs = 15/0/0/0 : 3/0/0/0 ==> lo_type=0, wired=0, mio=1, badness=0x112 multi_outs = 14/0/0/0 : 2/3/4/0 (type LO) multi_ios(2) = 1a/18 : 3/4 hp_outs = 1b/0/0/0 : 2/0/0/0 spk_outs = 15/0/0/0 : 0/0/0/0 ==> lo_type=0, wired=0, mio=0, badness=0x120 multi_outs = 14/0/0/0 : 2/0/0/0 (type LO) hp_outs = 1b/0/0/0 : 3/0/0/0 spk_outs = 15/0/0/0 : 0/0/0/0 ==> restoring best_cfg ==> Best config: lo_type=0, wired=0, mio=1 multi_outs = 14/0/0/0 : 2/3/4/0 (type LO) multi_ios(2) = 1a/18 : 3/4 hp_outs = 1b/0/0/0 : 2/0/0/0 spk_outs = 15/0/0/0 : 0/0/0/0
How do the driver know the volume control at node 0x02 is shared by hp, line out and speaker when your spk_outs path not contain node 0x02
Since those Dell Inspirion 660 also is a 3stack desktop without speaker with alc662 which need "Front+Headphone Playback Volume"
BTW do the driver need to disable independent headphone after your change ? Independent headphone need line out and headphone use different DACs
Do alc662 support 4+2 or NOT ?
The master volume control affects the line out volume (which is named
PCM,
btw), but no other output. Muting the master, however, affects all
outputs.
After changing to 4ch or 6ch, the PCM (line out) volume control acts
as a
"master" for surround and center/lfe.
Seem "master playback volume" is not the correct name when using
surround
5.1 and your config lost the virtual master playback volume
It seems that this is fixable. Patch will follow.
By the way, there is one thing I still don't understand. After booting
there
is no "PCM Playback Volume" control in alsamixer. As soon as I've played
some
wav file, it appears. Where does it come from, i.e. is it created by
kernel
or alsa-lib/utils and why?
http://git.alsa-project.org/?p=alsa-lib.git;a=blob_plain;f=src/conf/cards/HD...
It is a softvol plugin in HDA-Intel.conf which is needed for those alc660 codecs which have no hardware volume control
http://git.kernel.org/cgit/linux/kernel/git/tiwai/hda-emu.git/tree/codecs
Raymond,
Now I'm getting the favored config:
==> Best config: lo_type=0, wired=0, mio=1 multi_outs = 14/0/0/0 : 2/3/4/0 (type LO) multi_ios(2) = 1a/18 : 3/4 hp_outs = 1b/0/0/0 : 2/0/0/0 spk_outs = 15/0/0/0 : 0/0/0/0
How do the driver know the volume control at node 0x02 is shared by hp, line out and speaker when your spk_outs path not contain node 0x02
It probably doesn't know. I suppose I'm losing the speaker (which isn't connected nor used by me anyway).
On the other hand I'm getting a real Master as well as a Headphone switch, Front, Surround, Center and LFE controls, and the channel mode. Everything's working just great!
BTW do the driver need to disable independent headphone after your change ?
I have only a headphone mute switch, no headphone volume control, if that's what you mean. But since the master affects headphone volume, that's OK.
Do alc662 support 4+2 or NOT ?
What do you mean exactly? I have 6 channel output.
By the way, there is one thing I still don't understand. [...] "PCM Playback Volume" control in alsamixer.
It is a softvol plugin in HDA-Intel.conf which is needed for those alc660 codecs which have no hardware volume control
Thanks a lot. I'm understanding every single control now.
Ingo
Now I'm getting the favored config:
==> Best config: lo_type=0, wired=0, mio=1 multi_outs = 14/0/0/0 : 2/3/4/0 (type LO) multi_ios(2) = 1a/18 : 3/4 hp_outs = 1b/0/0/0 : 2/0/0/0 spk_outs = 15/0/0/0 : 0/0/0/0
How do the driver know the volume control at node 0x02 is shared by hp, line out and speaker when your spk_outs path not contain node 0x02
It probably doesn't know. I suppose I'm losing the speaker (which isn't connected nor used by me anyway).
multi_outs = 14/0/0/0 : 2/3/4/0 (type LO) multi_ios(2) = 1a/18 : 3/4 hp_outs = 1b/0/0/0 : 2/0/0/0
path_has_mixer() does not imply shared volume
get_amp_nid_( path->ctls[NID_PATH_VOL_CTL] ) of two paths are same
if you just want Front+Headphone playback volume
On the other hand I'm getting a real Master as well as a Headphone switch, Front, Surround, Center and LFE controls, and the channel mode.
Everything's
working just great!
BTW do the driver need to disable independent headphone after your change ?
I have only a headphone mute switch, no headphone volume control, if
that's
what you mean. But since the master affects headphone volume, that's OK.
As the original config only support stereo, pcm playback volume control line out volume , headphone and speaker using different DAC 0x02 and 0x03
Try specify
spec->gen.indep_hp = 1;
before callin the auto parser in patch_alc662
Device: name="ALC662 rev3 Alt Analog", type="Audio", device=2
should appear in node 0x03 which has headphone playback volume
Codec: Realtek ALC662 rev3 Address: 0 AFG Function Id: 0x1 (unsol 1) Vendor Id: 0x10ec0662 Subsystem Id: 0x8086204c Revision Id: 0x100300 No Modem Function Group found Default PCM: rates [0x5f0]: 32000 44100 48000 88200 96000 192000 bits [0xe]: 16 20 24 formats [0x1]: PCM Default Amp-In caps: N/A Default Amp-Out caps: N/A State of AFG node 0x01: Power states: D0 D1 D2 D3 CLKSTOP EPSS Power: setting=D0, actual=D0 GPIO: io=2, o=0, i=0, unsolicited=1, wake=0 IO[0]: enable=0, dir=0, wake=0, sticky=0, data=0, unsol=0 IO[1]: enable=0, dir=0, wake=0, sticky=0, data=0, unsol=0 Node 0x02 [Audio Output] wcaps 0x41d: Stereo Amp-Out Control: name="PCM Playback Volume", index=0, device=0 ControlAmp: chs=3, dir=Out, idx=0, ofs=0 Device: name="ALC662 rev3 Analog", type="Audio", device=0 Amp-Out caps: ofs=0x57, nsteps=0x57, stepsize=0x02, mute=0 Amp-Out vals: [0x57 0x57] Converter: stream=0, channel=0 PCM: rates [0x560]: 44100 48000 96000 192000 bits [0xe]: 16 20 24 formats [0x1]: PCM Power states: D0 D1 D2 D3 EPSS Power: setting=D0, actual=D0 Node 0x03 [Audio Output] wcaps 0x41d: Stereo Amp-Out Control: name="Speaker Playback Volume", index=0, device=0 ControlAmp: chs=3, dir=Out, idx=0, ofs=0 Amp-Out caps: ofs=0x57, nsteps=0x57, stepsize=0x02, mute=0 Amp-Out vals: [0x57 0x57] Converter: stream=0, channel=0 PCM: rates [0x560]: 44100 48000 96000 192000 bits [0xe]: 16 20 24 formats [0x1]: PCM Power states: D0 D1 D2 D3 EPSS Power: setting=D0, actual=D0 Node 0x04 [Audio Output] wcaps 0x41d: Stereo Amp-Out Control: name="Headphone Playback Volume", index=0, device=0 ControlAmp: chs=3, dir=Out, idx=0, ofs=0 Amp-Out caps: ofs=0x57, nsteps=0x57, stepsize=0x02, mute=0 Amp-Out vals: [0x57 0x57] Converter: stream=0, channel=0 PCM: rates [0x560]: 44100 48000 96000 192000 bits [0xe]: 16 20 24 formats [0x1]: PCM Power states: D0 D1 D2 D3 EPSS Power: setting=D0, actual=D0
Raymond Yau wrote on Fri, 27 Feb 2015 10:11:20 +0800:
Try [...] to change node 0x15 Speaker as not connected
This is exactly what I did now:
diff -Nur a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c --- a/sound/pci/hda/patch_realtek.c 2015-02-27 02:49:36.000000000 +0100 +++ b/sound/pci/hda/patch_realtek.c 2015-03-05 17:09:15.305016021 +0100 @@ -5665,9 +5665,10 @@
static int alc662_parse_auto_config(struct hda_codec *codec) { - static const hda_nid_t alc662_ignore[] = { 0x1d, 0 }; + /* ignore internal speaker (0x15) in order to get a multi-io config */ + static const hda_nid_t alc662_ignore[] = { 0x15, 0x1d, 0 }; static const hda_nid_t alc663_ssids[] = { 0x15, 0x1b, 0x14, 0x21 }; - static const hda_nid_t alc662_ssids[] = { 0x15, 0x1b, 0x14, 0 }; + static const hda_nid_t alc662_ssids[] = { 0x1b, 0x14, 0 }; const hda_nid_t *ssids;
if (codec->vendor_id == 0x10ec0272 || codec->vendor_id == 0x10ec0663 ||
It gives me the multi-io config without side effects and without the hp_lo_shared and spk_lo_shared issue in get_line_out_pfx().
I'd like to make this configurable for people suffering from the same problem with their ALC662, but I don't know how to identify when it would occur.
Ingo
Try [...] to change node 0x15 Speaker as not connected
This is exactly what I did now:
diff -Nur a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c --- a/sound/pci/hda/patch_realtek.c 2015-02-27 02:49:36.000000000
+0100
+++ b/sound/pci/hda/patch_realtek.c 2015-03-05 17:09:15.305016021
+0100
@@ -5665,9 +5665,10 @@
static int alc662_parse_auto_config(struct hda_codec *codec) {
static const hda_nid_t alc662_ignore[] = { 0x1d, 0 };
/* ignore internal speaker (0x15) in order to get a multi-io
config */
static const hda_nid_t alc662_ignore[] = { 0x15, 0x1d, 0 }; static const hda_nid_t alc663_ssids[] = { 0x15, 0x1b, 0x14, 0x21
};
static const hda_nid_t alc662_ssids[] = { 0x15, 0x1b, 0x14, 0 };
static const hda_nid_t alc662_ssids[] = { 0x1b, 0x14, 0 }; const hda_nid_t *ssids; if (codec->vendor_id == 0x10ec0272 || codec->vendor_id ==
0x10ec0663 ||
It gives me the multi-io config without side effects and without the hp_lo_shared and spk_lo_shared issue in get_line_out_pfx().
I'd like to make this configurable for people suffering from the same
problem
with their ALC662, but I don't know how to identify when it would occur.
you need pin fixup by removing internal speaker and snd_pci_quirk of your pci sbsystem id
In theory, user can get back the internal speaker by specify model=nofixup
+ [ALC662_FIXUP_NO_SPEAKER] = { + .type = ALC_FIXUP_PINS, + .v.pins = (const struct alc_pincfg[]) { + { 0x15, 0x4000000 }, /* remove internal speaker */ + { } + } + },
At Thu, 05 Mar 2015 17:52:19 +0100, Ingo Brückl wrote:
Raymond Yau wrote on Fri, 27 Feb 2015 10:11:20 +0800:
Try [...] to change node 0x15 Speaker as not connected
This is exactly what I did now:
diff -Nur a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c --- a/sound/pci/hda/patch_realtek.c 2015-02-27 02:49:36.000000000 +0100 +++ b/sound/pci/hda/patch_realtek.c 2015-03-05 17:09:15.305016021 +0100 @@ -5665,9 +5665,10 @@
static int alc662_parse_auto_config(struct hda_codec *codec) {
- static const hda_nid_t alc662_ignore[] = { 0x1d, 0 };
- /* ignore internal speaker (0x15) in order to get a multi-io config */
- static const hda_nid_t alc662_ignore[] = { 0x15, 0x1d, 0 }; static const hda_nid_t alc663_ssids[] = { 0x15, 0x1b, 0x14, 0x21 };
- static const hda_nid_t alc662_ssids[] = { 0x15, 0x1b, 0x14, 0 };
static const hda_nid_t alc662_ssids[] = { 0x1b, 0x14, 0 }; const hda_nid_t *ssids;
if (codec->vendor_id == 0x10ec0272 || codec->vendor_id == 0x10ec0663 ||
It gives me the multi-io config without side effects and without the hp_lo_shared and spk_lo_shared issue in get_line_out_pfx().
Well, the starting point is wrong. You cannot ignore pins if you really use them. It might look as if something is working casually, but this isn't supposed to work at all.
Takashi
Takashi Iwai wrote on Fri, 06 Mar 2015 10:24:20 +0100:
At Thu, 05 Mar 2015 17:52:19 +0100, Ingo Brückl wrote:
Raymond Yau wrote on Fri, 27 Feb 2015 10:11:20 +0800:
Try [...] to change node 0x15 Speaker as not connected
This is exactly what I did now:
diff -Nur a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c --- a/sound/pci/hda/patch_realtek.c 2015-02-27 02:49:36.000000000 +0100 +++ b/sound/pci/hda/patch_realtek.c 2015-03-05 17:09:15.305016021 +0100 @@ -5665,9 +5665,10 @@
static int alc662_parse_auto_config(struct hda_codec *codec) {
static const hda_nid_t alc662_ignore[] = { 0x1d, 0 };
/* ignore internal speaker (0x15) in order to get a multi-io config */
static const hda_nid_t alc662_ignore[] = { 0x15, 0x1d, 0 }; static const hda_nid_t alc663_ssids[] = { 0x15, 0x1b, 0x14, 0x21 };
static const hda_nid_t alc662_ssids[] = { 0x15, 0x1b, 0x14, 0 };
static const hda_nid_t alc662_ssids[] = { 0x1b, 0x14, 0 }; const hda_nid_t *ssids; if (codec->vendor_id == 0x10ec0272 || codec->vendor_id == 0x10ec0663 ||
It gives me the multi-io config without side effects and without the hp_lo_shared and spk_lo_shared issue in get_line_out_pfx().
Well, the starting point is wrong. You cannot ignore pins if you really use them. It might look as if something is working casually, but this isn't supposed to work at all.
I'm not using it.
Since it seems impossible to use it in addition to have a multi-io 6ch config, I've decided to "cut" it off.
Ingo
At Fri, 06 Mar 2015 11:03:14 +0100, Ingo Brückl wrote:
Takashi Iwai wrote on Fri, 06 Mar 2015 10:24:20 +0100:
At Thu, 05 Mar 2015 17:52:19 +0100, Ingo Brückl wrote:
Raymond Yau wrote on Fri, 27 Feb 2015 10:11:20 +0800:
Try [...] to change node 0x15 Speaker as not connected
This is exactly what I did now:
diff -Nur a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c --- a/sound/pci/hda/patch_realtek.c 2015-02-27 02:49:36.000000000 +0100 +++ b/sound/pci/hda/patch_realtek.c 2015-03-05 17:09:15.305016021 +0100 @@ -5665,9 +5665,10 @@
static int alc662_parse_auto_config(struct hda_codec *codec) {
static const hda_nid_t alc662_ignore[] = { 0x1d, 0 };
/* ignore internal speaker (0x15) in order to get a multi-io config */
static const hda_nid_t alc662_ignore[] = { 0x15, 0x1d, 0 }; static const hda_nid_t alc663_ssids[] = { 0x15, 0x1b, 0x14, 0x21 };
static const hda_nid_t alc662_ssids[] = { 0x15, 0x1b, 0x14, 0 };
static const hda_nid_t alc662_ssids[] = { 0x1b, 0x14, 0 }; const hda_nid_t *ssids; if (codec->vendor_id == 0x10ec0272 || codec->vendor_id == 0x10ec0663 ||
It gives me the multi-io config without side effects and without the hp_lo_shared and spk_lo_shared issue in get_line_out_pfx().
Well, the starting point is wrong. You cannot ignore pins if you really use them. It might look as if something is working casually, but this isn't supposed to work at all.
I'm not using it.
Since it seems impossible to use it in addition to have a multi-io 6ch config, I've decided to "cut" it off.
Then why not just disabling the speaker pin via the pin config?
Takashi
participants (3)
-
Ingo Brückl
-
Raymond Yau
-
Takashi Iwai