MOTU Ultralite Mk5 - can't get it to work 10 channels (ALSA alt-set 3)

I probe the available modes of operation via ALSA as so:
Code:
cat  /proc/asound/UltraLitemk5/stream0
MOTU UltraLite-mk5 at usb-0000:03:00.3-2.1, high speed : USB Audio

Playback:
  Status: Stop
  Interface 1
    Altset 1
    Format: S24_3LE
    Channels: 22
    Endpoint: 0x02 (2 OUT) (ASYNC)
    Rates: 44100, 48000
    Data packet interval: 125 us
    Bits: 24
    Sync Endpoint: 0x83 (3 IN)
    Sync EP Interface: 2
    Sync EP Altset: 1
    Implicit Feedback Mode: Yes
  Interface 1
    Altset 2
    Format: S24_3LE
    Channels: 18
    Endpoint: 0x02 (2 OUT) (ASYNC)
    Rates: 88200, 96000
    Data packet interval: 125 us
    Bits: 24
    Sync Endpoint: 0x83 (3 IN)
    Sync EP Interface: 2
    Sync EP Altset: 2
    Implicit Feedback Mode: Yes
  Interface 1
    Altset 3
    Format: S24_3LE
    Channels: 10
    Endpoint: 0x02 (2 OUT) (ASYNC)
    Rates: 176400, 192000
    Data packet interval: 125 us
    Bits: 24
    Channel map: FL FR FC LFE RL RR FLC FRC RC SL
    Sync Endpoint: 0x83 (3 IN)
    Sync EP Interface: 2
    Sync EP Altset: 3
    Implicit Feedback Mode: Yes
I cannot get either Altset 2 or Altset 3 to work properly. I also noticed that some of the available PCMs for the device are invalid, e.g. surround71... etc.

If I use phughw I can get 8 channels of 192k Hz audio to play. That's not even shown as part of the stream0 info, so I am a little confused. I can also get 22 channels of output as long as I use either 44.1k or 48k rate.

I have a Gstreamer testing app for audio interfaces, so that I can see more about how they might be used via that platform. It basically tries all channel counts up to 22 to see if the interface will accept the format. For example, here I am running it with 192k and plughw and you can see that it can accept 2, 3, 4, 6, or 8 channels of audio, but not 10. Weird.

Code:
~/system_control/scripts/ALSAINFO.sh plughw:CARD=UltraLitemk5,DEV=0 192000 S24LE

ALSAINFO.sh written by Charlie Laub, version 2.1, July 2021

testing ALSA device: plughw:CARD=UltraLitemk5,DEV=0
Using a sample rate of 192000 Hz
probing the device with an audio format of S24LE

ALSA info about plughw:CARD=UltraLitemk5,DEV=0 :
plughw:CARD=UltraLitemk5,DEV=0:     UltraLite-mk5, USB Audio

ALSA information about this device:
------------------------------------------------

ACCESS:  MMAP_INTERLEAVED MMAP_NONINTERLEAVED MMAP_COMPLEX RW_INTERLEAVED RW_NONINTERLEAVED
FORMAT:  S8 U8 S16_LE S16_BE U16_LE U16_BE S24_LE S24_BE U24_LE U24_BE S32_LE S32_BE U32_LE U32_BE FLOAT_LE FLOAT_BE FLOAT64_LE FLOAT64_BE MU_LAW A_LAW IMA_ADPCM S20_LE S20_BE U20_LE U20_BE S24_3LE S24_3BE U24_3LE U24_3BE S20_3LE S20_3BE U20_3LE U20_3BE S18_3LE S18_3BE U18_3LE U18_3BE
SUBFORMAT:  STD
SAMPLE_BITS: [4 64]
FRAME_BITS: [4 640000]
CHANNELS: [1 10000]
RATE: [4000 4294967295]
PERIOD_TIME: [125 1000000]
PERIOD_SIZE: (0 4294967295]
PERIOD_BYTES: (0 4294967295]
PERIODS: (0 4294967295]
BUFFER_TIME: [1 4294967295]
BUFFER_SIZE: [1 4294967295]
BUFFER_BYTES: [1 4294967295]
TICK_TIME: ALL

