Author Topic: XHCI and USB Audio perspectives  (Read 4182 times)

David McKenna

  • Sr. Member
  • ****
  • Posts: 474
  • Karma: +18/-0
    • View Profile
Re: XHCI and USB Audio perspectives
« Reply #30 on: September 21, 2022, 01:21:40 am »
 Hi Lars,

  Tried your new build  of usbaud2.sys and it works with USB2 plugs on my laptop, but not with USB3 plugs. Plugged in to a USB3 plug, when starting playback there is a 'click' noise, then PM123 just hangs at 0:00, but can be stopped and shut down. Plugged in to a USB2 plug, PM123 plays anything I try thru the Behringer. This is of course with the AN 12.14 test drivers available at arcanoae.com.

  If you need any other testing info, just ask.

  It might be good if when posting test versions to give them a date in the zip file name so we can be specific about what is being tested...

Regards,

Lars

  • Hero Member
  • *****
  • Posts: 1033
  • Karma: +51/-0
    • View Profile
Re: XHCI and USB Audio perspectives
« Reply #31 on: September 21, 2022, 07:12:49 am »
Hi David,

this was just a quick shot.

Anyway: removing what David (Azariewicz) claims to be the problem obviously did not help.
To be honest, I also doubt that the USB audio drivers do not conform to the spec.

