Sound card sharing

I’m using an external sound card via USB.
Currently the card is connected directly to the Zynthian but I would also like to share it as the sound card of the Ipad.
I’ve tried connecting the Zynthian to the sound card via a usb hub but it doesn’t see it.
Is there any way to do this?

Ciao Stefano… scusa il mio inglese da Google translator ma é giusto rispondere in inglese.

If you enter with Putty and type “alsamixer”, in the list of audio devices do you see the USB sound card?

Ciao

Ciao Lanfranco…piacere di sentirti.
I do it from the Terminal with the “lsusb” command. While it sees the card (a Mackie) when it’s connected directly, it doesn’t see it if I interpose the usb hub.

Hi @stefano.bellotta ,
What is your hub type? I would recommend trying the version with USB 3 and external power. Maybe that would help.

ToFF is (as always) right… I had connected an M-Audio card and it worked if I connected nothing else. If I connected a USB keyboard it didn’t work anymore…

1 Like

I have a powered Hub 3.0. The same doesn’t work…maybe because I connected other devices above!?

Please post the result of lsusb with the soundcard plugged directly to the Zynthian and also with it plugged via the USB hub.

Direct connection
root@zynthian://zynthian# lsusb
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 0a73:001d Mackie Designs
Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Connection via USB hub
root@zynthian://zynthian# lsusb
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
root@zynthian://zynthian#

The USB hub is not being detected. Send the result with just the hub connected.

[Edit] Also, what do you mean by, “sharing”? You can’t use the same sound card with two different devices simultaneously. Which USB port on the Zynthian are you connecting to the USB hub?

On my Zynthian, without anything plugged to the USB ports I see:

Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

which shows two devices connected on bus 001, one device on bus 002 and one device on bus 003. These are all internal hub devices.

Connecting an external USB hub I see:

Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 009: ID 05e3:0605 Genesys Logic, Inc. USB 2.0 Hub
Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

You see that the external USB 2.0 Hub appears on Bus 001.

Plugging a soundcard into the external USB hub shows:

Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 010: ID 0d8c:013c C-Media Electronics, Inc. CM108 Audio Controller
Bus 001 Device 009: ID 05e3:0605 Genesys Logic, Inc. USB 2.0 Hub
Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

The C-Media soundcard also appears on Bus 001.

usb-devices gives more detail:

T:  Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=480 MxCh= 1
D:  Ver= 2.00 Cls=09(hub  ) Sub=00 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=1d6b ProdID=0002 Rev=05.15
S:  Manufacturer=Linux 5.15.70-v7l+ xhci-hcd
S:  Product=xHCI Host Controller
S:  SerialNumber=0000:01:00.0
C:  #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=0mA
I:  If#=0x0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub

T:  Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  2 Spd=480 MxCh= 4
D:  Ver= 2.10 Cls=09(hub  ) Sub=00 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=2109 ProdID=3431 Rev=04.21
S:  Product=USB2.0 Hub
C:  #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=100mA
I:  If#=0x0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub

T:  Bus=01 Lev=02 Prnt=02 Port=00 Cnt=01 Dev#=  9 Spd=480 MxCh= 4
D:  Ver= 2.00 Cls=09(hub  ) Sub=00 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=05e3 ProdID=0605 Rev=06.0b
S:  Product=USB2.0 Hub
C:  #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=100mA
I:  If#=0x0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub

T:  Bus=01 Lev=03 Prnt=09 Port=03 Cnt=01 Dev#= 10 Spd=12  MxCh= 0
D:  Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
P:  Vendor=0d8c ProdID=013c Rev=01.00
S:  Product=USB PnP Sound Device
C:  #Ifs= 4 Cfg#= 1 Atr=80 MxPwr=100mA
I:  If#=0x0 Alt= 0 #EPs= 0 Cls=01(audio) Sub=01 Prot=00 Driver=snd-usb-audio
I:  If#=0x1 Alt= 0 #EPs= 0 Cls=01(audio) Sub=02 Prot=00 Driver=snd-usb-audio
I:  If#=0x2 Alt= 0 #EPs= 0 Cls=01(audio) Sub=02 Prot=00 Driver=snd-usb-audio
I:  If#=0x3 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=00 Prot=00 Driver=usbhid

