1 (edited by Be.0 2015-12-10 08:08:27)

Topic: Using all 12 channels of Babyface Pro in Linux

Hello, I just got my Babyface Pro and the sound is ineffable <3. I am trying to use its class compliant mode with Mixxx for DJing on GNU/Linux. However, I cannot figure out how to use channels 3-4 for my headphones. The manual says, regarding class compliant mode, "in Mac OS X, either the first two or all channels will work, depending on the choice in the Audio MIDI Setup." However, I do not know how to select between this 2 channel mode and the 12 channel mode with Linux. PulseAudio only shows it as a stereo device. Mixxx, which uses the PortAudio library, displays all 12 channels as available but doesn't work when any channels other than 1-2 are selected. Here is debugging output of Mixxx:

Debug [Main]: SoundManager::setupDevices()
Debug [Main]: SoundDevicePortAudio::open() "2, Babyface Pro (70785713): USB Audio (hw:1,0)"
Debug [Main]: framesPerBuffer: 256
Debug [Main]: Requested sample rate:  44100 Hz, latency: 5.80499 ms
Debug [Main]: Output channels: 4 | Input channels: 0
Debug [Main]: Opening stream with id 2
Expression 'alsa_snd_pcm_hw_params_set_channels( pcm, hwParams, self->numHostChannels )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 2051
Expression 'PaAlsaStreamComponent_InitialConfigure( &self->playback, outParams, self->primeBuffers, hwParamsPlayback, &realSr )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 2717
Expression 'PaAlsaStream_Configure( stream, inputParameters, outputParameters, sampleRate, framesPerBuffer, &inputLatency, &outputLatency, &hostBufferSizeMode )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 2838
Warning [Main]: Error opening stream: Invalid number of channels

aplay -l output:

**** List of PLAYBACK Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: ALC272 Analog [ALC272 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: Pro70785713 [Babyface Pro (70785713)], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

aplay -L output:

null
    Discard all samples (playback) or generate zero samples (capture)
pulse
    PulseAudio Sound Server
default
    Default ALSA Output (currently PulseAudio Sound Server)
sysdefault:CARD=PCH
    HDA Intel PCH, ALC272 Analog
    Default Audio Device
front:CARD=PCH,DEV=0
    HDA Intel PCH, ALC272 Analog
    Front speakers
surround21:CARD=PCH,DEV=0
    HDA Intel PCH, ALC272 Analog
    2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=PCH,DEV=0
    HDA Intel PCH, ALC272 Analog
    4.0 Surround output to Front and Rear speakers
surround41:CARD=PCH,DEV=0
    HDA Intel PCH, ALC272 Analog
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=PCH,DEV=0
    HDA Intel PCH, ALC272 Analog
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=PCH,DEV=0
    HDA Intel PCH, ALC272 Analog
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=PCH,DEV=0
    HDA Intel PCH, ALC272 Analog
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
hdmi:CARD=PCH,DEV=0
    HDA Intel PCH, HDMI 0
    HDMI Audio Output
sysdefault:CARD=Pro70785713
    Babyface Pro (70785713), USB Audio
    Default Audio Device
front:CARD=Pro70785713,DEV=0
    Babyface Pro (70785713), USB Audio
    Front speakers
surround21:CARD=Pro70785713,DEV=0
    Babyface Pro (70785713), USB Audio
    2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=Pro70785713,DEV=0
    Babyface Pro (70785713), USB Audio
    4.0 Surround output to Front and Rear speakers
surround41:CARD=Pro70785713,DEV=0
    Babyface Pro (70785713), USB Audio
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=Pro70785713,DEV=0
    Babyface Pro (70785713), USB Audio
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=Pro70785713,DEV=0
    Babyface Pro (70785713), USB Audio
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=Pro70785713,DEV=0
    Babyface Pro (70785713), USB Audio
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=Pro70785713,DEV=0
    Babyface Pro (70785713), USB Audio
    IEC958 (S/PDIF) Digital Audio Output

/proc/asound/card1/stream0 when playing to channels 1-2 with PulseAudio:

RME Babyface Pro (70785713) at usb-0000:00:1d.0-1.2, high speed : USB Audio

Playback:
  Status: Running
    Interface = 1
    Altset = 1
    Packet Size = 47
    Momentary freq = 44118 Hz (0x5.83c9)
    Feedback Format = 16.16
  Interface 1
    Altset 1
    Format: S24_3LE
    Channels: 2
    Endpoint: 3 OUT (ASYNC)
    Rates: 44100, 48000, 88200, 96000, 176400, 192000
    Data packet interval: 125 us
  Interface 1
    Altset 2
    Format: S24_3LE
    Channels: 12
    Endpoint: 3 OUT (ASYNC)
    Rates: 44100, 48000, 88200, 96000, 176400, 192000
    Data packet interval: 125 us

Capture:
  Status: Stop
  Interface 2
    Altset 1
    Format: S24_3LE
    Channels: 12
    Endpoint: 4 IN (ASYNC)
    Rates: 44100, 48000, 88200, 96000, 176400, 192000
    Data packet interval: 125 us
  Interface 2
    Altset 2
    Format: S24_3LE
    Channels: 2
    Endpoint: 4 IN (ASYNC)
    Rates: 44100, 48000, 88200, 96000, 176400, 192000
    Data packet interval: 125 us

So I guess the question is how to get PortAudio to use the "Altset 2" option. Could this be accomplished with some asoundrc sorcery? Does something need to change in snd-usb-audio? Is the issue with PortAudio and PulseAudio? How can I test channels 3-4 with aplay or another program?

2 (edited by Be.0 2015-12-10 09:24:53)

Re: Using all 12 channels of Babyface Pro in Linux

I tested it with JACK and channels 3-4 work, but with a catch. JACK works with hw:Pro70785713,0 but not hw:Pro70785713. However, Mixxx only lists hw:Pro70785713 as an option in the ALSA backend options. So the issue is that either Mixxx or PortAudio doesn't list hw:Pro70785713,0 as an option.

As a quick hack to avoid having to start JACK to use Mixxx, can someone suggest an ~/.asoundrc to work around this? I have tried various versions of the snippet below with no luck.

pcm.BabyfacePro {
    type hw
    card 1
    device 0
}

Re: Using all 12 channels of Babyface Pro in Linux

I got it working by setting the environment variable PA_ALSA_PLUGHW to 1 before starting Mixxx. This tells PortAudio, the library Mixxx uses to access sound hardware, to use ALSA's plughw devices instead of the hw devices. I'm not sure why this solves the problem, but it does. To avoid having to set this every time you run Mixxx, add a line with "export PA_ALSA_PLUGHW=1" to /etc/bashrc (or ~/.bashrc ), log out, and log back in.