------------------------------------------------


Probing device 'plughw:CARD=UltraLitemk5,DEV=0' using Gstreamer...

This device will accept an audio stream consisting of 2 channels of audio in the S24LE format
The bitmask for this mode is: 0x0000000000000003
   channel 0 is used in this mode. Its channel mask is: 0x1
   channel 1 is used in this mode. Its channel mask is: 0x2

This device will accept an audio stream consisting of 3 channels of audio in the S24LE format
The bitmask for this mode is: 0x000000000000000b
   channel 0 is used in this mode. Its channel mask is: 0x1
   channel 1 is used in this mode. Its channel mask is: 0x2
   channel 3 is used in this mode. Its channel mask is: 0x8

This device will accept an audio stream consisting of 4 channels of audio in the S24LE format
The bitmask for this mode is: 0x0000000000000033
   channel 0 is used in this mode. Its channel mask is: 0x1
   channel 1 is used in this mode. Its channel mask is: 0x2
   channel 4 is used in this mode. Its channel mask is: 0x10
   channel 5 is used in this mode. Its channel mask is: 0x20

WARNING: the number of channels was changed to: 2
This device will accept an audio stream consisting of 2 channels of audio in the S24LE format
The bitmask for this mode is: 0x0000000000000003
   channel 0 is used in this mode. Its channel mask is: 0x1
   channel 1 is used in this mode. Its channel mask is: 0x2

This device will accept an audio stream consisting of 6 channels of audio in the S24LE format
The bitmask for this mode is: 0x000000000000003f
   channel 0 is used in this mode. Its channel mask is: 0x1
   channel 1 is used in this mode. Its channel mask is: 0x2
   channel 2 is used in this mode. Its channel mask is: 0x4
   channel 3 is used in this mode. Its channel mask is: 0x8
   channel 4 is used in this mode. Its channel mask is: 0x10
   channel 5 is used in this mode. Its channel mask is: 0x20

WARNING: the number of channels was changed to: 2
This device will accept an audio stream consisting of 2 channels of audio in the S24LE format
The bitmask for this mode is: 0x0000000000000003
   channel 0 is used in this mode. Its channel mask is: 0x1
   channel 1 is used in this mode. Its channel mask is: 0x2

This device will accept an audio stream consisting of 8 channels of audio in the S24LE format
The bitmask for this mode is: 0x0000000000000c3f
   channel 0 is used in this mode. Its channel mask is: 0x1
   channel 1 is used in this mode. Its channel mask is: 0x2
   channel 2 is used in this mode. Its channel mask is: 0x4
   channel 3 is used in this mode. Its channel mask is: 0x8
   channel 4 is used in this mode. Its channel mask is: 0x10
   channel 5 is used in this mode. Its channel mask is: 0x20
   channel 10 is used in this mode. Its channel mask is: 0x400
   channel 11 is used in this mode. Its channel mask is: 0x800

I have also tried probing the interface using speaker-test. It "works" with 10 channels but there is a noticable delay of about 1.5 seconds so that when channel N is producing audio speaker-test has already moved on to the next channel. So I am not convinced it is legit. When I attempted 18 channels at 88.2k (Altset 2)
the channel count counted up to 18 and then there was a seg fault. I could get audio output from my headphones when it was on channel 11 and 12, so it seemed to be wrapping around the available channels.
Code:
speaker-test -D plughw:CARD=UltraLitemk5,DEV=0 -c 18 -r 88200 -f S32LE

speaker-test 1.2.6

Playback device is plughw:CARD=UltraLitemk5,DEV=0
Stream parameters are 88200Hz, S16_LE, 18 channels
Using 16 octaves of pink noise
Rate set to 88200Hz (requested 88200Hz)
Buffer size range from 24 to 176400
Period size range from 12 to 88200
Using max buffer size 176400
Periods = 4
was set period_size = 44100
was set buffer_size = 176400
 0 - Front Left
 1 - Front Right
 2 - Rear Left
 3 - Rear Right
 4 - Center
 5 - LFE
 6 - Side Left
 7 - Side Right
 8 - Channel 9
 9 - Channel 10
 10 - Channel 11
 11 - Channel 12
 12 - Channel 13
 13 - Channel 14
 14 - Channel 15
 15 - Channel 16
