[alsa-devel] [PATCH] ASoC: soc-pcm: Use valid condition for snd_soc_dai_digital_mute() in hw_free()

Mark Brown broonie at kernel.org
Mon Dec 2 13:19:16 CET 2013

On Mon, Dec 02, 2013 at 11:05:31AM +0100, Takashi Iwai wrote:
> Nicolin Chen wrote:

> > The snd_soc_dai_digital_mute() here will be never executed because we only
> > decrease codec->active in snd_soc_close(). Thus correct it.

> A couple of minor problems by this approach:

> - snd_soc_dai_digital_mute() will be called twice in the normal PCM
>   close path.

Right, it's called in close() so it's redundant to call it here most of
the time.  On the other hand it will at least get called slightly sooner
which is good and in the case of reconfiguration we'll mute while doing
that - doing the mute earlier is better.

> - In full duplex mode where both playback/capture streams share the
>   same codec, one of the directions won't be handled correctly because
>   codec->active is incremented/decremented twice (once for each
>   direction).

Indeed, the check needs to be on playback_active or capture_active
rather than on the overall DAI.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20131202/a76adca1/attachment.sig>

More information about the Alsa-devel mailing list