All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: Intel HDA / ALC662 analog surround problem
       [not found] ` <CAN8cciZwTRY8HSpK9iXmfy7VGiPw1wGO1wwdfyHYkzEv2dRMAQ@mail.gmail.com>
@ 2015-02-21 15:56   ` Raymond Yau
  2015-02-23 19:27     ` Ingo Brückl
  0 siblings, 1 reply; 18+ messages in thread
From: Raymond Yau @ 2015-02-21 15:56 UTC (permalink / raw)
  To: ALSA Development Mailing List, ib

> I'm using alsa 1.0.28 (lib and utils). Everything works fine so far, i.e.
stereo output through speakers and headphone as well as S/PDIF and all
possible capturing.

> According to my mainboard manual, the codec supports 5.1 (analog)
surround by using the rear "line out" jack (for rear surround) and "mic"
jack (for center and sub) - which doesn't work. (I don't have even a clue
what to do to activate.)

> My questions:

> 1) Does 5.1 analog surround work for the ALC662? If yes, how?

https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/plain/Documentation/sound/alsa/HD-Audio-Controls.txt

Channel Mode
  This is an enum control to change the surround-channel setup,
  appears only when the surround channels are available.
  It gives the number of channels to be used, "2ch", "4ch", "6ch",
  and "8ch".  According to the configuration, this also controls the
  jack-retasking of multi-I/O jacks.

>2) If not, is it a limitation of the kernel oder alsa?

>HDA-Intel.conf says:

> HDA-Intel.pcm.surround51.0 cards.HDA-Intel.pcm.front.0

> Does this mean that 5.1 surround is restricted to stereo in any case?

This mean softvol plugin is also used by 5.1 and stereo

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 ?

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Intel HDA / ALC662 analog surround problem
  2015-02-21 15:56   ` Intel HDA / ALC662 analog surround problem Raymond Yau
@ 2015-02-23 19:27     ` Ingo Brückl
  2015-02-24  4:46       ` Raymond Yau
  0 siblings, 1 reply; 18+ messages in thread
From: Ingo Brückl @ 2015-02-23 19:27 UTC (permalink / raw)
  To: Raymond Yau; +Cc: alsa-user, alsa-devel

Raymond Yau wrote on Sat, 21 Feb 2015 23:56:30 +0800:

>> 1) Does 5.1 analog surround work for the ALC662? If yes, how?

> https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/plain/Documentation/sound/alsa/HD-Audio-Controls.txt
> Channel Mode
>   [...]

I know this document and while I do have the auto-mute control a channel
control is missing.

So, is the ALC662 supposed to have a channel control? (Maybe I'm missing a
kernel configuration for it, or what else could affect it?)

> 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 ?

I can't answer, because of the lack of channel mode.

Any further help is appreciated.

Ingo

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Intel HDA / ALC662 analog surround problem
  2015-02-23 19:27     ` Ingo Brückl
@ 2015-02-24  4:46       ` Raymond Yau
       [not found]         ` <54ee1d13.2602f650.bm000@wupperonline.de>
  0 siblings, 1 reply; 18+ messages in thread
From: Raymond Yau @ 2015-02-24  4:46 UTC (permalink / raw)
  To: Ingo Brückl; +Cc: ALSA Development Mailing List

>
> >> 1) Does 5.1 analog surround work for the ALC662? If yes, how?
>
> >
https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/plain/Documentation/sound/alsa/HD-Audio-Controls.txt
> > Channel Mode
> >   [...]
>
> I know this document and while I do have the auto-mute control a channel
> control is missing.
>
> So, is the ALC662 supposed to have a channel control? (Maybe I'm missing a
> kernel configuration for it, or what else could affect it?)

You have to post the output of alsa-info.sh

The channel mode should be automatically added for those desktop with three
audio jacks (green line out, blue line in and pink mic) at rear panel

http://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/plain/Documentation/sound/alsa/HD-Audio.txt

either your computer BIOS does not set the correct pin default or it can be
disabled by hint

- multi_io (bool): try probing multi-I/O config (e.g. shared
  line-in/surround, mic/clfe jacks)

>
> > 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 ?
>
> I can't answer, because of the lack of channel mode.
>
> Any further help is appreciated.
>
>

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Intel HDA / ALC662 analog surround problem
       [not found]         ` <54ee1d13.2602f650.bm000@wupperonline.de>
