Focusrite and Jack don't like each other

I had AVLinux 2019 and upgraded recently to AVL-MXE. I have the same problem as before, which I managed to solve with Agus Terol’s help last time. I have Focusrite 18i20 first generation. I managed to get it connected and I could record, but not hear through the headphones out of the Focusrite. I overcame this last time by changing the Jack Profile from the Output Hardware USB for the Focusrite to Hardware 0, (default laptop), which works, and then switching the Output back to Hardware USB for the Focusrite. I could hear from the laptop when I did it this time, but switching back did not work. I turned off the computer and the focusrite, even retried the Focusrite with a windows laptop just to make sure it had the correct settings, which it did, resaved, and then I could not even connect to record. Very frustrating. Here is the log:
ALSA: use 3 periods for playback
15:51:57.359 ALSA connection graph change.
port created: Midi-Through:midi/playback_1
port created: Midi-Through:midi/capture_1
port created: Scarlett-18i20-USB:midi/playback_1
port created: Scarlett-18i20-USB:midi/capture_1
15:52:04.363 Could not connect to JACK server as client. - Overall operation failed. - Server communication error. Please check the messages window for more info.
15:52:04.387 Shutdown script…
15:52:04.388 /usr/bin/pajackconnect stop &
JackPosixProcessSync::LockedTimedWait error usec = 5000000 err = Connection timed out
Driver is not running
Cannot create new client
Cannot read socket fd = 26 err = Success
CheckRes error
JackSocketClientChannel read fail
Cannot open qjackctl client
JackShmReadWritePtr1::~JackShmReadWritePtr1 - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
Module module-jack-sink not loaded.
Module module-jack-source not loaded.
15:52:04.792 Shutdown script terminated successfully.
15:52:04.792 JACK is stopping…
Jack main caught signal 15

Are you routing signals to the correct outputs? According to the user manual the first headphone jack is fed from outputs 7/8 and the second headphone jack is fed from outputs 9/10. The 18i20 has some kind of internal routing matrix that can be controlled with a Windows application, but I don’t know if there is a linux equivalent or not.

I saw this mentioned earlier in the day: https://github.com/x42/scarlett-mixer. Looks like it works with your 1st gen 18i20.

Thanks for the tips. I have The 18i20 set with the DAW tracking, so yes, the headphones should be fed correctly, everything is fed from DAW 1 and 2, so 1 goes to 7 and 9, and 2 goes 8 and 10.
I will try the x42/scarlett-mixer. I always have to pray that the little I can do on the command line is enough. I will also try to change stuff back and forth with Windows scarlet control and see what happens. It will take me a couple of days. Ciao

Hi Adam, when you change the internal mixer settings in Windows and save them, it will work on standalone mode (i.e. not plugged to a computer). But as soon as you connect it to your Linux machine, the system (ALSA) will restore almost all the settings you had set last time you logged into Linux. So, it doesn’t matter what you set on Windows.

However, Linux does not know about all the controls that the official Windows program does. In Linux you can control almost everything of the internal mixer, but you cannot control the buttons of the monitoring section. Since Linux does not “see” these controls, their state are not restored, and whatever was set in Windows when clicking “Save to hardware” are still there.

I didn’t know about GUI mixer program that @bachstudies has mentioned (thanks!), but I have been using for a long time qasmixer combined with alsactl command. For instance, I could set up a routing mixer for a workflow, and then save it to a file with:

alsactl -f daw_monitoring.state store

Then, you can change settings in qasmixer, and save to another file:

alsactl -f scarlett_monitoring.state store

Later, you can load any state file with:

alsactl -f daw_monitoring.state restore

You can put this commands in an script or assign to some key shortcuts in your desktop environment, so that you can have a set of workflows and switch between them quickly.

All pushbuttons are commented out in the source of the Linux driver, because ALSA Mixer lacks the concept to expose them.

They can be exposed as toggle-buttons, but that was disabled by default for safety reasons:
alsactl restore could accidentally trigger saving state onto the device, wearing out the device internal flash.

