Problem Starting After Adding USB Device

Hello All,

I wanted to try to move my music production workflows over to my Linux box. So I created an LXD VM and connected to it via spice. I then connected my USB audio DAC but it was to crackly.

I then decided to to add the device to the config and let it attach that way. However I am getting an odd error when trying to start the VM afterwards:

> lxc start smashing-osprey --console=vga

Error: Failed to run: forklimits limit=memlock:unlimited:unlimited -- /usr/bin/qemu-system-x86_64 -S -name smashing-osprey -uuid 1b74e268-d28b-4070-bc0e-d6d6e6273ab5 -daemonize -cpu host -nographic -serial chardev:console -nodefaults -no-user-config -sandbox on,obsolete=deny,elevateprivileges=allow,spawn=deny,resourcecontrol=deny -readconfig /var/log/lxd/smashing-osprey/qemu.conf -spice unix=on,disable-ticketing=on,addr=/var/log/lxd/smashing-osprey/qemu.spice -pidfile /var/log/lxd/smashing-osprey/qemu.pid -D /var/log/lxd/smashing-osprey/qemu.log -smbios type=2,manufacturer=Canonical Ltd.,product=LXD -runas nobody: char device redirected to /dev/pts/1 (label console) : Process exited with non-zero value 1 Try 'lxc info --show-log smashing-osprey' for more info

> lxc info --show-log smashing-osprey   
                                                                                                                                                   
    Name: smashing-osprey
    Status: STOPPED
    Type: virtual-machine
    Architecture: x86_64
    Created: 2021/12/15 13:15 EST
    Last Used: 2021/12/15 13:20 EST

    Log:

    qemu-system-x86_64:/var/log/lxd/smashing-osprey/qemu.conf:301: Warning: speed mismatch trying to attach usb device "Komplete Audio 1" (high speed) to bus "qemu_usb.0", port "4.1" (full speed)
    qemu-system-x86_64:/var/log/lxd/smashing-osprey/qemu.conf:301: failed to open host usb device /dev/bus/usb/003/012

Does anyone have any ideas how I may be able to make this work? I really want to be able to fully move away from Windows.

Thanks very much.

Sounds like that DAC is USB 1.0 maybe?

It is the Komplete Audio 1 from this page:

It says it’s USB 2.

@monstermunchkin any idea what’s up with this? I think you were the one who did the USB support?

I have no idea what’s going on here, but perhaps with some more information we can figure it out. Could you please provide the following information:

  • QEMU version using qemu-system-x86_64 --version
  • Linux distribution on the host
  • Ouput of lsusb inside of the VM (might have to install usbutils)
  • Output of ls -l /dev/bus/usb/003/012 (the device path) on the host

Can you attach other USB devices to the VM without any problems?

Sure I can! And thank you soo much for helping I’m really hoping to make this work.

  • QEMU version using qemu-system-x86_64 --version
    

QEMU emulator version 6.1.0
Copyright (c) 2003-2021 Fabrice Bellard and the QEMU Project developers

  • Linux distribution on the host
    

Linux manjaro-framework 5.15.6-2-MANJARO #1 SMP PREEMPT Sat Dec 4 11:11:58 UTC 2021 x86_64 GNU/Linux

  • Ouput of lsusb inside of the VM (might have to install usbutils)
    

I have been testing on the Archlinux Desktop image but end machine would be a Windows one. I just wanted to prove this could work first:

Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

  • Output of ls -l /dev/bus/usb/003/012 (the device path) on the host
    

crw-rw-r-- 1 root root 189, 269 Dec 16 10:08 /dev/bus/usb/003/014

Also here is a full list of commands and outputs when I just redid this. I should note that I can hear the speakers popping like it it trying to attache the device a couple of times before it fails:

lxc launch images:archlinux/desktop-gnome --vm -c security.secureboot=false -c limits.cpu=4 -c limits.memory=4GiB --console=vga
Creating the instance
Instance name is: polished-manatee
Starting polished-manatee

lxc config device add polished-manatee nika1 usb vendorid=17cc productid=1830
Device nika1 added to polished-manatee