@ 2015-02-26  0:58           ` Raymond Yau
  2015-02-26  9:27             ` Ingo Brückl
  0 siblings, 1 reply; 18+ messages in thread
From: Raymond Yau @ 2015-02-26  0:58 UTC (permalink / raw)
  To: Ingo Brückl, ALSA Development Mailing List, tiwai

>
> > 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

or

You need to increase badness of multi io so that driver select multi io as
the  best config

>
> > The channel mode should be automatically added for those desktop with
three
> > audio jacks (green line out, blue line in and pink mic) at rear panel
>
> Although I do have these jacks, there unfortunately isn't a channel mode.
>
> > either your computer BIOS does not set the correct pin default or it
can be
> > disabled by hint
>
> Do you really mean "disabled" or do you mean to enable them by hint?
>
> As you can see I don't have a hwC1D0/hints (and no reconfig), so I cannot
try
> setting multi_io to make the driver re-configuring itself. Would an early
> patching make sense (or maybe I missing a kernel config option for the
> hints)?
>
> If I only knew more about these "pins" (there seem to be 11, from 0x12 to
> 0x1e) I could try to add a model for the ALC66x since the existing ones
> (mario, asus-mode?, etc) don't make any differences.
>

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Intel HDA / ALC662 analog surround problem
  2015-02-26  0:58           ` Raymond Yau
@ 2015-02-26  9:27             ` Ingo Brückl
  2015-02-26 10:01               ` Raymond Yau
       [not found]               ` <CAN8ccibh4p-bV4qTRUo6R9sZzAAh7kOKq6MfMqDLOfE3f9qGLA@mail.gmail.com>
  0 siblings, 2 replies; 18+ messages in thread
From: Ingo Brückl @ 2015-02-26  9:27 UTC (permalink / raw)
  To: Raymond Yau; +Cc: tiwai, alsa-devel

Raymond,

>> > 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.)

> 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?

Ingo

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Intel HDA / ALC662 analog surround problem
  2015-02-26  9:27             ` Ingo Brückl
@ 2015-02-26 10:01               ` Raymond Yau
       [not found]               ` <CAN8ccibh4p-bV4qTRUo6R9sZzAAh7kOKq6MfMqDLOfE3f9qGLA@mail.gmail.com>
  1 sibling, 0 replies; 18+ messages in thread
From: Raymond Yau @ 2015-02-26 10:01 UTC (permalink / raw)
  To: Ingo Brückl; +Cc: tiwai, ALSA Development Mailing List

>
> >> > 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?

http://git.alsa-project.org/?p=alsa-tools.git;a=blob;f=hdajackretask/README;hb=HEAD

>
> 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.)
>
> > 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?
>

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

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

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Intel HDA / ALC662 analog surround problem
       [not found]                 ` <CAN8cciaxzzASke5EBXOtAmoUD2JJ1kZvbaWWiqeZjpKShXofZw@mail.gmail.com>
@ 2015-02-27  2:11                   ` Raymond Yau
  2015-02-27 18:55                     ` Ingo Brückl
  2015-03-05 16:52                     ` Ingo Brückl
  0 siblings, 2 replies; 18+ messages in thread
From: Raymond Yau @ 2015-02-27  2:11 UTC (permalink / raw)
  To: Ingo Brückl; +Cc: tiwai, ALSA Development Mailing List, David Henningsson

>
> >> > 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/pci/hda/hda_generic.c?id=03ad6a8c93b6df2d65c305b5b5f9474068b45bfb

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

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Intel HDA / ALC662 analog surround problem
  2015-02-27  2:11                   ` Raymond Yau
