Page 1 of 1
For those experiencing distortion and crackles after stopping jack on USB interfaces
Posted: Fri Nov 10, 2023 3:17 am
by Robin Cherry
I found a workaround to this problem that I and others have been experiencing with USB interfaces not coming back to life correctly after stopping jack. The symptoms are distorted, quiet, and crackly audio after stopping jack. I don't fully know the cause. I suspect the interface isn't reverting to the correct sample rate somehow when jack stops. I had been unplugging the USB cable and plugging it back in to reset it which fixed it just fine but puts extra wear and tear on my hardware. I just found the usbreset utility though.
For my card I do the following:
- Enter "usbreset" in a terminal and find your interface in the list.
- Use "sudo usbreset" and whichever of the methods listed in the terminal referring to your device you prefer.
- In my case I used "sudo usbreset 001/004" because that is the location shown for my card in the terminal.
I wish there was a way to do it without sudo but alas.
Hope that's helpful,
Robin Cherry
Re: For those experiencing distortion and crackles after stopping jack on USB interfaces
Posted: Fri Nov 10, 2023 10:48 am
by Linuxmusician01
Thanks for the tip. Never heard of the handy command usbreset until now. 
Re: For those experiencing distortion and crackles after stopping jack on USB interfaces
Posted: Mon Nov 13, 2023 6:41 pm
by sjzstudio
This solved a problem that has been with AvLinux MXE for the past year or so.
Also works when returning to the desktop from Ardour or Mixbus 32C after using ALSA
Behringer U-phoria UMC202HD
For some reason RME UFX+ and 802 don't need anything but work directly without resetting.
Thanks a lot
Re: For those experiencing distortion and crackles after stopping jack on USB interfaces
Posted: Tue Nov 14, 2023 1:41 am
by Robin Cherry
sjzstudio wrote: ↑Mon Nov 13, 2023 6:41 pm
This solved a problem that has been with AvLinux MXE for the past year or so.
Also works when returning to the desktop from Ardour or Mixbus 32C after using ALSA
Behringer U-phoria UMC202HD
For some reason RME UFX+ and 802 don't need anything but work directly without resetting.
Thanks a lot
I'm glad to help! I've had the same issue on my manjaro system for the same amount of time.
I'd be really happy if someone knows a way to do it without sudo privileges so I could add it to my qjackctl post shutdown script though.
Re: For those experiencing distortion and crackles after stopping jack on USB interfaces
Posted: Tue Nov 14, 2023 2:30 am
by sunrat
Robin Cherry wrote: ↑Tue Nov 14, 2023 1:41 am
I'd be really happy if someone knows a way to do it without sudo privileges so I could add it to my qjackctl post shutdown script though.
You may be able to add a custom line in /etc/sudoers file to run that command with NOPASSWD option.
For example, I have one to run cpupower to change CPU governor:
Code: Select all
#Allow <user> to execute cpupower without password
<user> ALL=(root) NOPASSWD: /usr/bin/cpupower
Of course substitute <user> for your username. You can use a group name instead if you wish.
Re: For those experiencing distortion and crackles after stopping jack on USB interfaces
Posted: Tue Nov 14, 2023 3:14 pm
by Robin Cherry
sunrat wrote: ↑Tue Nov 14, 2023 2:30 am
Robin Cherry wrote: ↑Tue Nov 14, 2023 1:41 am
I'd be really happy if someone knows a way to do it without sudo privileges so I could add it to my qjackctl post shutdown script though.
You may be able to add a custom line in /etc/sudoers file to run that command with NOPASSWD option.
For example, I have one to run cpupower to change CPU governor:
Code: Select all
#Allow <user> to execute cpupower without password
<user> ALL=(root) NOPASSWD: /usr/bin/cpupower
Of course substitute <user> for your username. You can use a group name instead if you wish.
Cool, I tried this last night but it wouldn't work. I think it's because my user file is also in the admin group if I understand things correctly. I also tried putting it in a file in /etc/sudoers.d with the same result. It always asks for the password. I think this is the right approach though if I can work it out.
Re: For those experiencing distortion and crackles after stopping jack on USB interfaces
Posted: Tue Nov 14, 2023 3:36 pm
by LAM
Robin Cherry wrote: ↑Tue Nov 14, 2023 3:14 pm
Cool, I tried this last night but it wouldn't work. I think it's because my user file is also in the admin group if I understand things correctly. I also tried putting it in a file in /etc/sudoers.d with the same result. It always asks for the password. I think this is the right approach though if I can work it out.
Have you tried to use sudo in front of the command?
Re: For those experiencing distortion and crackles after stopping jack on USB interfaces
Posted: Tue Nov 14, 2023 4:43 pm
by Robin Cherry
LAM wrote: ↑Tue Nov 14, 2023 3:36 pm
Robin Cherry wrote: ↑Tue Nov 14, 2023 3:14 pm
Cool, I tried this last night but it wouldn't work. I think it's because my user file is also in the admin group if I understand things correctly. I also tried putting it in a file in /etc/sudoers.d with the same result. It always asks for the password. I think this is the right approach though if I can work it out.
Have you tried to use sudo in front of the command?
I will try that tonight. Is the idea that I still use sudo but it won't prompt for a password?
Re: For those experiencing distortion and crackles after stopping jack on USB interfaces
Posted: Tue Nov 14, 2023 4:45 pm
by LAM
Re: For those experiencing distortion and crackles after stopping jack on USB interfaces
Posted: Tue Nov 14, 2023 9:30 pm
by sunrat
Yes you still need to prepend sudo to the command and it shouldn't ask for password. I actually made 2 scripts in ~/bin for cpu govermors, one called ondemand and one called performance. To run them I just need to use the script name as the command. Contents of script:
Code: Select all
#!/bin/bash
/usr/bin/sudo cpupower frequency-set -g performance
Re: For those experiencing distortion and crackles after stopping jack on USB interfaces
Posted: Tue Nov 14, 2023 10:45 pm
by Robin Cherry
Nice, that totally works! Thanks @sunrat and @LAM. I hadn't understood it's implementation correctly.
I've successfully added it to my post shutdown script in qjackctl also. I also had been setting my cpugovernor with a script but have now integrated both enabling performance mode on jack startup and reverting to schedutil after jack shutdown into my qjackctl settings.
Thanks again.
Re: For those experiencing distortion and crackles after stopping jack on USB interfaces
Posted: Fri Nov 24, 2023 8:03 pm
by profquad
wow thank you so much for this. Was getting annoyed switching away from Reaper and trying to get anything else to play.
Re: For those experiencing distortion and crackles after stopping jack on USB interfaces
Posted: Tue Nov 28, 2023 8:12 pm
by Robin Cherry
profquad wrote: ↑Fri Nov 24, 2023 8:03 pm
wow thank you so much for this. Was getting annoyed switching away from Reaper and trying to get anything else to play.
Happy to help!