From: Jochen Henneberg <jh@henneberg-systemdesign.com>
To: alsa-devel <alsa-devel@alsa-project.org>
Subject: Re: bug: reconfig broken on kernel 4.5
Date: Tue, 10 May 2016 11:47:56 +0200 [thread overview]
Message-ID: <1462873676.10277.16.camel@maxwell> (raw)
In-Reply-To: <s5h4ma6b985.wl-tiwai@suse.de>
On Di, 2016-05-10 at 10:36 +0200, Takashi Iwai wrote:
> On Mon, 09 May 2016 16:11:46 +0200,
> Takashi Iwai wrote:
> >
> > On Mon, 09 May 2016 10:22:49 +0200,
> > Jochen Henneberg wrote:
> > >
> > > Hi,
> > >
> > > it looks as if 'reconfig' feature is broken since the sysfs attributes
> > > have been moved to device attributes. In hda_sysfs.c:reconfig_codec()
> > > the device is cleared with snd_hda_codec_reset() which calls
> > > snd_hdac_device_unregister() which removes the sysfs entries (including
> > > the currently in-use 'reconfig'), the re-registration fails afterwards
> > > in snd_hda_codec_build_controls().
> > > I am not sure when things got broken, but snd_hda_codec_reset()
> > > called from reconfig_codec() unregisters the device and removes the
> > > sysfs entries where in the past it only stripped all configurations
> > > (pcms, controls ...) from the device.
> >
> > Hrm, OK, something got broken indeed there. I'll check it later.
>
> Actually it's not about the sysfs, but rather the superfluous calls of
> snd_hda_codec_build_controls() & co. The fix patch is below.
>
Sorry for the confusion, I did not notice. Anyway, I have tested the
patch with 4.5, changed codec hints, reconfig and no error messages and
the changed hints have been respected after reconfig, looks good for me.
Jochen
>
> Takashi
>
> -- 8< --
> From: Takashi Iwai <tiwai@suse.de>
> Subject: [PATCH] ALSA: hda - Fix broken reconfig
>
> The HD-audio reconfig function got broken in the recent kernels,
> typically resulting in a failure like:
> snd_hda_intel 0000:00:1b.0: control 3:0:0:Playback Channel Map:0 is already present
>
> This is because of the code restructuring to move the PCM and control
> instantiation into the codec drive probe, by the commit [bcd96557bd0a:
> ALSA: hda - Build PCMs and controls at codec driver probe]. Although
> the commit above removed the calls of snd_hda_codec_build_pcms() and
> *_build_controls() at the controller driver probe, the similar calls
> in the reconfig were still left forgotten. This caused the
> conflicting and duplicated PCMs and controls.
>
> The fix is trivial: just remove these superfluous calls from
> reconfig_codec().
>
> Fixes: bcd96557bd0a ('ALSA: hda - Build PCMs and controls at codec driver probe')
> Reported-by: Jochen Henneberg <jh@henneberg-systemdesign.com>
> Cc: <stable@vger.kernel.org> # v4.1+
> Signed-off-by: Takashi Iwai <tiwai@suse.de>
> ---
> sound/pci/hda/hda_sysfs.c | 8 --------
> 1 file changed, 8 deletions(-)
>
> diff --git a/sound/pci/hda/hda_sysfs.c b/sound/pci/hda/hda_sysfs.c
> index 64e0d1d81ca5..9739fce9e032 100644
> --- a/sound/pci/hda/hda_sysfs.c
> +++ b/sound/pci/hda/hda_sysfs.c
> @@ -141,14 +141,6 @@ static int reconfig_codec(struct hda_codec *codec)
> err = snd_hda_codec_configure(codec);
> if (err < 0)
> goto error;
> - /* rebuild PCMs */
> - err = snd_hda_codec_build_pcms(codec);
> - if (err < 0)
> - goto error;
> - /* rebuild mixers */
> - err = snd_hda_codec_build_controls(codec);
> - if (err < 0)
> - goto error;
> err = snd_card_register(codec->card);
> error:
> snd_hda_power_down(codec);
--
Henneberg - Systemdesign
Jochen Henneberg
Loehnfeld 26
21423 Winsen (Luhe)
--
Fon: +49 4174 668 773
Mobile: +49 172 160 14 69
Fax: +49 321 210 761 64
www: www.henneberg-systemdesign.com
next prev parent reply other threads:[~2016-05-10 9:47 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-09 8:22 bug: reconfig broken on kernel 4.5 Jochen Henneberg
2016-05-09 14:11 ` Takashi Iwai
2016-05-10 8:36 ` Takashi Iwai
2016-05-10 9:47 ` Jochen Henneberg [this message]
2016-05-10 10:15 ` Takashi Iwai
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1462873676.10277.16.camel@maxwell \
--to=jh@henneberg-systemdesign.com \
--cc=alsa-devel@alsa-project.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.