@ 2015-02-27 18:55                     ` Ingo Brückl
  2015-02-28  2:31                       ` Raymond Yau
  2015-03-05 16:52                     ` Ingo Brückl
  1 sibling, 1 reply; 18+ messages in thread
From: Ingo Brückl @ 2015-02-27 18:55 UTC (permalink / raw)
  To: Raymond Yau; +Cc: tiwai, alsa-devel, david.henningsson

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/pci/hda/hda_generic.c?id=03ad6a8c93b6df2d65c305b5b5f9474068b45bfb
>
> 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

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Intel HDA / ALC662 analog surround problem
  2015-02-27 18:55                     ` Ingo Brückl
@ 2015-02-28  2:31                       ` Raymond Yau
  2015-03-03  9:36                         ` Ingo Brückl
  0 siblings, 1 reply; 18+ messages in thread
From: Raymond Yau @ 2015-02-28  2:31 UTC (permalink / raw)
  To: Ingo Brückl; +Cc: tiwai, ALSA Development Mailing List, david.henningsson

>
> >> > [    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&PFid=24&Level=4&Conn=3
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/pci/hda/hda_generic.c?id=03ad6a8c93b6df2d65c305b5b5f9474068b45bfb
> >
> > 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

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Intel HDA / ALC662 analog surround problem
  2015-02-28  2:31                       ` Raymond Yau
@ 2015-03-03  9:36                         ` Ingo Brückl
  2015-03-03 13:41                           ` Raymond Yau
  0 siblings, 1 reply; 18+ messages in thread
From: Ingo Brückl @ 2015-03-03  9:36 UTC (permalink / raw)
  To: Raymond Yau; +Cc: tiwai, alsa-devel

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

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Intel HDA / ALC662 analog surround problem
  2015-03-03  9:36                         ` Ingo Brückl
@ 2015-03-03 13:41                           ` Raymond Yau
  2015-03-03 15:24                             ` Ingo Brückl
  0 siblings, 1 reply; 18+ messages in thread
From: Raymond Yau @ 2015-03-03 13:41 UTC (permalink / raw)
  To: Ingo Brückl; +Cc: tiwai, ALSA Development Mailing List

>
> 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/HDA-Intel.conf;hb=HEAD

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

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Intel HDA / ALC662 analog surround problem
  2015-03-03 13:41                           ` Raymond Yau
@ 2015-03-03 15:24                             ` Ingo Brückl
  2015-03-03 16:17                               ` Raymond Yau
  0 siblings, 1 reply; 18+ messages in thread
From: Ingo Brückl @ 2015-03-03 15:24 UTC (permalink / raw)
  To: Raymond Yau; +Cc: tiwai, alsa-devel

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

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Intel HDA / ALC662 analog surround problem
  2015-03-03 15:24                             ` Ingo Brückl
@ 2015-03-03 16:17                               ` Raymond Yau
  0 siblings, 0 replies; 18+ messages in thread
From: Raymond Yau @ 2015-03-03 16:17 UTC (permalink / raw)
  To: Ingo Brückl; +Cc: tiwai, ALSA Development Mailing List

>
> >> 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

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Intel HDA / ALC662 analog surround problem
  2015-02-27  2:11                   ` Raymond Yau
  2015-02-27 18:55                     ` Ingo Brückl
@ 2015-03-05 16:52                     ` Ingo Brückl
  2015-03-06  1:49                       ` Raymond Yau
  2015-03-06  9:24                       ` Takashi Iwai
  1 sibling, 2 replies; 18+ messages in thread
From: Ingo Brückl @ 2015-03-05 16:52 UTC (permalink / raw)
  To: alsa-devel; +Cc: superquad.vortex2, tiwai, david.henningsson

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

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Intel HDA / ALC662 analog surround problem
  2015-03-05 16:52                     ` Ingo Brückl
@ 2015-03-06  1:49                       ` Raymond Yau
  2015-03-06  9:24                       ` Takashi Iwai
  1 sibling, 0 replies; 18+ messages in thread
From: Raymond Yau @ 2015-03-06  1:49 UTC (permalink / raw)
  To: Ingo Brückl; +Cc: tiwai, alsa-devel, david.henningsson

>
> > 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 */
+ { }
+ }
+ },

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Intel HDA / ALC662 analog surround problem
  2015-03-05 16:52                     ` Ingo Brückl
  2015-03-06  1:49                       ` Raymond Yau
@ 2015-03-06  9:24                       ` Takashi Iwai
  2015-03-06 10:03                         ` Ingo Brückl
  1 sibling, 1 reply; 18+ messages in thread
From: Takashi Iwai @ 2015-03-06  9:24 UTC (permalink / raw)
  To: Ingo Brückl; +Cc: superquad.vortex2, alsa-devel, david.henningsson

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
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Intel HDA / ALC662 analog surround problem
  2015-03-06  9:24                       ` Takashi Iwai
@ 2015-03-06 10:03                         ` Ingo Brückl
  2015-03-06 10:48                           ` Takashi Iwai
  0 siblings, 1 reply; 18+ messages in thread
From: Ingo Brückl @ 2015-03-06 10:03 UTC (permalink / raw)
  To: alsa-devel; +Cc: tiwai, superquad.vortex2, david.henningsson

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

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Intel HDA / ALC662 analog surround problem
  2015-03-06 10:03                         ` Ingo Brückl
@ 2015-03-06 10:48                           ` Takashi Iwai
  0 siblings, 0 replies; 18+ messages in thread
From: Takashi Iwai @ 2015-03-06 10:48 UTC (permalink / raw)
  To: Ingo Brückl; +Cc: superquad.vortex2, alsa-devel, david.henningsson

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
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2015-03-06 10:48 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CAN8cciZPhv1wCQosYjj9MEhi+Ybz+6mho0H7fDC48QB9=GdCKQ@mail.gmail.com>
     [not found] ` <CAN8cciZwTRY8HSpK9iXmfy7VGiPw1wGO1wwdfyHYkzEv2dRMAQ@mail.gmail.com>
2015-02-21 15:56   ` Intel HDA / ALC662 analog surround problem Raymond Yau
2015-02-23 19:27     ` Ingo Brückl
2015-02-24  4:46       ` Raymond Yau
     [not found]         ` <54ee1d13.2602f650.bm000@wupperonline.de>
2015-02-26  0:58           ` Raymond Yau
2015-02-26  9:27             ` Ingo Brückl
2015-02-26 10:01               ` Raymond Yau
     [not found]               ` <CAN8ccibh4p-bV4qTRUo6R9sZzAAh7kOKq6MfMqDLOfE3f9qGLA@mail.gmail.com>
     [not found]                 ` <CAN8cciaxzzASke5EBXOtAmoUD2JJ1kZvbaWWiqeZjpKShXofZw@mail.gmail.com>
2015-02-27  2:11                   ` Raymond Yau
2015-02-27 18:55                     ` Ingo Brückl
2015-02-28  2:31                       ` Raymond Yau
2015-03-03  9:36                         ` Ingo Brückl
2015-03-03 13:41                           ` Raymond Yau
2015-03-03 15:24                             ` Ingo Brückl
2015-03-03 16:17                               ` Raymond Yau
2015-03-05 16:52                     ` Ingo Brückl
2015-03-06  1:49                       ` Raymond Yau
2015-03-06  9:24                       ` Takashi Iwai
2015-03-06 10:03                         ` Ingo Brückl
2015-03-06 10:48                           ` Takashi Iwai

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.