console.systems

Using Focusrite Scarlett 18i6 in Linux, Part II

Thursday, August 8, 2013

Earlier I posted how to patch ALSA for Scarlett. Apparently it didn’t work for everyone.

Didn’t work quite well for me either. Every time I put my computer to sleep, after resume Scarlett lose the connection and there was nothing I could do to bring it back, except rebooting the computer. I got so tired of it that I even switched to internal sound card on my motherboard.

Recently I found another way that some may find suitable too. Digital inputs! That’s right, if you’re okay to use Scarlett for playback only and you value the sound quality, digital inputs is the way to go. Scarlett has two options in fact, ADAT via TOSLINK and S/PDIF via RCA.

Luckily my motherboard is equipped with S/PDIF as well, TOSLINK and internal S/PDIF connector. Some motherboards may have ready S/PSID RCA output on rear panel. At least I had to spend 30 min with soldering iron to get a bracket like this:

Boot to Windows and enable S/PDIF inputs in Scarlett MixControl panel, if they are not enabled for some reason yet. Scarlett will remember the settings, so no need to do it again. Enjoy!

Expanding wildcards with qmake

Tuesday, March 26, 2013

I was always wondering why doing something like this never worked

SOURCES += *.cpp
SOURCES -= excluded.cpp

excluded.cpp always stayed in SOURCES. The thing is that when you add a new value to the list, it’s just a string. Thus using wildcard in files names is nothing more but an asteriks character. And therefore using -= operator will only remove exact strings. But today I found another undocumented function I’ve been looking for years!

$$files(glob) — Returns a list of files which match the specified glob pattern.

So now I can do

SOURCES += $$files(*.cpp)
SOURCES -= excluded.cpp

and it actually works.

Enable icons in menus and buttons for Qt apps in Ubuntu 12.04.2

Wednesday, March 20, 2013

Way too many things broken in recent Ubuntu releases, should have stayed on 10.04 forever perhaps. Anyways, there is a fix:

$ gconftool-2 --type boolean --set /desktop/gnome/interface/buttons_have_icons true
$ gconftool-2 --type boolean --set /desktop/gnome/interface/menus_have_icons true

Shortcut to show folders first in Nautilus

Saturday, November 24, 2012

I really miss a menu shortcut in Nautilus to toggle “Show folders before files” option. Going to preferences every time is too much hassle.

But there is other way to toggle it using dconf or gconftool. For Ubuntu 12.04 or newer I suggest using dconf, install it if you don’t have it yet.

Create a script with the following content:

#!/bin/bash

# Version: Sun Sep 8 2013

OLD_VALUE=
LSB_RELEASE=$(lsb_release -sr)

if [ $LSB_RELEASE \< '12.04' ]; then
    OLD_VALUE=$(gconftool --get /apps/nautilus/preferences/sort_directories_first)
else
    OLD_VALUE=$(dconf read /org/gnome/nautilus/preferences/sort-directories-first)
fi

NEW_VALUE='false'
if [ $OLD_VALUE == 'false' ]; then
    NEW_VALUE='true'
fi

if [ $LSB_RELEASE \< '12.04' ]; then
    gconftool --type Boolean --set /apps/nautilus/preferences/sort_directories_first $NEW_VALUE
else
    dconf write /org/gnome/nautilus/preferences/sort-directories-first $NEW_VALUE
fi

If you have older Ubuntu, dconf maybe not available. Uncomment gconftool lines and comment dconf ones.

UPDATE 2013: the new version of the script works across all versions of Ubuntu.

Save the script somewhere, I prefer to keep mine in ~/.bin. Also give it execute permissions.

The next step may vary depending on Gnome version, I will describe it as it’s in Ubuntu 12.04. Go to keyboard shortcut setting and add a new custom shortcut. The command field set to path to the script we just created, in my case it’s ~/.bin/nautilus-folders-first.sh. You may also try to set full path if relative doesn’t work. Right click on the shortcut and set an actual hotkey combination. Choose something that doesn’t interferer with any other application, the shortcut is going to be system global. Ctrl+Alt+[some key] is good choice, I prefer Ctrl+Alt+F.

Now open Nautilus and browse where you have both files and folders, test the shortcut. If it doesn’t work, try the script in terminal and see if there are any errors.

Using Focusrite Scarlett 18i6 in Linux

Saturday, September 8, 2012

With the current 1.0.25 ALSA release you need to do some hacking to get Scarlett working. But the hack is as simple as it can be.

Download the tarball ftp://ftp.alsa-project.org/pub/driver/alsa-driver-1.0.25.tar.bz2 and comment the call to snd_usb_create_mixer() on the line 517 in alsa-kernel/usb/card.c so it would look like:

if (err > 0) {
    /* create normal USB audio interfaces */
    if (snd_usb_create_streams(chip, ifnum) < 0 /*||
        snd_usb_create_mixer(chip, ifnum, ignore_ctl_error) < 0*/) {
        goto __error;
    }
}

Build and install:

$ ./configue
$ make
$ sudo make install

Considering a bad practice to use sudo make install, in our case you don’t need to worry. Just reboot and select Scarlett as a default device in Sound Settings. Voila!

To restore Scarlett after reconnecting it from the USB port use:

$ sudo alsa force-reload
$ alsactl restore 0

<- Newer Posts Older Posts ->