Segmentation fault (core dumped)

The interface has 10 TRS balanced output on back, plus optical in out which can carry 8 channels, 2 spdif coax, and 2 MIDI for a total of 22 channels. I really would only like to be able to use the interface on all 10 analog outputs at the advertised rate of 192k.

When I use pulseaudio the format used is 8 channels of 96k, although I did not make any attempts at tailoring pulseaudio for the interface.

Any ideas on what I could try here, or should I just blame this on a poorly developed Linux driver?
 
Last edited:
Hmm...what OS? I use mine on Ubuntu Server 64 bit on a raspberry pi 4 running CamillaDSP (ALSA only) and can use all sample rates successfully. Although I don't use plughw, I just use hw.

I did run across someone at ASR that was using the UL Mk5 with a dedicated streamer and it would only work at 44.1 / 48 kHz, not sure if it is a similar issue -> https://www.audiosciencereview.com/...mk5-review-audio-interface.24777/post-1153253.

Michael
 
The mystery deepens...

Within Gstreamer I need to supply the channel assignments or the interface cannot be opened properly. I realized that I had not done that correctly, so I went back and entered the correct ones. These were given in the output of stream0 (its in the first post of this thread) for Altset 3:
Code:
Channel map: FL FR FC LFE RL RR FLC FRC RC SL
Previously I was getting the error that the format was incorrect. This was because I was not setting these channel assignments correctly. I no longer get that error, only now I still cannot open the interface for 192k, 10 channels. The new error I get (from Gstreamer) is:
Code:
ERROR: from element /GstPipeline:pipeline0/GstAlsaSink:alsasink0: Could not open audio device for playback.
Additional debug info:
gstalsasink.c(865): gst_alsasink_open (): /GstPipeline:pipeline0/GstAlsaSink:alsasink0:
Playback open error on device 'hw:2,0': No such file or directory
What is strange is that I am specifying the interface by name, e.g.
Code:
alsasink device=hw:CARD=UltraLitemk5,DEV=0
I can confirm that the interface is registered under ALSA as card 2 via aplay or by checking under /proc/asound where there are entries for both card2 and UltraLitemk5.

Any ideas about what might be causing this behavior?
 
More Info...

I looked through the Gstreamer alsasink.c code here:
https://github.com/GStreamer/gst-plugins-base/blob/master/ext/alsa/gstalsasink.c

The relevant section is found in lines 865-895:
Code:
gst_alsasink_open (GstAudioSink * asink)
{
  GstAlsaSink *alsa;
  gint err;

  alsa = GST_ALSA_SINK (asink);

  /* open in non-blocking mode, we'll use snd_pcm_wait() for space to become
   * available. */
  CHECK (snd_pcm_open (&alsa->handle, alsa->device, SND_PCM_STREAM_PLAYBACK,
          SND_PCM_NONBLOCK), open_error);
  GST_LOG_OBJECT (alsa, "Opened device %s", alsa->device);

  return TRUE;

  /* ERRORS */
open_error:
  {
    if (err == -EBUSY) {
      GST_ELEMENT_ERROR (alsa, RESOURCE, BUSY,
          (_("Could not open audio device for playback. "
                  "Device is being used by another application.")),
          ("Device '%s' is busy", alsa->device));
    } else {
      GST_ELEMENT_ERROR (alsa, RESOURCE, OPEN_WRITE,
          (_("Could not open audio device for playback.")),
          ("Playback open error on device '%s': %s", alsa->device,
              snd_strerror (err)));
    }
    return FALSE;
  }
}

It looks to me like Gstreamer is throwing an open_error, which is not the "-EBUSY" error so it reverts to reporting the error reported by ALSA: "No such file or directory".