That’s good to know, but for the user point of view, as I said, Linux does not know about them :smiley:

I did read about the problem of the internal flash, but I though it was only related with the “Save to hardware” button. Anyway, I don’t remember the Scarlett manual warning about how many times you can use that option in the Scarlett Mixer application. Probably they do not expect it to be used more times than the total count of system reboots.

However, I was referring to the buttons that allow you to sync the analog outputs volume with the physical master knob in the front panel of the device. In my case, I have 1-2 and 3-4 outputs tied to the knob, but 5-6 does not, since it uses an external amp. Finally, 7-8 and 9-10 are used for headphones, so they have their own physical knob for controlling them.

So, I do not understand why changing that options would require a “Save to hardware”, it would be like a selection dropdown list (like “sync to master”, “0 dB/line level”, “mute”, the options that the official app offers), like other controls that already are exposed by ALSA (for instance, the outputs’ source). Then, alsactl could restore them, but without calling “Save to hardware”, isn’t it?

Ah, the 18i6 for which I wrote the kernel driver does not have those controls.

Dear Agus,
you had sent this:
Hi, I own a Scarlett 18i20 1st gen, and the problem you are reporting about the volume of the headphones being paired with the volume of the speakers can be solved. But you need to use Scarlett MixControl at least once.

Screenshot 2020-04-29 at 13.38.36

Check the manual for more details. But, basically, in my case, buttons 1, 2, 3, 4 are turned on in blue, which means that their volume levels are tied to the physical volume knob position. They are also affected by physical dim and mute switches position. Meanwhile, 5-6, 7-8 (headphone 1), and 9-10 (headphone 2) are at signal level (I don’t remember the exact value). In your case, you might have that button also enabled for outputs 7-8 and/or 9-10 turned on.

Just to check - I have speakers 1 - 6 blue, and the hw button at the bottom right also blue, then I do “save to hardware”. Then back in linux, I would still have to “wake jack up” by changing my Jack settings of the Output to the default, running once ardour through my laptop headphones, then go back and return Output to hw:1 which is the Focusrite. Then back to Ardour and it worked. No luck now.
I downloaded the x42/scarlett-mixer, but I can’t decipher how to use it. When the GUI shows all my buttons are green, I can’t figure out how to select one.
I did try Ardour with just Alsa, but also no luck hearing anything.
I will see if I can figure out qasmixer next.
If I can record into Ardour, I think I must be doing something silly not to be able to hear through the headphones. I have done save to hardware so many times trying different things out, do you really think I fried the internal card?
Ciao

And what do I do here? AVL-MXE has qt5…
$ qasmixer -t
qt5ct: using qt5ct plugin

(qasmixer:11212): Gtk-WARNING **: 13:09:48.286: Unable to locate theme engine in module_path: “adwaita”,

(qasmixer:11212): Gtk-WARNING **: 13:09:48.287: Unable to locate theme engine in module_path: “adwaita”,
qt5ct: D-Bus system tray: no

ooops, I guess I got that.
$qasmixer
works. I will see if I can figure it out

Wow!!!
Qasmixer worked. I haven’t tried it with speakers yet, but the headphones are working. I had to put the playback switch on in Qasmixer for lines 7/8 and 9/10. That would be cool if Focusrite 3rd generation worked this way also.
Hey, and it only took me 6 hours.
What about changing the sampling rate?


Major thanks!

1 Like

USB devices usually have the sample rate set by the driver, in this situation meaning the sample rate you select in the Ardour project when using the ALSA backend, or the sample rate you select for jackd when using the JACK backend.

Hi, I am glad it worked. In my opinion, qasmixer’s buttons below volume sliders are a bit far from intuitive, because it is not clear if they are muting or enabling the channel. So, yes, it’s a trial and error process :smiley:

However, once you understand how it works, you can achieve interesting results combining it with alsactl. So, now that you are familiar with the command line, I encourage you to try to move some sliders in qasmixer, go to the console and try:

$ alsactl -f my_preset.state store

Then go back to qasmixer, move other sliders, or change the position of the previously moved sliders, and go back to the console and do:

