USB Audio enabled in nightly builds

Following a hint from @X512, I refactored the XHCI driver’s isochronous support (again) and made some tweaks to the USB audio driver … and audio output started working! After some more cleanups to reduce syslog spam and report errors more coherently, I’ve enabled the driver by default in hrev57560.

If you don’t have an XHCI (USB3) controller, mileage may vary; it may work on OHCI (USB 1.1) controllers also, if you have older hardware, but other controllers it probably won’t do anything at all.

In order to actually use the driver, you’ll need to open the Media preferences, and then restart media services multiple times: once to get “USB Audio” to appear as an output option, again after selecting it to get it to actually use that output, and maybe once again for good measure after that. (Needing to restart media services to see new outputs and then switch to them are known issues: #12777 and #12776.)

Please do test and report back!

35 Likes

Just upgraded to hrev57560 x86_64 and tested an Audio Technica ATR2x-USB adapter I had (device ID 0909:004c) and the output works fine, appearing in the output list after restarting the media services once. I’ve been watching YouTube videos and listening to music for a while now and it seems stable. The volume controls/mute button doesn’t work but they are software controlled so I didn’t expect them to. I’m using the the USB 3.0 controller on my i7-4790K system that I use Haiku on which has a z97 chipset. I have a couple of other USB audio adapters here I’ll test later but so far so good.

7 Likes

Tested the driver with a Zalman ZM-RSSC v1 5.1ch adapter from around 2014 which uses a SONiX SN11116 chipset (device ID 0c45:17cf), works fine in 2ch mode. 5.1ch mode doesn’t work but from what I understand, the driver in Haiku only supports 2ch mode at this time anyway. Same computer setup as in my previous post, again needing a restart of media services before it saw the device.

EDIT: The Zalman RM-RSSC will not work if already plugged in before booting but the Audio Technica ATR2x-USB works fine in the same circumstance. The Zalman unit had the same issue under Linux as I used to use it as a main audio output on another system with various versions of Ubuntu and it always needed a disconnect/reconnect to get it working although it showed up as connected and working so I wouldn’t say it’s an issue with the Haiku driver but a quirk of the unit itself. Interestingly, when I booted with the Zalman connected and attempted to play an MP3 with Media Player it was silent but playing for a few seconds then the player locked up presumably as some buffer filled up but after a bit some looped audio did come through as if it was playing the buffers that filled up. The output drop down for USB Audio when the Zalman is connected shows 3 outputs which is the same as under Linux, as it has 5.1ch analogue outputs, a headphone output and an S/PDIF output but I haven’t tested the other outputs yet.

1 Like

Tested on both 32 bits & 64 bits nightlies hrev57560 with a Trust GXT 350 7.1 Radius headset. It embeds a CM108B C-Media audio chip (0d8c:013c).
Sound is working fine after selecting USB Audio in Media prefs then restarting media service. Device was plugged before boot.
Things that I didn’t check:
The mike, plugging after boot, unplugging the device and plug again later.
If I understand correctly multichannel audio is virtual (at least on this device) making difficult to know if it really works.

2 Likes

I have only a cheap usb speaker around, listed as
device Audio (Streaming) [1|2|0]
vendor 4c4a: Unknown
device 4155: Unknown
with listdev
and as
4c4a:4155 /dev/bus/usb/0/0 “Jieli Technology” “UACDemoV1.0” ver. 0100
with listusb
it’s listed in media preflet as I reboot the media server, but no sound is produced
screenshot3

My Pixel 6a’s USB audio adapter is recognized, but when I restart the media server, the CPU goes to 100% and the system becomes unstable.

1 Like

Tested on both 64 bits nightlies hrev57560
Nettop HIPER i5-8400
BIOS CSM/Legacy
USB 3.0
Sound is working fine after selecting USB Audio in Media prefs then restarting media service. Device was plugged before boot.

64 bit hrev57560
Topton i7-1165G7 miniPC
BIOS UEFI
device Multimedia device Multimedia controller (Audio device) [4|3|0]
vendor 8086: Intel Corporation
device a0c8: Tiger Lake-LP Smart Sound Technology Audio Controller

device Serial bus controller (USB controller, XHCI) [c|3|30]
vendor 8086: Intel Corporation
device 9a13: Tiger Lake-LP Thunderbolt 4 USB Controller

device Serial bus controller (USB controller, USB4 Host Interface) [c|3|40]
vendor 8086: Intel Corporation
device 9a1b: Tiger Lake-LP Thunderbolt 4 NHI #0

device Serial bus controller (USB controller, USB4 Host Interface) [c|3|40]
vendor 8086: Intel Corporation
device 9a1d: Tiger Lake-LP Thunderbolt 4 NHI #1

device Serial bus controller (USB controller, XHCI) [c|3|30]
vendor 8086: Intel Corporation
device a0ed: Tiger Lake-LP USB 3.2 Gen 2x1 xHCI Host Controller

USB audio adapter is recognized, but when I restart the media server, the CPU goes to 100% and the system becomes unstable.

2 Likes

Where is your ticket ? I told you - create a ticket, with syslog attached )

