Bug 115561

Summary: Scarlett 2i4 not detected as an audio input/output device
Product: Drivers Reporter: Juston Li (juston.h.li)
Component: Sound(ALSA)Assignee: Jaroslav Kysela (perex)
Status: RESOLVED CODE_FIX    
Severity: normal CC: tiwai
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 4.6-rc1 Subsystem:
Regression: No Bisected commit-id:
Attachments: alsa-info 4.6-rc1
lsusb 4.6-rc1
dmesg 4.6-rc1
config 4.6-rc1
alsa-info SND_USB_AUDIO_USE_MEDIA_CONTROLLER not set
Fix patch #1
Fix patch #2
Fix patch #3

Description Juston Li 2016-03-30 23:35:01 UTC
Created attachment 211151 [details]
alsa-info 4.6-rc1

With 4.6-rc1 I can no longer use my Scarlett 2i4, it is not listed as an input or output device on pavucontrol and on alsamixer it says "This sound device does not have any controls."
It is working on mainline 4.5 kernel.

I had the same BUG described here: https://lkml.org/lkml/2016/3/15/238
I applied the attached patch and gets rid of the BUG but I still cannot use my 2i4

My 2i4 recieves power, leds turn on and lsusb detects it.
Comment 1 Juston Li 2016-03-30 23:35:29 UTC
Created attachment 211161 [details]
lsusb 4.6-rc1
Comment 2 Juston Li 2016-03-30 23:35:44 UTC
Created attachment 211171 [details]
dmesg 4.6-rc1
Comment 3 Juston Li 2016-03-30 23:37:00 UTC
Created attachment 211191 [details]
config 4.6-rc1
Comment 4 Takashi Iwai 2016-03-31 07:19:01 UTC
There aren't so many commits in usb-audio driver, so could you try to revert the commit one by one?

Start with c0fd9cdf940b5a2b5ffd118831bddf88afe922e4
On the git tree, run "git revert c0fd9cdf940b5a2b5ffd118831bddf88afe922e4"
This alone won't change anything, so revert
e2703363316278cd4a8880671d38f783f7de18ba
together.  These will revert the addition of media controller in 4.6-rc1.

If these reverts don't help, try to revert
e2703363316278cd4a8880671d38f783f7de18ba

If this doesn't, try
79289e24194a9d099bf18f200894832c5760cd83

If this still doesn't help, it might be something else.
You can copy the whole sound/usb/* files from 4.5, and see whether it works.
Comment 5 Juston Li 2016-03-31 08:14:23 UTC
Hi Takashi, thanks for the quick reply.

I actually had a similar thought that it was related to media controller. Instead of reverting the commits I unset SND_USB_AUDIO_USE_MEDIA_CONTROLLER
My 2i4 is now properly detected and audio works fine now.

Attached alsa-info. I'll try to further isolate the issue tomorrow.
Comment 6 Juston Li 2016-03-31 08:15:30 UTC
Created attachment 211211 [details]
alsa-info SND_USB_AUDIO_USE_MEDIA_CONTROLLER not set
Comment 7 Takashi Iwai 2016-03-31 08:38:39 UTC
Thanks, that's already helpful.  I found one problem at least.
Could you check the patch below?

--- a/sound/usb/media.c
+++ b/sound/usb/media.c
@@ -57,7 +57,7 @@ int media_snd_stream_init(struct snd_usb_substream *subs, struct snd_pcm *pcm,
 
        mdev = subs->stream->chip->media_dev;
        if (!mdev)
-               return -ENODEV;
+               return 0;
 
        if (subs->media_ctl)
                return 0;
Comment 8 Takashi Iwai 2016-03-31 10:24:53 UTC
There are other issues in the recent MC code.  Below are the three fix patches (including the previous one).  Let me know if these work for you.
Comment 9 Takashi Iwai 2016-03-31 10:25:13 UTC
Created attachment 211221 [details]
Fix patch #1
Comment 10 Takashi Iwai 2016-03-31 10:25:28 UTC
Created attachment 211231 [details]
Fix patch #2
Comment 11 Takashi Iwai 2016-03-31 10:25:43 UTC
Created attachment 211241 [details]
Fix patch #3
Comment 12 Juston Li 2016-03-31 15:49:26 UTC
Patch #1 by itself fixes the issue, thanks!

Patch #2 and #3 apply fine too.