What had been in the code before and what I now removed is not only backed by the usb audio spec (in fact, the usb audio 1.0 spec mandates it under certain conditions) but also by the libuvc implementation (which I worked on in the past) which does the same (from an application level) after it has stopped streaming to a UVC compliant video device: to set the alternate setting of the audio (or video, in case of libuvc) streaming interface to 0. The speciality of alternate setting 0 (compared to alternate settings >=1) is that it contains no endpoints which is odd (but hey, that`s what the audio 1.0 spec specifies !) and serves the purpose to release any bandwidth if you do not stream data.

Needless to say that libuvc was ported from Linux, so obviously, it works under Linux and very likely also for USB3, otherwise somebody would have complained. And it works under OS/2, at least when I only use USB 2.

I am out of ideas.
« Last Edit: September 21, 2022, 07:19:01 am by Lars »

David McKenna

  • Sr. Member
  • ****
  • Posts: 474
  • Karma: +18/-0
    • View Profile
Re: XHCI and USB Audio perspectives
« Reply #32 on: September 21, 2022, 10:35:54 pm »
 Hi Lars,

  Thanks for giving it a shot. I'm starting to get the idea that USB in general is a patchwork 'hall of mirrors' so it's amazing anyone can keep track of how it all fits together....

Regards,

Dave Yeo

  • Hero Member
  • *****
  • Posts: 3827
  • Karma: +80/-0
    • View Profile
Re: XHCI and USB Audio perspectives
« Reply #33 on: September 22, 2022, 01:55:41 am »
Hi Lars,

  Thanks for giving it a shot. I'm starting to get the idea that USB in general is a patchwork 'hall of mirrors' so it's amazing anyone can keep track of how it all fits together....

Regards,

My understanding is there was the standard, which IBM followed, then there was the MS way, which did not follow the standard and was not documented.
USB3 is supposed to be better, but David seems to be working around weirdness in the hardware too much, with Intel being the worst, which is kind of surprising.
You might want to try an older (2 or 3 versions or more back) and see if that helps, David has been making things more strict I think.

Lars

  • Hero Member
  • *****
  • Posts: 1033
  • Karma: +51/-0
    • View Profile
Re: XHCI and USB Audio perspectives
« Reply #34 on: September 22, 2022, 09:26:45 am »
Hi Lars,

  Thanks for giving it a shot. I'm starting to get the idea that USB in general is a patchwork 'hall of mirrors' so it's amazing anyone can keep track of how it all fits together....

Regards,

My understanding is there was the standard, which IBM followed, then there was the MS way, which did not follow the standard and was not documented.
USB3 is supposed to be better, but David seems to be working around weirdness in the hardware too much, with Intel being the worst, which is kind of surprising.
You might want to try an older (2 or 3 versions or more back) and see if that helps, David has been making things more strict I think.

In order to not mix up things:
1) "there was a standard that IBM followed, then there was the MS way": this statement only relates to device enumeration and this is mostly controlled by USBD.SYS. This has been changed to the MS way a long,long time ago and I don´t think that David has changed that in any way

2) "USB3 is supposed to be better": this is about typical requests like setting a device address or selecting an alternate setting of an interface. For < USB3, quite a bit of SW interaction was necessary to do that, USB3 does that almost all in HW with only very little SW interaction (which also involved timing issues which is always a bit unreliable to do in SW if you need fairly precise timing). In that way, USB3 is indeed better (apart from performance, of course)

Some of the requests in 2) are used during device enumeration in 1), so there is some relation to 1) , but it is not the same problem. They are 2 different problems.



Lars

  • Hero Member
  • *****
  • Posts: 1033
  • Karma: +51/-0
    • View Profile
Re: XHCI and USB Audio perspectives - new test version
« Reply #35 on: September 24, 2022, 09:28:23 am »
Hallo David et al,

please test the attached. Just unzip the USBAUD2.SY? and TRC00EE.TFF files and put them in the proper directories.

David McKenna

  • Sr. Member
  • ****
  • Posts: 474
  • Karma: +18/-0
    • View Profile
Re: XHCI and USB Audio perspectives
« Reply #36 on: September 24, 2022, 02:58:00 pm »
Hi Lars,

  SVN2347 works fine with my Behringer UMC202HD when plugged in to a USB2 connector, but get no sound when plugged in to a USB3 connector (get a faint 'click' sound when starting) and PM123 hangs at 0:00. This is on my HP Pavilion dv7 laptop running AOS 5.0.7 and the 12.14 USB test drivers...

  If you want to get into tracing or any other testing I'm willing...

Regards,

Lars

  • Hero Member
  • *****
  • Posts: 1033
  • Karma: +51/-0
    • View Profile
Re: XHCI and USB Audio perspectives
« Reply #37 on: September 24, 2022, 03:58:46 pm »
I had some email exchange with David. He told me that "isochronous in" endpoints are not yet completely/properly supported.

However USB audio 2.0 requires "isochronous in" endpoints as feedback endpoints to tell the audio driver how many samples per time unit the device expects to get (to iron out variances in transmission speed/to maintain the needed data rate when streaming). USB audio 1.0 (USBAUDIO.SYS) did not yet require that and therefore USB audio 1.0 should not be affected.

He also pointed me to a XHCI driver test build that you can find here:
https://www.arcanoae.com/resources/downloadables/experimental-builds/

It is worth trying because apart from other stuff, he has also modified isochronous support.
« Last Edit: September 24, 2022, 04:30:38 pm by Lars »

David McKenna

  • Sr. Member
  • ****
  • Posts: 474
  • Karma: +18/-0
    • View Profile
Re: XHCI and USB Audio perspectives
« Reply #38 on: September 24, 2022, 09:03:59 pm »
Hi Lars,

  The test drivers you reference are the ones I am using (David A had me use those when I reported the device not being detected). But if the 'isochronous in' endpoints you mention are needed but not fully implemented (for USB3), then I guess we have to wait for that...

Regards,

Lars

  • Hero Member
  • *****
  • Posts: 1033
  • Karma: +51/-0
    • View Profile
Re: XHCI and USB Audio perspectives
« Reply #39 on: September 24, 2022, 11:08:09 pm »
That is strange, because I installed the AN drivers and at least my audio 2.0 device works ok and I tried with "USB3 only" ports.
Please retry with the attached.
What you will notice is that it sounds a bit corrupted as David had already said. But it will play.

David McKenna

  • Sr. Member
  • ****
  • Posts: 474
  • Karma: +18/-0
    • View Profile
Re: XHCI and USB Audio perspectives
« Reply #40 on: September 24, 2022, 11:53:53 pm »
Hi Lars,

  Thanks! Tried SVN2351, but couldn't get it to work on any connector - on a USB2 connector PM123 would act like it is playing a file (timer counts, EQ waveform displays), but no sound came thru. On a USB3 connector PM123 would not play (as usual) and hang at 0:00.

  Back to SVN2347 and I can play on a USB2 connector only. One thing I noticed I didn't notice before... if the Behringer is connected to the USB2 connector while booting, then PM123 will not play sound until I unplug the Behringer, then plug back in.

Regards,

Lars

  • Hero Member
  • *****
  • Posts: 1033
  • Karma: +51/-0
    • View Profile
Re: XHCI and USB Audio perspectives
« Reply #41 on: September 25, 2022, 12:20:04 am »
Are you sure you are using

https://repos.arcanoae.com/misc/USB-12.14-20220829-test.exe

Make sure that you update all components and only take the usb audio drivers from my package.
What USB HW are you using ? I am using AMD/ATI. As I said, on my system it now works ok, with all flavours: UHCI,OHCI,EHCI,XHCI.

Try the attached. Maybe it makes a difference.

Lars

  • Hero Member
  • *****
  • Posts: 1033
  • Karma: +51/-0
    • View Profile
Re: XHCI and USB Audio perspectives
« Reply #42 on: September 25, 2022, 12:25:32 am »
Can you also attach the descriptor report for the Behringer ?
And then, also a trace. Make sure you also update TRC00EE.TFF ! I have enhanced tracing (added additional tracepoints).

Lars

  • Hero Member
  • *****
  • Posts: 1033
  • Karma: +51/-0
    • View Profile
Re: XHCI and USB Audio perspectives
« Reply #43 on: September 25, 2022, 08:56:57 am »
David, can you create a ticket against USBAUD2 at Netlabs and attach all info there ? It´s becoming too cluttered here.

David McKenna

  • Sr. Member
  • ****
  • Posts: 474
  • Karma: +18/-0
    • View Profile
Re: XHCI and USB Audio perspectives
« Reply #44 on: September 25, 2022, 03:57:38 pm »
Hi Lars,

  I created a ticket per your request, we can continue there. Definitely using the 20220829 AN drivers, but not the USBAUDIO parts. I attached lsusb results there as well as testlog reports on the system. I will need your guidance setting up for tracing.

  The SVN2354 driver works with USB2, but again USSB3 hangs at 0:00 when trying to play using PM123.

Regards,