[alsa-devel] [PATCH] fixed mixer range reading during probing when compiled with CONFIG_PM defined

Takashi Iwai tiwai at suse.de
Wed Apr 24 09:29:01 CEST 2013


At Wed, 24 Apr 2013 09:15:17 +0200,
Daniel Schürmann wrote:
> 
> Hi Takashi,
> 
> thank you for review.
> 
> The patch solves the following error messages when connecting the Hercules
> RMX2 DJ Controller:
> 
> [ 9.600161] ALSA mixer.c:352 cannot get ctl value: req = 0x83, wValue =
> 0x201, wIndex = 0xa00, type = 4
> [ 9.600487] ALSA mixer.c:352 cannot get ctl value: req = 0x83, wValue =
> 0x200, wIndex = 0xa00, type = 4
> [ 9.600984] ALSA mixer.c:352 cannot get ctl value: req = 0x83, wValue =
> 0x201, wIndex = 0xb00, type = 4
> [ 9.601236] ALSA mixer.c:352 cannot get ctl value: req = 0x83, wValue =
> 0x200, wIndex = 0xb00, type = 4
> 
> But I am not entirely sure if this solves the real Bug.
> So I hope one with more experience can help out here.

It's strange because snd_usb_autoresume() itself has already the check
of chip->probing...  Ah, wait, I see the culprit.

The reason is simple.  snd_usb_autoresume() returns -ENODEV when
chip->probing is set.  This should be zero instead.

Does the patch below work instead of yours?


Takashi

---
diff --git a/sound/usb/card.c b/sound/usb/card.c
index 5254b18..1a03317 100644
--- a/sound/usb/card.c
+++ b/sound/usb/card.c
@@ -631,7 +631,9 @@ int snd_usb_autoresume(struct snd_usb_audio *chip)
 	int err = -ENODEV;
 
 	down_read(&chip->shutdown_rwsem);
-	if (!chip->shutdown && !chip->probing)
+	if (chip->probing)
+		err = 0;
+	else if (!chip->shutdown)
 		err = usb_autopm_get_interface(chip->pm_intf);
 	up_read(&chip->shutdown_rwsem);
 


More information about the Alsa-devel mailing list