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.)
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.
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.
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.
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
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.
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
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