T:  Bus=02 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=5000 MxCh= 4
D:  Ver= 3.00 Cls=09(hub  ) Sub=00 Prot=03 MxPS= 9 #Cfgs=  1
P:  Vendor=1d6b ProdID=0003 Rev=05.15
S:  Manufacturer=Linux 5.15.70-v7l+ xhci-hcd
S:  Product=xHCI Host Controller
S:  SerialNumber=0000:01:00.0
C:  #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=0mA
I:  If#=0x0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub

From here we can see that the soundcard is plugged to port 3 of the external USB hub and that the external USB hub is plugged to port 0 of the internal USB hub, i.e. the first USB socket of the Raspberry Pi.

Too much info here maybe but it demonstrates that a USB hub is a device that the OS enumerates. You can diagnose issues by iteratively adding devices and testing and you can detect what is plugged where. (As an aside for interested readers, you can use udev rules to detect which USB port a device is connected to and treat it in a bespoke way, e.g. if you have several identical USB MIDI interfaces that present with the same name you could rename them with udev rules so that the one plugged into USB port 1 is called MIDI 1, etc.)

If you want to see the USB devices as a tree, use lsusb -t, e.g.

/:  Bus 03.Port 1: Dev 1, Class=root_hub, Driver=dwc2/1p, 480M
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/4p, 5000M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/1p, 480M
    |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 480M
        |__ Port 1: Dev 9, If 0, Class=Hub, Driver=hub/4p, 480M
            |__ Port 4: Dev 10, If 0, Class=Audio, Driver=snd-usb-audio, 12M
            |__ Port 4: Dev 10, If 1, Class=Audio, Driver=snd-usb-audio, 12M
            |__ Port 4: Dev 10, If 2, Class=Audio, Driver=snd-usb-audio, 12M
            |__ Port 4: Dev 10, If 3, Class=Human Interface Device, Driver=usbhid, 12M
2 Likes

Actually I was wrong conceptually…I considered Zynthian as an external device rather than a host and I connected it to the hub like a peripheral so it didn’t see it. Instead connecting the hub to the zynthian correctly sees everything that is connected. As follows:

Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 006: ID 0e41:5055 Line6, Inc.
Bus 001 Device 005: ID 0a73:001d Mackie Designs
Bus 001 Device 008: ID 0f54:0101 Kawai Musical Instruments Mfg. Co., Ltd MP6 Stage Piano
Bus 001 Device 010: ID 0582:015c Roland Corp.
Bus 001 Device 012: ID 0763:3110 M-Audio
Bus 001 Device 011: ID fc02:0101
Bus 001 Device 009: ID 045b:0209 Hitachi, Ltd
Bus 001 Device 007: ID 045b:0209 Hitachi, Ltd
Bus 001 Device 004: ID 045b:0209 Hitachi, Ltd
Bus 001 Device 003: ID 0bda:5411 Realtek Semiconductor Corp.
Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

However I did not intend to use the sound card at the same time but via a switch to connect it alternatively either to the zynthian or to the ipad…but I realized that it is too complicated and not worth it. However, experience has taught me another piece of this precious device. Thank you

The Zynthian can be connected as a device via its charging socket but this has a lot of challenges around providing sufficient power. A few people have had some degree of success but generally it has proven too awkward or unreliable. Look out for a better implementation on a (near) future version of Zynthian.

1 Like

Still good to know. Thank you Riban

You could technically do something smart about this. If you have a device that has USB-C with PD support, you could, technically, push out some tens of watts out of that. There could be two ways of accomplishing that.

  1. Buy an adapter that talks to the PD chip in order to enable 12V/20V on the output( these are readily and cheaply available on AliExpress) and then feed the output on a buck regulator to provide the 5V for rbpi, and only hook the rbpi usb for communication.

  2. Have a buck/boost between the USB of the rbpi and the host and let the rbpi negotiate the power with the host (this will use a single USB connector and hope for support in the kernel).

However, both approaches require a high degree of modification and understanding(especially the latter).