Focusrite-Scarlett-on-Linux / sound-usb-kernel-module

Latest driver development code for sound/usb on Linux
GNU General Public License v2.0
159 stars 7 forks source link

5.10 kernel compatibility #11

Closed kdoren closed 3 years ago

kdoren commented 3 years ago

Thanks very much for your work on this.

I tried making a 5.10.46 kernel (for raspberry pi) using the files from branch v5.12-sound-master (I simply replaced all the files under sound/usb/ with the ones here.

The kernel build succeeded, and qasmixer presented the controls (for 6i6 gen2 and 18i20 gen3).

However, jack audio was not able to open an alsa driver for scarlett devices (it could to other devices). So it seems that there is something in the 5.12 scarlett code that is incompatible with 5,10. Or maybe I need to replace more files than just the ones under sound/usb.

Do you have any suggestions as to what needs to change to backport to 5.10? or best way to debug?

Thanks, Kevin

Jul  5 04:09:24 jambox jackdrc[1217]: creating alsa driver ...hw:CARD=USB,DEV=0|hw:CARD=USB,DEV=0|64|4|48000|0|0|nomon|swmeter|-|16bit
Jul  5 04:09:24 jambox jackdrc[1217]: ALSA: Cannot open PCM device alsa_pcm for playback. Falling back to capture-only mode
Jul  5 04:09:24 jambox jackdrc[1217]: Jack: JackDriver::Close
HinTak commented 3 years ago

You don't need to build a whole kernel - you could just use the stock raspberrypi pi kernel packages, build and copy the new kernel modules into /lib/modules/5.10.../updates, run depmod and reboot. You can switch back to the old usb sound modules as shipped by the raspberrypi folks, by removing the new ones in /lib/.../updates, run depmod -a and reboot. You can switch back and forth the different version of kernel modules this way, by copying / removing your new ones into the updates directory, depmod and reboot.

Since there is no indication that your jack setup works with the as-shipped raspberrypi kernel packages, I am going to close this now. You should first try to fix problem with your jack setup without using the code here.

kdoren commented 3 years ago

I build my own kernels to get different kernel configs (low-latency PREEMPT, and 1000Hz timers. Same jack config works for other USB interfaces. I have previously had same jack config work with scarlett using patches from sadko4u's backports repo. So while I can't rule it out, I don't think problem is jack config.

Are you sure 5.12 files should be compatible with 5.10?

HinTak commented 3 years ago

Get your setup to work with the as-shipped raspberrypi kernel packages first.

kdoren commented 3 years ago

There are many hundreds of people using my kernel builds for jack audio with USB interfaces on raspberry pi. Are you sure 5.12 sound/usb files should be compatible with 5.10?

HinTak commented 3 years ago

I have a raspberrypi right in front of me. It should build 6 *.ko's. You should copy all 6 into .../updates, although the two important ones are snd-usb-audio.ko and snd-usbmidi-lib.ko.

Now, please go and start from the as-shipped raspberrypi kernel packages and fix your jack usage problem first, before attempting to use the code here.

HinTak commented 3 years ago

See https://github.com/Focusrite-Scarlett-on-Linux/sound-usb-kernel-module/commit/70e8914c49b8c9bd16e71a2fae967738bed0406b possibly, but I am not convinced your problem is that - that's accompanied by piles of kernel messages and stalls, and a lot more visible that just "my jack setup does not work".

drc0 commented 2 years ago

Hello, I compiled v5.12-sound-master f68c4999761eff8f12951cdff74ccd4bb2dc41d6 against debian 5.10.0-13-amd64 kernel, for a scarlett solo gen 3, now alsamixer can see all the controls but the sound card doesn't shows up under pulseaudio so no output is usable, is it a known bug?

HinTak commented 2 years ago

Avoid indirections like pulseaudio when you try to debug. Get it work with aplay/arecord first.

drc0 commented 2 years ago

I disabled/stopped pulseaudio, aplay sees the sound card but I'm unable to output any audio with any device listed by aplay -L

usbstream:CARD=PCH
    HDA Intel PCH
    USB Stream Output
hw:CARD=USB,DEV=0
    Scarlett Solo USB, USB Audio
    Direct hardware device without any conversions
plughw:CARD=USB,DEV=0
    Scarlett Solo USB, USB Audio
    Hardware device with all software conversions
default:CARD=USB
    Scarlett Solo USB, USB Audio
    Default Audio Device
sysdefault:CARD=USB
    Scarlett Solo USB, USB Audio
    Default Audio Device
front:CARD=USB,DEV=0
    Scarlett Solo USB, USB Audio
    Front output / input
surround21:CARD=USB,DEV=0
    Scarlett Solo USB, USB Audio
    2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=USB,DEV=0
    Scarlett Solo USB, USB Audio
    4.0 Surround output to Front and Rear speakers
surround41:CARD=USB,DEV=0
    Scarlett Solo USB, USB Audio
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=USB,DEV=0
    Scarlett Solo USB, USB Audio
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=USB,DEV=0
    Scarlett Solo USB, USB Audio
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=USB,DEV=0
    Scarlett Solo USB, USB Audio
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=USB,DEV=0
    Scarlett Solo USB, USB Audio
    IEC958 (S/PDIF) Digital Audio Output
dmix:CARD=USB,DEV=0
    Scarlett Solo USB, USB Audio
    Direct sample mixing device
usbstream:CARD=USB
    Scarlett Solo USB
    USB Stream Output

audacity can't see the sound scarlett sound card but only the internal one

immagine

alsamixer can see the scarlett usb card

immagine

immagine

in the kernel dmesg I see this error, could it be related ?

[   16.374426] snd_usbmidi_lib: loading out-of-tree module taints kernel.
[   16.425968] snd_usbmidi_lib: module verification failed: signature and/or required key missing - tainting kernel
[   16.623591] usb 1-8: Focusrite Scarlett Gen 2/3 Mixer Driver enabled pid=0x8211
[   16.624424] usbcore: registered new interface driver snd-usb-audio