3 Likes

exec
listusb -v /dev/bus/usb/0/0
and show output

1 Like

I have the same symptoms with my M-AUDIO M-TRACK SOLO USB device.

1 Like

Message to all interested )

If after restart media services you see symptoms like “the CPU goes to 100% and the system becomes unstable” - please, check /var/log/syslog. If you see many messages with XHCI errors like ‘Missed service’ or like this - create ticket with syslog, listdev, listusb -v attached

If after restart media services USB Audio appears in media preflet but with no sound or any errors -
do listusb command, find your usb audio device path like ‘/dev/bus/usb/x/x’
then do listusb -v usb_audio_device_path
and post output

I’ll try to help.

6 Likes

Oh, as addition.
If you see usb audio in media settings and “Output” tab in usb audio node, but hear no sound - try to move any sliders while plaing any sounds. It is quite possible that the sound will appear after these actions

2 Likes

welcome back!!! :partying_face: as soon as the little ones sleep I open the ticket!! :grinning:

3 Likes
Class .................. 0x00 (Defined at Interface level) ()
Subclass ............... 0x00 (Defined at Interface level) ()
Protocol ............... 0x00 (Defined at Interface level) ()
Max Endpoint 0 Packet .. 64
USB Version ............ 1.16
Vendor ID .............. 0x4c4a
Product ID ............. 0x4155
Product Version ........ 0x0100
Manufacturer String .... "Jieli Technology"
Product String ......... "UACDemoV1.0"
Serial Number .......... "433036313230302E"
[Configuration 0]
    Configuration String . ""
    [Interface 0]
        [Alternate 0 active]
            Class .............. 0x01 Audio ()
            Subclass ........... 0x01 Audio (Control Device)
            Protocol ........... 0x00 Audio (Control Device)
            Interface String ... "USBAudio2.0"
            [Descriptor 0]
                Type .............. 0x24
                Subtype ........... 0x01 (Header)
                ADC Release ....... 1.0
                Total Length ...... 40
                Interfaces ........ 1, 
            [Descriptor 1]
                Type .............. 0x24
                Subtype ........... 0x02 (Input Terminal)
                Terminal ID ....... 1
                Terminal Type ..... 0x0101 (USB Streaming)
                Associated Terminal 0
                Nr Channels ....... 2
                Channel Config .... 0x3
                   Front .......... Left Right 
                Channel Names ..... 0
                Terminal .......... 0
            [Descriptor 2]
                Type .............. 0x24
                Subtype ........... 0x06 (Feature Unit)
                Unit ID ........... 2
                Source ID ......... 1
                Control Size ...... 1
                   Master Channel . Mute 
                   Channel 1 ...... Volume 
                   Channel 2 ...... Volume 
                Feature ........... 0
            [Descriptor 3]
                Type .............. 0x24
                Subtype ........... 0x03 (Output Terminal)
                Terminal ID ....... 3
                Terminal Type ..... 0x0301 (Speaker)
                Associated Terminal 0
                Source ID ......... 2
                Terminal .......... 0
    [Interface 1]
        [Alternate 0]
            Class .............. 0x01 Audio ()
            Subclass ........... 0x02 Audio (Streaming)
            Protocol ........... 0x00 Audio (Streaming)
            Interface String ... ""
        [Alternate 1 active]
            Class .............. 0x01 Audio ()
            Subclass ........... 0x02 Audio (Streaming)
            Protocol ........... 0x00 Audio (Streaming)
            Interface String ... ""
            [Endpoint 0]
                MaxPacketSize .... 192
                Interval ......... 1
                Type ............. Isochronous
                Direction ........ Output
            [Descriptor 0]
                Subtype ........... 1 (AS_GENERAL)
                Terminal link ..... 1
                Delay ............. 1
                Format tag ........ 1
            [Descriptor 1]
                Subtype ........... 2 (FORMAT_TYPE)
                Format Type ....... 1 (FORMAT_TYPE_I)
                Channels .......... 2
                Subframe size ..... 2
                Bit resolution .... 16
                Sampling Freq ..... 48000, 
            [Descriptor 2]
                Type .............. 0x25 (CS_ENDPOINT)
                Subtype ........... 0x01 (EP_GENERAL)
                Attributes ........ 0x00 
                Lock Delay Units .. 0 (Undefined)
                Lock Delay ........ 0
1 Like

create text file usb_audio in /boot/home/config/settings/kernel/drivers
with content

trace 0x7F
logfile /var/log/usb_audio.log

restart system, restart media services, after ~1 minute show me content of /var/log/usb_audio.log

2 Likes

https://0x0.st/HDgd.log

1 Like

This is all? No any new lines in file?

I have tried this with two devices so far:

  1. USB-C hub “Portconnect” with a mini-jack > Works very well
  2. Lightning to USB-C adapter by Anker > Not recognized and listusb crashes

Ticket opened here

  1. UAC 2.0 device, not supported yet by usb_audio (and by listusb too).
2 Likes