lxc start polished-manatee --console=vga
Error: Failed to run: forklimits limit=memlock:unlimited:unlimited – /usr/bin/qemu-system-x86_64 -S -name polished-manatee -uuid 40d52c7c-7afd-4353-9986-8ca6862f5374 -daemonize -cpu host -nographic -serial chardev:console -nodefaults -no-user-config -sandbox on,obsolete=deny,elevateprivileges=allow,spawn=deny,resourcecontrol=deny -readconfig /var/log/lxd/polished-manatee/qemu.conf -spice unix=on,disable-ticketing=on,addr=/var/log/lxd/polished-manatee/qemu.spice -pidfile /var/log/lxd/polished-manatee/qemu.pid -D /var/log/lxd/polished-manatee/qemu.log -smbios type=2,manufacturer=Canonical Ltd.,product=LXD -runas nobody: char device redirected to /dev/pts/1 (label console)
: Process exited with non-zero value 1
Try lxc info --show-log polished-manatee for more info

lxc info --show-log polished-manatee
Name: polished-manatee
Status: STOPPED
Type: virtual-machine
Architecture: x86_64
Created: 2021/12/16 10:01 EST
Last Used: 2021/12/16 10:01 EST

Log:

qemu-system-x86_64:/var/log/lxd/polished-manatee/qemu.conf:301: Warning: speed mismatch trying to attach usb device “Komplete Audio 1” (high speed) to bus “qemu_usb.0”, port “4.1” (full speed)
qemu-system-x86_64:/var/log/lxd/polished-manatee/qemu.conf:301: failed to open host usb device /dev/bus/usb/003/014

I have tried one other USB device. It was a USB drive and worked fine. But it would also let me start the VM unlike this one.

The information you provided looks fine. I don’t know why QEMU says that it cannot open the host USB device.

Does the device actually have Linux support?

I use it all day long on my host ArchLinux box. It works perfectly.
There wasn’t anything extra needed, I just plugged it in and it worked.

@stgraber @monstermunchkin

I tried another DAC this time a Scarlett Focusrite and it has the same issue.

I’m still fairly new to qemu and lxd and I’m not really sure where to go from here to dig into it more.
If it’s a speed mismatch is there a way to force the right speed on it?

Can you show lsusb -tv?

Yep! Happy to:

> lsusb -tv
/:  Bus 04.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/4p, 10000M
    ID 1d6b:0003 Linux Foundation 3.0 root hub
/:  Bus 03.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/12p, 480M
    ID 1d6b:0002 Linux Foundation 2.0 root hub
    |__ Port 6: Dev 28, If 0, Class=Hub, Driver=hub/4p, 480M
        ID 2188:0034 No brand 
        |__ Port 1: Dev 29, If 0, Class=Hub, Driver=hub/8p, 480M
            ID 2188:0031 No brand 
            |__ Port 2: Dev 34, If 0, Class=Human Interface Device, Driver=usbhid, 12M
                ID 1532:005c Razer USA, Ltd DeathAdder Elite
            |__ Port 2: Dev 34, If 1, Class=Human Interface Device, Driver=usbhid, 12M
                ID 1532:005c Razer USA, Ltd DeathAdder Elite
            |__ Port 2: Dev 34, If 2, Class=Human Interface Device, Driver=usbhid, 12M
                ID 1532:005c Razer USA, Ltd DeathAdder Elite
            |__ Port 4: Dev 35, If 2, Class=Audio, Driver=snd-usb-audio, 480M
                ID 17cc:1830 Native Instruments 
            |__ Port 4: Dev 35, If 0, Class=Audio, Driver=snd-usb-audio, 480M
                ID 17cc:1830 Native Instruments 
            |__ Port 4: Dev 35, If 3, Class=Application Specific Interface, Driver=, 480M
                ID 17cc:1830 Native Instruments 
            |__ Port 4: Dev 35, If 1, Class=Audio, Driver=snd-usb-audio, 480M
                ID 17cc:1830 Native Instruments 
            |__ Port 8: Dev 32, If 0, Class=, Driver=, 12M
                ID 2188:0035 No brand 
            |__ Port 8: Dev 32, If 1, Class=Vendor Specific Class, Driver=, 12M
                ID 2188:0035 No brand 
        |__ Port 2: Dev 30, If 0, Class=, Driver=, 480M
            ID 2109:0102 VIA Labs, Inc. 
        |__ Port 4: Dev 31, If 0, Class=Hub, Driver=hub/5p, 480M
            ID 3384:4216 System76 
            |__ Port 5: Dev 33, If 2, Class=Human Interface Device, Driver=usbhid, 12M
                ID 3384:0001 System76 Launch Configurable Keyboard (launch_1)
            |__ Port 5: Dev 33, If 0, Class=Human Interface Device, Driver=usbhid, 12M
                ID 3384:0001 System76 Launch Configurable Keyboard (launch_1)
            |__ Port 5: Dev 33, If 1, Class=Human Interface Device, Driver=usbhid, 12M
                ID 3384:0001 System76 Launch Configurable Keyboard (launch_1)
    |__ Port 7: Dev 3, If 0, Class=Video, Driver=uvcvideo, 480M
        ID 0bda:5634 Realtek Semiconductor Corp. 
    |__ Port 7: Dev 3, If 1, Class=Video, Driver=uvcvideo, 480M
        ID 0bda:5634 Realtek Semiconductor Corp. 
    |__ Port 9: Dev 4, If 0, Class=Vendor Specific Class, Driver=, 12M
        ID 27c6:609c Shenzhen Goodix Technology Co.,Ltd. 
    |__ Port 10: Dev 5, If 0, Class=Wireless, Driver=btusb, 12M
        ID 8087:0032 Intel Corp. AX210 Bluetooth
    |__ Port 10: Dev 5, If 1, Class=Wireless, Driver=btusb, 12M
        ID 8087:0032 Intel Corp. AX210 Bluetooth
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/4p, 10000M
    ID 1d6b:0003 Linux Foundation 3.0 root hub
    |__ Port 4: Dev 13, If 0, Class=Hub, Driver=hub/4p, 10000M
        ID 8087:0b40 Intel Corp. 
        |__ Port 1: Dev 14, If 0, Class=Hub, Driver=hub/4p, 10000M
            ID 3384:7216 System76 
        |__ Port 4: Dev 15, If 0, Class=Hub, Driver=hub/5p, 10000M
            ID 2188:0032 No brand 
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/1p, 480M
    ID 1d6b:0002 Linux Foundation 2.0 root hub

