Anybody else's USB interface randomly going silent?

Optimize your system for ultimate performance.

Moderators: MattKingUSA, khz

arifd
Established Member
Posts: 65
Joined: Sun Nov 29, 2020 11:09 am

Anybody else's USB interface randomly going silent?

Post by arifd »

I have a Focusrite Scarlett Solo 3rd Gen. It happens every so often, often hours of nothing, then for some reason it will be a period where it happens maybe 3 times in 30 minutes or so. Always at the beginning of some kind of stream event. i.e. when youtube video autoplays the next video, or at the start of a loop in Audacity. I think, only ever when it is in the background. It happens no matter which combination of Pulseaudio and JACK are in control.

Eventually I figured out that 'resetting' the USB device (https://askubuntu.com/questions/645/how ... mmand-line) works. Always works. So I hacked the little python script at the bottom to search for my focusrite device, and reset it. And I'm quite happy with that.

But I'm wondering why it might be happening in the first place, and what is really happening?
User avatar
lilith
Established Member
Posts: 1698
Joined: Fri May 27, 2016 11:41 pm
Location: bLACK fOREST
Has thanked: 117 times
Been thanked: 57 times
Contact:

Re: Anybody else's USB interface randomly going silent?

Post by lilith »

Any hints maybe with "sudo journalctl -b 0". Is it connected with USB. 3? If so, I would try with USB 2 and or exchange the cable and or the port.
arifd
Established Member
Posts: 65
Joined: Sun Nov 29, 2020 11:09 am

Re: Anybody else's USB interface randomly going silent?

Post by arifd »

Hmm. I wouldn't know how to use journalctl. Everything else looks normal though as far as I can tell. Nothing in dmseg.

I only have USB 2 ports on my computer, but I am using a cheap USB cable (because the guy who I bought my interface from didn't ship the cable!!). It works for extended periods hassle free though, so I doubt it could be that.
User avatar
lilith
Established Member
Posts: 1698
Joined: Fri May 27, 2016 11:41 pm
Location: bLACK fOREST
Has thanked: 117 times
Been thanked: 57 times
Contact:

Re: Anybody else's USB interface randomly going silent?

Post by lilith »

Does it also happen with Alsa? I would test another cable to at least exclude this as the problem.
arifd
Established Member
Posts: 65
Joined: Sun Nov 29, 2020 11:09 am

Re: Anybody else's USB interface randomly going silent?

Post by arifd »

Good point, I don't really use ALSA by itself for extended periods of times, since all the apps I run use pulse audio, but in my brief experiments, it has yet to occur. (I'm trying to avoid it being a cable thing quite desperately, because when I bought this interface second hand, i thought i was getting a good deal, but then postage and insurance added over 10% of the price, then I had to buy a USB cable, and then week later it was black friday and I saw this interface new for only 10% more, which getting myself a good cable would now bring me up to :lol:
User avatar
autostatic
Established Member
Posts: 1994
Joined: Wed Dec 09, 2009 5:26 pm
Location: Beverwijk, The Netherlands
Has thanked: 32 times
Been thanked: 104 times
Contact:

Re: Anybody else's USB interface randomly going silent?

Post by autostatic »

lilith wrote: Fri Feb 26, 2021 11:19 pm Does it also happen with Alsa? I would test another cable to at least exclude this as the problem.
+1, try with a better cable. If you can get your hands on Klotz cables I'd get those, not super expensive but very good quality. And you could try disabling autosuspend for your USB devices: https://www.kernel.org/doc/Documentatio ... gement.txt
In your case you could try the following and check if your device still goes silent after a while:

Code: Select all

echo -1 | sudo tee /sys/module/usbcore/parameters/autosuspend
And could you post the output of the following commands with your Focusrite plugged in?

Code: Select all

grep hci /proc/interrupts
lsusb
aplay -l
arifd
Established Member
Posts: 65
Joined: Sun Nov 29, 2020 11:09 am

Re: Anybody else's USB interface randomly going silent?

Post by arifd »

edit: I said it always happens at a predictable event, however I just watched it drop not interacting with it, in the middle of a cycle in audacity, no plugin or effect or anything changed... I hope it's not the cable... If this helps settle your suspicion, the interface does not blink like it is restarting... I don't think it's a power faliure.

Code: Select all

grep hci /proc/interrupts
 16:    8867851          0          0          0   IO-APIC  16-fasteoi   ehci_hcd:usb1
 23:          0          0          0    8441703   IO-APIC  23-fasteoi   ehci_hcd:usb2
 27:          0          0      39587          0   PCI-MSI 512000-edge      ahci[0000:00:1f.2]

Code: Select all

lsusb
Bus 002 Device 003: ID 1235:8211 Focusrite-Novation
Bus 002 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 006: ID 046d:0819 Logitech, Inc. Webcam C210
Bus 001 Device 005: ID 1532:0235 Razer USA, Ltd
Bus 001 Device 004: ID 046d:c084 Logitech, Inc. G203 Gaming Mouse
Bus 001 Device 003: ID 2109:2813 VIA Labs, Inc.
Bus 001 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
(I have a mouse (004), keyboard (005), webcam (006) plugged into a hub (not sure why duplicated and which one). the interface (003) plugged into a port on the laptop

Code: Select all

aplay -l
bash: aplay: command not found
edit: it still happens with autosuspend disabled
User avatar
autostatic
Established Member
Posts: 1994
Joined: Wed Dec 09, 2009 5:26 pm
Location: Beverwijk, The Netherlands
Has thanked: 32 times
Been thanked: 104 times
Contact:

Re: Anybody else's USB interface randomly going silent?

Post by autostatic »

Thanks for the feedback! USB is not sharing its interrupts so that's good. Would it be possible to run the following command in a terminal while you're Focusrite is plugged in? Maybe we can catch a log entry that correlates with the Focusrite failing.

Code: Select all

sudo tail -f /var/log/{kern.,sys}log
And you might want to install the alsa-utils package, we might need it for further troubleshooting purposes. It also contains the aplay program. Weird that it isn't installed by default, what distro are you using?
arifd
Established Member
Posts: 65
Joined: Sun Nov 29, 2020 11:09 am

Re: Anybody else's USB interface randomly going silent?

Post by arifd »

I ran your command right after it went silent again

Code: Select all

==> /var/log/kern.log <==
Feb 28 17:09:38 debian kernel: [18173.493007]  do_syscall_64+0x33/0x80
Feb 28 17:09:38 debian kernel: [18173.493007]  entry_SYSCALL_64_after_hwframe+0x44/0xa9
Feb 28 17:09:38 debian kernel: [18173.493007] RIP: 0033:0x7fd71e3ae819
Feb 28 17:09:38 debian kernel: [18173.493007] Code: 00 41 54 41 89 d4 55 48 89 f5 53 48 89 fb 48 83 ec 10 e8 4a 7f 01 00 44 89 e2 48 89 ee 48 89
df 41 89 c0 b8 07 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 31 44 89 c7 89 44 24 0c e8 83 7f 01 00 8b 44
Feb 28 17:09:38 debian kernel: [18173.493007] RSP: 002b:00007fd71de5bd50 EFLAGS: 00000246 ORIG_RAX: 0000000000000007
Feb 28 17:09:38 debian kernel: [18173.493007] RAX: ffffffffffffffda RBX: 00005604757c1ac0 RCX: 00007fd71e3ae819
Feb 28 17:09:38 debian kernel: [18173.493007] RDX: 0000000000003e7f RSI: 0000000000000002 RDI: 00005604757c1ac0
Feb 28 17:09:38 debian kernel: [18173.493007] RBP: 0000000000000002 R08: 0000000000000002 R09: 000000000213939e
Feb 28 17:09:38 debian kernel: [18173.493007] R10: 000000043b35a5dd R11: 0000000000000246 R12: 0000000000003e7f
Feb 28 17:09:38 debian kernel: [18173.493007] R13: 00000000ffffffff R14: 000000043b35a5dd R15: 0000560475823be0

==> /var/log/syslog <==
Feb 28 17:20:58 debian systemd[1]: Starting Hostname Service...
Feb 28 17:20:58 debian dbus-daemon[452]: [system] Successfully activated service 'org.freedesktop.hostname1'
Feb 28 17:20:58 debian systemd[1]: Started Hostname Service.
Feb 28 17:21:28 debian systemd[1]: systemd-hostnamed.service: Succeeded.
Feb 28 17:25:09 debian rtkit-daemon[782]: Supervising 3 threads of 3 processes of 1 users.
Feb 28 17:25:09 debian rtkit-daemon[782]: Supervising 3 threads of 3 processes of 1 users.
Feb 28 17:25:10 debian rtkit-daemon[782]: Supervising 3 threads of 3 processes of 1 users.
Feb 28 17:25:10 debian rtkit-daemon[782]: Supervising 3 threads of 3 processes of 1 users.
Feb 28 17:25:40 debian rtkit-daemon[782]: Supervising 3 threads of 3 processes of 1 users.
Feb 28 17:25:40 debian rtkit-daemon[782]: Supervising 3 threads of 3 processes of 1 users.
btw, (I think) it was working for hours problem free, until i started messing with Audacity and Carla, and then boom within minutes it went silent! Really, now I think about it, it only ever seems to happen when I'm messing with audacity, and maybe sometimes with youtube? I have spent multiple days with 3 hour long meetings with people and it doesn't happen if I'm not messing with any settings

I'm running debian minimal with the suckless window manager
User avatar
autostatic
Established Member
Posts: 1994
Joined: Wed Dec 09, 2009 5:26 pm
Location: Beverwijk, The Netherlands
Has thanked: 32 times
Been thanked: 104 times
Contact:

Re: Anybody else's USB interface randomly going silent?

Post by autostatic »

arifd wrote: Sun Feb 28, 2021 4:28 pmI ran your command right after it went silent again
Could you run it before you start working with your Focusrite? Now we don't see the full error message while it does look like something is going wrong. We want to see what happens when the Focusrite stops working. Also the timestamps of both logs are different so it's not possible to see any correlation between the two.
arifd
Established Member
Posts: 65
Joined: Sun Nov 29, 2020 11:09 am

Re: Anybody else's USB interface randomly going silent?

Post by arifd »

Okay, sorry, what exactly are the steps I need to take to give you the info you desire?
JamesPeters
Established Member
Posts: 188
Joined: Fri Jun 29, 2018 6:35 pm
Has thanked: 8 times
Been thanked: 15 times

Re: Anybody else's USB interface randomly going silent?

Post by JamesPeters »

I had the same issue with the same interface. Stopping "USB autosuspend" fixed it.

In Manjaro I use TLP to change that setting. There's a GUI front-end for it named TLP UI too. (I'm sure there are other ways of changing that setting, but that's how I do it.)
User avatar
autostatic
Established Member
Posts: 1994
Joined: Wed Dec 09, 2009 5:26 pm
Location: Beverwijk, The Netherlands
Has thanked: 32 times
Been thanked: 104 times
Contact:

Re: Anybody else's USB interface randomly going silent?

Post by autostatic »

arifd wrote: Sun Feb 28, 2021 6:25 pm Okay, sorry, what exactly are the steps I need to take to give you the info you desire?
Plug in your Focusrite, start tailing the logs with

Code: Select all

tail -f /var/log/{kern.,sys}log
and post the output of the logs at the moment the Focusrite fails. It's also possible to look back in the logs but while tailing them I think it's easier to see the correlation between the audio interface failing and logging that happens around that time.
User avatar
autostatic
Established Member
Posts: 1994
Joined: Wed Dec 09, 2009 5:26 pm
Location: Beverwijk, The Netherlands
Has thanked: 32 times
Been thanked: 104 times
Contact:

Re: Anybody else's USB interface randomly going silent?

Post by autostatic »

JamesPeters wrote: Mon Mar 01, 2021 2:19 am I had the same issue with the same interface. Stopping "USB autosuspend" fixed it.
I had a hunch too in that direction and the fact that we're dealing with EHCI (USB2) and rate matching hubs only strengthens that suspicion. But let's see first what the logs give us.
arifd
Established Member
Posts: 65
Joined: Sun Nov 29, 2020 11:09 am

Re: Anybody else's USB interface randomly going silent?

Post by arifd »

So for some reason ALL of yesterday, it didn't fail on me.

And I checked /sys/module/usbcore/parameters/autosuspend and it was '2' in case maybe the '-1' needed a reboot to take effect and that was indeed why yesterday it worked without fail.

but then after starting up my computer and using it for about maybe 15 minutes, it happened again. I ran your command right after.

It happened around 08:33 maybe 08:32

Code: Select all

==> /var/log/kern.log <==
Mar  2 08:14:01 debian kernel: [   20.135438] wlp5s0: associated
Mar  2 08:14:01 debian kernel: [   20.141552] ath: EEPROM regdomain: 0x82d4
Mar  2 08:14:01 debian kernel: [   20.141554] ath: EEPROM indicates we should expect a country code
Mar  2 08:14:01 debian kernel: [   20.141555] ath: doing EEPROM country->regdmn map search
Mar  2 08:14:01 debian kernel: [   20.141556] ath: country maps to regdmn code: 0x37
Mar  2 08:14:01 debian kernel: [   20.141557] ath: Country alpha2 being used: ES
Mar  2 08:14:01 debian kernel: [   20.141558] ath: Regpair used: 0x37
Mar  2 08:14:01 debian kernel: [   20.141560] ath: regdomain 0x82d4 dynamically updated by country element
Mar  2 08:14:01 debian kernel: [   20.503657] cryptd: max_cpu_qlen set to 1000
Mar  2 08:14:02 debian kernel: [   21.107083] IPv6: ADDRCONF(NETDEV_CHANGE): wlp5s0: link becomes ready

==> /var/log/syslog <==
Mar  2 08:32:00 debian systemd[1]: Started Run anacron jobs.
Mar  2 08:32:00 debian anacron[2488]: Anacron 2.3 started on 2021-03-02
Mar  2 08:32:00 debian anacron[2488]: Normal exit (0 jobs run)
Mar  2 08:32:00 debian systemd[1]: anacron.service: Succeeded.
Mar  2 08:32:11 debian rtkit-daemon[703]: Supervising 5 threads of 5 processes of 1 users.
Mar  2 08:32:11 debian rtkit-daemon[703]: Supervising 5 threads of 5 processes of 1 users.
Mar  2 08:35:16 debian rtkit-daemon[703]: Supervising 4 threads of 4 processes of 1 users.
Mar  2 08:35:16 debian rtkit-daemon[703]: Supervising 4 threads of 4 processes of 1 users.
Mar  2 08:35:17 debian rtkit-daemon[703]: Supervising 4 threads of 4 processes of 1 users.
Mar  2 08:35:17 debian rtkit-daemon[703]: Supervising 4 threads of 4 processes of 1 users.
to be clear, this is today as was yesterday...

Code: Select all

cat /sys/module/usbcore/parameters/autosuspend
2
I'll edit this post and update it if it happens again
Post Reply