Pulseaudio card-profile for Focusrite Scarlett 18i8

This is my first question here and I'm not quite sure what data to include for this question. Please ask me if you need me to provide more information.

I recently got the Focusrite Scarlett 18i8 Audiointerface. It's working really great in my DAW so far (using ALSA and manual channel assignment), but there is one annoying thing left: Pulseaudio is recognizing the device as 7.1 output but the 18i8 has 4 stereo outputs! Therefore VLC (and other apps) is playing movies in 7.1 mode and not stereo as it should.

I've googled around a bit and saw some things about Pulseaudio card-profiles and the pactl and pacmd commands. Thats why I tried:

pactl set-card-profile 3 output:analog-stereo

but it returns (translated by me):

Failure: no such entity

A look into

pacmd list-cards 

tells why:

4 card(s) available.

...

index: 3
name: <alsa_card.usb-Focusrite_Scarlett_18i8_USB_1000657A-00-USB>
driver: <module-alsa-card.c>
owner module: 8
properties:
    alsa.card = "3"
    alsa.card_name = "Scarlett 18i8 USB"
    alsa.long_card_name = "Focusrite Scarlett 18i8 USB at usb-0000:00:1d.0-1.2, high speed"
    alsa.driver_name = "snd_usb_audio"
    device.bus_path = "pci-0000:00:1d.0-usb-0:1.2:1.0"
    sysfs.path = "/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2:1.0/sound/card3"
    udev.id = "usb-Focusrite_Scarlett_18i8_USB_1000657A-00-USB"
    device.bus = "usb"
    device.vendor.id = "1235"
    device.vendor.name = "Novation EMS"
    device.product.id = "8014"
    device.product.name = "Scarlett 18i8 USB"
    device.serial = "Focusrite_Scarlett_18i8_USB_1000657A"
    device.string = "3"
    device.description = "Scarlett 18i8 USB"
    module-udev-detect.discovered = "1"
    device.icon_name = "audio-card-usb"
profiles:
    output:analog-surround-71: Analog Surround 7.1 Ausgang (priority 700, available: unknown)
    off: Aus (priority 0, available: unknown)
active profile: <output:analog-surround-71>
sinks:
    alsa_output.usb-Focusrite_Scarlett_18i8_USB_1000657A-00-USB.analog-surround-71/#2: Scarlett 18i8 USB Analog Surround 7.1
sources:
    alsa_output.usb-Focusrite_Scarlett_18i8_USB_1000657A-00-USB.analog-surround-71.monitor/#4: Monitor of Scarlett 18i8 USB Analog Surround 7.1
ports:
    analog-output: Analoge Ausgabe (priority 9900, latency offset 0 usec, available: unknown)
        properties:

The only profile available for this device is the analog-surround-71, but aplay lists all kinds of modes:

user@userbuntu:~$ aplay -L

...

sysdefault:CARD=USB
    Scarlett 18i8 USB, USB Audio
    Default Audio Device
front:CARD=USB,DEV=0
    Scarlett 18i8 USB, USB Audio
    Front speakers
surround40:CARD=USB,DEV=0
    Scarlett 18i8 USB, USB Audio
    4.0 Surround output to Front and Rear speakers
surround41:CARD=USB,DEV=0
    Scarlett 18i8 USB, USB Audio
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=USB,DEV=0
    Scarlett 18i8 USB, USB Audio
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=USB,DEV=0
    Scarlett 18i8 USB, USB Audio
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=USB,DEV=0
    Scarlett 18i8 USB, USB Audio
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=USB,DEV=0
    Scarlett 18i8 USB, USB Audio
    IEC958 (S/PDIF) Digital Audio Output
dmix:CARD=USB,DEV=0
    Scarlett 18i8 USB, USB Audio
    Direct sample mixing device
dsnoop:CARD=USB,DEV=0
    Scarlett 18i8 USB, USB Audio
    Direct sample snooping device
hw:CARD=USB,DEV=0
    Scarlett 18i8 USB, USB Audio
    Direct hardware device without any conversions
plughw:CARD=USB,DEV=0
    Scarlett 18i8 USB, USB Audio
    Hardware device with all software conversions

So here is my Question:

Is it possible to manually add a Pulseaudio-profile or do i need to change anything deeper in ALSA? If so, could anybody tell me how?

Thanks in advance!


Solution 1:

Yes you can create a pulseaudio profile to get the Focusrite 18i8 working in stereo.

Create the file /lib/udev/rules.d/91-pulseaudio.rules:

SUBSYSTEM!="sound", GOTO="pulseaudio1_end"
ACTION!="change", GOTO="pulseaudio1_end"
KERNEL!="card*", GOTO="pulseaudio1_end"

SUBSYSTEMS=="usb", ATTRS{idVendor}=="1235", ATTRS{idProduct}=="8014", ENV{PULSE_PROFILE_SET}="focusrite-18i8.conf"

LABEL="pulseaudio1_end"

And create the file /usr/share/pulseaudio/alsa-mixer/profile-sets/focusrite-18i8.conf:

[General]
auto-profiles = no

[Mapping analog-out]
description = Analog Outputs
device-strings = hw:%f
channel-map = left,right,aux0,aux1,aux2,aux3,aux4,aux5
direction = output

[Mapping analog-in]
description = Analog Inputs
device-strings = hw:%f
channel-map = left,right,aux0,aux1,aux2,aux3,aux4,aux5,aux6,aux7,aux8,aux9,aux10,aux11,aux12,aux13,aux14,aux15
direction = input

[Profile output:analog-out+input:analog-in]
description = Analog Stereo
output-mappings = analog-out
input-mappings = analog-in

Then either restart the machine or run the commands:

sudo udevadm trigger -ssound

pulseaudio -k

In response to @Sneetsher: The Focusrite Scarlett 18i8 now seems to work well with Linux 3.19 and newer. The internal mixer can be configured with alsamixer and the settings can be saved using sudo alsactl store. It is also possible to change other settings (such as the impedance of the inputs between instrument (Hi-Z) and line level, or to switch the inputs' pad between 0 and -10dB) using alsamixer.