Focusrite Scarlett 2i2 on Linux

Discuss your workplace, instruments, amps, and any other gear.

Moderators: MattKingUSA, khz

User avatar
bluebell
Established Member
Posts: 1927
Joined: Sat Sep 15, 2012 11:44 am
Location: Saarland, Germany
Has thanked: 113 times
Been thanked: 122 times

Re: Focusrite Scarlett 2i2 on Linux

Post by bluebell »

ubuntourist wrote: Sat Apr 15, 2023 4:57 pm
bluebell wrote: Mon Apr 10, 2023 7:35 am
ubuntourist wrote: Sun Apr 02, 2023 6:35 pm

The mic works great. However, the headphones work for a "while" (sometimes 3 minutes, sometimes longer) and then they just... stop. (Nothing wrong with the headphones. I've tested them on a Yamaha keyboard to verify that they were not the source of trouble.)

I'm not sure where I should look for trouble.

Is it only the headphones or are the line outputs affected as well?

Line outputs as well.

Then I guess it's no hardware problem.

It may be a issue with USB power management.
See https://www.kernel.org/doc/html/v4.16/d ... ement.html

Try plugging your Scarlett out, then

Code: Select all

sudo echo -1 > /sys/module/usbcore/parameters/autosuspend

and plugging it back in.

If that helps then you can make it permanent by adding configuration file in /etc/modprobe.d with a line saying

Code: Select all

options usbcore autosuspend=-1

Linux – MOTU UltraLite AVB – Qtractor – http://suedwestlicht.saar.de/

ubuntourist
Established Member
Posts: 5
Joined: Thu Dec 26, 2019 1:30 pm
Has thanked: 1 time

Re: Focusrite Scarlett 2i2 on Linux

Post by ubuntourist »

bluebell wrote: Sun Apr 16, 2023 7:28 am

Then I guess it's no hardware problem.

It may be a issue with USB power management.
See https://www.kernel.org/doc/html/v4.16/d ... ement.html

Try plugging your Scarlett out, then

Code: Select all

sudo echo -1 > /sys/module/usbcore/parameters/autosuspend

and plugging it back in.

If that helps then you can make it permanent by adding configuration file in /etc/modprobe.d with a line saying

Code: Select all

options usbcore autosuspend=-1

Professor, I believe you've done it! :D Thank you!

Previously, the headphones had been crapping out in the past within three to five minutes. I'm now 47 minutes in and holding steady.

It didn't occur to me to mention previously, but now it seems relevant, given your solution: The laptop is plugged in -- not battery powered, but the Scarlett is plugged into a four-port USB hub that is plugged into the laptop. Since the hub hasn't ever given me trouble with anything else, it didn't seem like it would have any impact on the situation. Now, I'm not so sure.

In any case, thanks again!

ubuntourist
Established Member
Posts: 5
Joined: Thu Dec 26, 2019 1:30 pm
Has thanked: 1 time

Re: Focusrite Scarlett 2i2 on Linux

Post by ubuntourist »

bluebell wrote: Sun Apr 16, 2023 7:28 am

Then I guess it's no hardware problem.

It may be a issue with USB power management.
See https://www.kernel.org/doc/html/v4.16/d ... ement.html

Try plugging your Scarlett out, then

Code: Select all

sudo echo -1 > /sys/module/usbcore/parameters/autosuspend

and plugging it back in.

If that helps then you can make it permanent by adding configuration file in /etc/modprobe.d with a line saying

Code: Select all

options usbcore autosuspend=-1

For others who might encounter the same problem: It turned out t be a bit more complicated to make it permanent. Under Pop! OS 22.04 LTS -- and presumably Ubuntu 22.04 LTS -- usbcore is not built as a separate module, but, rather baked into the kernel. So, adding the option in a /etc/modprobe.d/ file is ignored.

The documentation suggests that adding it as a grub boot option is the thing to do. But possibilities there include /boot/grub/grub.cfg -- which has a comment saying "Don't" -- and /etc/default/grub. I suppose that might have worked but...

Other documentation suggests that editing /etc/kernelstub/configuration is the right thing to do. One might think that setting the preferred default kernel options in the stanza "kernel options" nested under "default" would be the logical and obvious thing to do. But no. It was completely ignored.

The thing that fiinally worked was adding "usbcore.autosuspend=-1" in the "kernel options" stanza nested under "user". This can be accomplished with the command:

Code: Select all

sudo kernelstub -a "usbcore.autosuspend=-1"

The end result (in my case) looks like:

Code: Select all

{
  "default": {
    "kernel_options": [
      "quiet",
      "splash"
    ],
    "esp_path": "/boot/efi",
    "setup_loader": false,
    "manage_mode": false,
    "force_update": false,
    "live_mode": false,
    "config_rev": 3
  },
  "user": {
    "kernel_options": [
      "quiet",
      "loglevel=0",
      "systemd.show_status=false",
      "splash",
      "usbcore.autosuspend=-1"
    ],
    "esp_path": "/boot/efi",
    "setup_loader": true,
    "manage_mode": true,
    "force_update": false,
    "live_mode": false,
    "config_rev": 3
  }
}
Post Reply