Crash when selecting USB audio interface

  • Hi

    So I have le 11.0.1 running on a pi4/8GB. When I plug in my Behringer U-phoria UMC1820 USB audio interface, the system reboots...

    The u-phoria has a separate power supply and is supposed to work well on the pi (e.g.).

    It seems like the device is recognised all right. it's just when I select it in the settings as audio output device that gives the crash. I see two new entries, one 'analog' and one 'spdif' when the u-phoria is connected. Selecting either gives the same result.

    Code
    $ uname -a
    Linux LibreELEC 6.1.19 #1 SMP Sat Mar 18 20:58:05 UTC 2023 aarch64 GNU/Linux
    Code
    $ lsusb |grep BEHRINGER
    Bus 001 Device 003: ID 1397:0503 BEHRINGER International GmbH UMC1820

    lsusb

    dmesg

    lsmod

    kodi.log

    kodi_crash.log

    Somehow these logs don't seem to reveal much, at least to me.

    I also disabled bluetooth in the le settings, that didn't help.

    Has anyone seen something similar? Any ideas are appreciated :)

  • Have you tried alternating USB ports when plugging in the unit, USB 2/USB3. Have you confirmed the unit is actually functioning as it should. Try powering on the RPI4 first then hook up the unit.

  • Thanks.

    Have you tried alternating USB ports when plugging in the unit, USB 2/USB3. Have you confirmed the unit is actually functioning as it should. Try powering on the RPI4 first then hook up the unit.

    So, it tried both USB2 and USB3 ports, it's the same.

    When I boot from a current raspios (Release date: May 3rd 2023, System: 32-bit, Kernel version: 6.1, Debian version: 11 (bullseye)) the interface not only doens't crash but actually play audio.

    Any difference if the device is connected before power-on/boot? (prob. not, but will ask anyway)

    Unfortunately not. It's exactly the same.

  • Thanks.

    So, it tried both USB2 and USB3 ports, it's the same.

    When I boot from a current raspios (Release date: May 3rd 2023, System: 32-bit, Kernel version: 6.1, Debian version: 11 (bullseye)) the interface not only doens't crash but actually play audio.

    Unfortunately not. It's exactly the same.

    That’s good. You’ve ruled out a faulty unit so it appears it’s down to a kernel/driver issue in LE. I’ve tried many DACs with LE and I must admit none of them have had any issues working. When you hot plug the unit what are you seeing from dmesg output.

  • Behringer UMC22 (ASIO conform) works fine here (RPi3B+). Which driver do you use at your music production OS? I bet it's not ASIO.

    ALSA. There is no ASIO for linux, is there?

    That’s good. You’ve ruled out a faulty unit so it appears it’s down to a kernel/driver issue in LE. I’ve tried many DACs with LE and I must admit none of them have had any issues working. When you hot plug the unit what are you seeing from dmesg output.

    This is what I get:

    Code
    [  130.109641] usb 1-1.1: new high-speed USB device number 6 using xhci_hcd
    [  130.200398] usb 1-1.1: New USB device found, idVendor=1397, idProduct=0503, bcdDevice= 1.00
    [  130.200432] usb 1-1.1: New USB device strings: Mfr=1, Product=3, SerialNumber=2
    [  130.200446] usb 1-1.1: Product: UMC1820
    [  130.200459] usb 1-1.1: Manufacturer: BEHRINGER
    [  130.200470] usb 1-1.1: SerialNumber: 2F35E9FA
    [  131.144560] usbcore: registered new interface driver snd-usb-audio

    I made another test, the interface seems to work in le outside of kodi:

    And I can successfully play audio like this:

    Code
    aplay --device plughw:CARD=UMC1820,DEV=0 test.wav

    What does this mean?

  • Channels are "NULL" for both output options. I think the "aplay" creates two stereo channels, but Kodi tries to use the channels, provided by the audio interface.

    "Device 2" has passthrough capabilities. Please try the passthrough option in LE's audio settings.

  • Hi again

    Indeed, when the interface is plugged in, I can activate passthrough, and the 'spdif' device is automatically selected as passthrough device (and it's the only one available in the passthrough dropdown).

    However when I now select said spdif device as audio output, I get again a reboot.

    Or would it be enough to only activate passthrough, without choosing a different output device?

    Meanwhile, I also installed le 11.0.3 on a different SD and tested with that, just to be sure. The issue persists, unfortunately... (the only difference being that I now got a boot loop instead of just a reboot)

  • Current theory: The driver was loaded OK, but you need JACK to configure ins and outs of the audio interface.

    Ardour has JACK, because it's made for musicians, LE doesn't. UMC1820 configuration for JACK: Click!

    Sorry, we don't support JACK. /shrug

  • Hm, why would I need JACK if the thing works fine in ALSA?

    The audio interface provides a ton of ins and out, without any standard, how to route them to a speaker system. I guess that's why the ALSA driver only provides an API for JACK. JACK is the expert for connection management.

    "aplay" makes an assumption about connections, and that worked. Kodi wants to do it right, and asks the driver for input channels. The answer is NULL (see post #8), because JACK should answer instead.

    My Behringer UMC22 has two ins, and two outs. In that case stereo routing is obvious, and that works for Kodi.

  • The audio interface provides a ton of ins and out, without any standard, how to route them to a speaker system. I guess that's why the ALSA driver only provides an API for JACK. JACK is the expert for connection management.

    "aplay" makes an assumption about connections, and that worked. Kodi wants to do it right, and asks the driver for input channels. The answer is NULL (see post #8), because JACK should answer instead.

    My Behringer UMC22 has two ins, and two outs. In that case stereo routing is obvious, and that works for Kodi.

    I see. Would it be possible to write some config file for kodi so it will recognise the correct input channels, like an asoundrc file?
    That sounds easier to me than trying to build le with jack support.
    Also, even if the device does not fully report the channels available, it seems a bit extreme to me for le to reboot. Shouldn't there be at least an warning or something?

  • No idea, and nobody will do this for you. Easiest workaround: Install Raspberry Pi OS, and autostart Kodi on it. So you'll get JACK.

    I'll try doing it myself. I like le much more than raspios :D
    Maybe somebody can give me some hints, though, that would be great. :)

  • Can you share the output of "amixer controls | paste" and "amixer contents | paste" ? .. You might need to --help and tweak the commands so they show the output against the USB device instead of the host system audio device.