$ alsactl -f my_preset.state restore

You will see how all the slider you moved in qasmixer go back to the “preset” you saved. Notice it also saves the configuration of other sound cards (like the integrated in the laptop). So, it can be a powerful tool for switching presets quickly, and as replacement of the official Focusrite Scarlett Mixer feature. Also, it is faster, because you can assign those commands to keyboard shortcuts.

Finally, as @ccaudle said, you control the sample rate when configuring ALSA backend in Ardour. Or when setting up Jack.

I’m finding this exchange very interesting. I recently purchased a Focusrite 2i2 Gen3. The 2i2 works fine with Linux, but it’s clear that Focusrite is on the path to recreating the old WinModem problems where hardware requires Windows to work.

I had come to the conclusion that any larger Focusrite device would be unusable for me because of the requirement to use Windows software to access features. Do these tools fully enable the Focusrite devices or are they still limited (Air features, mixing, output to headphones…)

Considering Focusrite is one of the few manufacturers that actually supported development of drivers for FFADO so I am not sure if that is an accurate depiction. Like many manufacturers they don’t put resources to development on Linux, but they also don’t actively discourage it and IIRC have provided hardware and documentation in the past.

Sadly that past is gone since around a decade. I asked for documentation when writing the Scarlett mixer driver to no avail. They also don’t provide hardware to Linux driver devs anymore.

Good to know and be corrected on.

   Seablade

Thanks everyone. I will try to get more comfortable with alsactl and qasmixer. For people with a focusrite:
I did check, the scarlett first generation can have the sample rate controlled with Jack, I only had to turn the Scarlett on and off to have Jack recognize the switch.
I wanted to recap this from last year -
I did stick the Clarett 8pre USB in a Windows laptop, change its input to 96,000Hz with the Focusrite Control, stuck it back in my laptop, changed Jack to 96,000Hz, but after about 20 seconds Jack would freeze. Also, the Jack seconds were slower than seconds, like around 40 per minute. This was one of the things that made think that one does have to use windows or mac to do some save to hardware settings, atleast in the Clarett.
Agus had given me this answer: “As for 8 inputs, I don’t know about the Clarett, but one approach to consider is a USB - ADAT interface like the MiniDSP USBsteamer B (https://www.minidsp.com/products/usb-audio-interface/usbstreamer-box 12) and any 8 channel mic pre with an ADAT connection. The miniDSP unit is USB2 class compliant so will work with anything.”
If these audio interfaces continue to be so difficult with linux, I would try to go the way that Agus suggested, buy a decent pre amp, and hope that two miniDSPs would be able to carry 8 streams of 96sample rate from ADAT out to the DAW. I guess I would then have to listen from the laptop.

Hi…
Have no expertize like the others on this post, but I do have a 2i4 scarlett and had no end of problems when I started using Linux… I use Ubuntu Studio now but I have to go through the same routine to get everything to work right if I do a fresh install. The main issue is that my graphics card (nvidia 1080) is being treated as a primary soundcard, seems that the Scarlett, as a USB device, is not treated as a primary device.
Therefore ;

  1. I have to add my graphics card to a blacklist (etc/modprobe.d/blacklist.conf) where I add the line " blacklist snd_hda_intel" to the file and then reboot… This stops the system using the hdmi on the graphics card as a soundcard.
  2. The other file I alter is /etc/modprobe.d/alsa-base.conf. Near, or at the end of the file is a line “options snd_usb_audio index=-0”. If I change the 0 to a 1, save and reboot, the system looks to the USB as a source for the primary soundcard.

Think that doing both of these measures is probably belt and braces, but this clears all my soundcard problems up and Ubuntu Studio configures itself perfectly around my 2i4 after doing this. Qjkctl now only diplays my 2i4 as available which makes it easy to configure… Also, I had my onboard sound on my motherboard disabled in the bios…

Not sure if this will help, or that my solutions are the best ones, but I had to scour the net for hours back in the day for solutions to my Scarlett probs, these work for me…