Which one is the device you’re trying to pass in?

It is the Native Instruments one:

|__ Port 4: Dev 35, If 2, Class=Audio, Driver=snd-usb-audio, 480M
                ID 17cc:1830 Native Instruments 
            |__ Port 4: Dev 35, If 0, Class=Audio, Driver=snd-usb-audio, 480M
                ID 17cc:1830 Native Instruments 
            |__ Port 4: Dev 35, If 3, Class=Application Specific Interface, Driver=, 480M
                ID 17cc:1830 Native Instruments 
            |__ Port 4: Dev 35, If 1, Class=Audio, Driver=snd-usb-audio, 480M
                ID 17cc:1830 Native Instruments 

Okay and can you share your LXD config (lxc config show --expanded NAME)?

Here you go! Thanks for helping me:

> lxc config show --expanded smashing-osprey                   
architecture: x86_64
config:
  image.architecture: amd64
  image.description: Archlinux current amd64 (20211214_04:18)
  image.os: Archlinux
  image.release: current
  image.serial: "20211214_04:18"
  image.type: disk-kvm.img
  image.variant: desktop-gnome
  limits.cpu: "4"
  limits.memory: 4GiB
  security.secureboot: "false"
  volatile.base_image: e51781094dc177401ac239b2ba1c83aca5dfad235413af7459422f6500130957
  volatile.eth0.hwaddr: 00:16:3e:4d:75:11
  volatile.last_state.power: STOPPED
  volatile.uuid: 1b74e268-d28b-4070-bc0e-d6d6e6273ab5
  volatile.vsock_id: "10"
devices:
  eth0:
    name: eth0
    network: lxdbr0
    type: nic
  nika1:
    productid: "1830"
    type: usb
    vendorid: 17cc
  root:
    path: /
    pool: default
    type: disk
ephemeral: false
profiles:
- default
stateful: false
description: ""

The device is nika1.

@stgraber Does that help any? Is there anyway to manually set the speed to fix that error? Or is that error something else entirely?

We’ll need to find some way to reproduce this on our side, then we can see if there’s some tweaks we can make to the qemu config to have it behave better.

@monstermunchkin any chance you can try with a variety of USB devices? Something like a mix of USB sticks, webcam and something low speed like a keyboard/mouse hopefully will cause this to happen in one combination or another.

@stgraber

I will also try with a range of USB devices aiming for slower ones. Worse case I can always ship this DAC to you so you can try it out. That’s how much I want to move my music stuff over to Linux. :slight_smile: Better still if you are willing to ship it back but worse case I’m out $100.

@nmcbride no need to ship the DAC as I’m able to reproduce this error with my webcam :wink:

qemu-system-x86_64:/var/log/lxd/v3/qemu.conf:301: Warning: speed mismatch trying to attach usb device "HD Pro Webcam C920" (high speed) to bus "qemu_usb.0", port "4.1" (full speed)
qemu-system-x86_64:/var/log/lxd/v3/qemu.conf:301: failed to open host usb device /dev/bus/usb/001/008

I’ll try to come up with a fix.