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

Sound output stops after a couple seconds for 3rd Gen Solo

Opened this issue · 9 comments

I'm having this problem on the default drivers and tried this module to see whether that fixes it, but unfortunately it does not.

Whenever I plug in my Focusrite with headphones and pipe sound to it, the sound just stops after a couple seconds, depending on the USB port I used. This happens with two different hardware configurations, but on my desktop it's not as severe and only happens maybe zero to two times per hour. On my laptop, however, I can only reach a couple seconds at most.
Note that sound input works throughout this entire period.

My setup is as follow:

  • Lenovo Thinkpad T470p (with a ThinkPad Ultra Dock 40A2)
  • Focusrite Scarlett Solo 3rd Gen
  • Arch Linux, kernel 5.13.9
  • Pipewire (happens with Pulseaudio as well)
  • v5.12-scarlett-gen3 branch of this repo (happens without as well)

After following the instructions in the README and rebooting, I see the following line on dmesg:

[    0.993659] usb 1-1: new high-speed USB device number 2 using xhci_hcd
[    1.134793] usb 1-1: New USB device found, idVendor=1235, idProduct=8211, bcdDevice= 6.45
[    1.134805] usb 1-1: New USB device strings: Mfr=1, Product=3, SerialNumber=2
[    1.134810] usb 1-1: Product: Scarlett Solo USB
[    1.134814] usb 1-1: Manufacturer: Focusrite
…
[    9.280356] usb 1-1: Focusrite Scarlett Gen 2/3 Mixer Driver enabled pid=0x8211

It doesn't match the README exactly, but I presume this is the expected output when the drivers were loaded. depmod -v -a certainly listed them.

When plugging it into a USB port on the dock:

[  606.240244] usb 1-3.4.3: new high-speed USB device number 11 using xhci_hcd
[  606.334050] usb 1-3.4.3: New USB device found, idVendor=1235, idProduct=8211, bcdDevice= 6.45
[  606.334063] usb 1-3.4.3: New USB device strings: Mfr=1, Product=3, SerialNumber=2
[  606.334069] usb 1-3.4.3: Product: Scarlett Solo USB
[  606.334074] usb 1-3.4.3: Manufacturer: Focusrite
[  606.334077] usb 1-3.4.3: SerialNumber: Y77R9F80B6C053
[  606.362898] usb 1-3.4.3: Focusrite Scarlett Gen 2/3 Mixer Driver enabled pid=0x8211

Is this a known issue? Is this something that this driver version can even address?

That to be honest sounds like faulty hardware / circuitry, e.g. Circuits not grounded properly and building up static charges in one of the capacitors, or something.

Does it happens the same hardware connected with windows (if your thinkpad dual boots).

If your device is bus-powered by the usb socket, it is possible that your laptop and the docking station's usb sockets are both under-powered (as typical use is just usb mouse/keyboard which are not power-hungry). In that case, see if you can borrow a main-powered USB hub and connecting your scarlett through the hub to your laptop/station helps.

I forgot to mention that I experienced this problem under Windows as well, on my Desktop machine. After contact with support, I was suggested to try a "factory reset" using the Focusrite driver software, which seems to have done something as the problem hasn't occured on Windows since (over 6 and 4 hours respectively).

With Linux on that machine, the problem still occurs, albeit much more rarely, as I mentioned already, and with numerous USB ports (interestingly the ports from my case seem to work better than the on-board ones). I'll see if I have a main-powered USB hub available and check whether that helps mitigate the issue, probably on Monday, though.

I don't know if Linux and windows powers the same usb hardware the same way, but I have had the interesting experience of having used the usb sockets to power my phone on HDMI-connected monitors. Whenever the screen goes to sleep, I found that it no longer powers my phone. While the Linux host does not directly controls the usb sockets on the monitor, it does indirectly by letting it goes to sleep if mouse/keyboard hasn't been used for a while. So Linux is responsible for regulating powers coming out of those usb sockets indirectly.

BTW, there is some trick/instruction on the Internet about getting Linux to NOT let a usb device /hub sleep or go into low power mode. See if you can dig it up - it is about "echo on > /sys//power..." where the default is "auto" ie switch off to save energy if not in use for a while.

echo on | sudo tee /sys/bus/usb/devices/*/power/level >/dev/null is what I found.

Unfortunately, at least on my Desktop machine, that already contains on for the usb port that I'm using, including for power/control.
However, /sys/bus/usb/devices/3-2/3-2:1.0/sound/card0/controlC0/power/control and several other instances in subdirectories were set to auto. They remained unaffected from writing to the main power/{level,control}.

I'll see if I can get this to work on the laptop that way tomorrow.

I did notice that the autosuspend delay is suspiciously set to 2000ms, though:

/sys/bus/usb/devices/3-2 Ξ cat power/autosuspend_delay_ms
2000

I checked this on my ThinkPad as well, but that yielded the same unhelpful results of already being set to on. powertop also confirms the setting being "Bad" (which means it's always on).

2021-08-23_19-15-57

Could you clarify what a "main-powered" USB hub is? I assume it's one that has an external power source in addition to the cable plugged into the computer. Unfortunately I don't have one of those.

Here is an example:
https://www.amazon.co.uk/gp/aw/d/B099MLL1FG/ .
It is just the 2nd link I clicked searching for "usb hub" on Google. The first also has a mains supply, but this one is more obvious that it has its own power , and you can charge your phone etc with it.