[alsa-devel] [PATCH] ALSA: hda - Don't access stereo amps for mono channel widgets

Takashi Iwai tiwai at suse.de
Mon Mar 16 08:42:56 CET 2015


At Mon, 16 Mar 2015 12:02:36 +0800,
Raymond Yau wrote:
> 
> >
> > The current HDA generic parser initializes / modifies the amp values
> > always in stereo, but this seems causing the problem on ALC3229 codec
> > that has a few mono channel widgets: namely, these mono widgets react
> > to actions for both channels equally.
> >
> > In the driver code, we do care the mono channel and create a control
> > only for the left channel (as defined in HD-audio spec) for such a
> > node.  When the control is updated, only the left channel value is
> > changed.  However, in the resume, the right channel value is also
> > restored from the initial value we took as stereo, and this overwrites
> > the left channel value.  This ends up being the silent output as the
> > right channel has been never touched and remains muted.
> >
> > This patch covers the places where unconditional stereo amp accesses
> > are done and converts to the conditional accesses.
> >
> > Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=94581
> 
> Seem the number of amp-in vals is not only depend on widget cap mono
> 
> In your example, node 0xf is mono and has only one connection
> 
> Node 0x0f [Audio Mixer] wcaps 0x20010a: Mono Amp-In
>   Amp-In caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1
>   Amp-In vals:  [0x00]
>   Connection: 1
>      0x0d
> 
> Refer to block diagram in alc272 datasheet
> 
> Node 0xf has two mute switch
> 
> https://launchpadlibrarian.net/200283132/AlsaInfo.txt
> 
> Node 0x0f [Audio Mixer] wcaps 0x20010a: Mono Amp-In
>   Amp-In caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1
>   Amp-In vals:  [0x00] [0x00]
>   Connection: 2
>      0x02 0x0b
> 
> Refer to HDA Specification
> 
> 7.1.3 Widget Interconnection Rules
> 
> 5. When a stereo widget is an input to a mono widget, only the L-channel of
> the source drives the sink.
> 
> There is one exception to this rule, which allows a mono Mixer Widget to
> mix the L- and R-channels of a single stereo widget into a mono channel.
> 
> This exception occurs only when the sink widget is: A Mixer Widget, and Is
> identified as “mono,” and Contains exactly one entry in its connection
> list, and The single widget identified in its connection list (source) is
> “stereo.”
> 
> In this case, this mixer is required to have two inputs, the first being
> driven by the L-channel of the stereo source and the second by the
> R-channel.

The signals are summed up in that case, indeed, but what we do care
here is about which amp channel value to control.  So, it's irrelevant
from the code change.


Takashi


More information about the Alsa-devel mailing list