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

Mikhail

  • Newbie
  • *
  • Posts: 39
  • Karma: +2/-1
    • View Profile
Re: XHCI and USB Audio perspectives
« Reply #45 on: October 03, 2022, 01:02:15 pm »
David, can you create a ticket against USBAUD2 at Netlabs and attach all info there ? It´s becoming too cluttered here.

I would like to ask you to post the interim results of diagnostics in this thread.
As far as I understand there is positive news?

Lars

  • Hero Member
  • *****
  • Posts: 1271
  • Karma: +65/-0
    • View Profile
Re: XHCI and USB Audio perspectives
« Reply #46 on: October 03, 2022, 01:51:52 pm »
intermediate results:

1) I fixed a bug in the selection of the proper feature unit (volume control) in both, USBAUDIO.SYS and USBAUD2.sys so that volume can be properly set (fixed problem for my own audio 2.0 device)
2) I fixed a bug in USBAUD2.SYS regarding setting the proper interface when programming sample frequency: this finally makes the "Savitech SA9227" (ID 262a:9227) device stream properly
3) fixed a bug (?) in USBAUD2.SYS regarding handling of sync feedback isochronous endpoint input which is a precondition to getting streaming to work properly (fixed problem for my own audio 2.0 device)

4) the general/overall problem of streaming to a XHCI (USB3) attached audio device has been fixed by an update to the XHCI host controller (HC) driver (currently only a test release at the AN site):

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

5) I am currently trying to get volume control to properly work on the "Behringer UMC202HD" USB audio 2.0 device. Even though I did 1), it still won`t work properly. Under investigation. But this device seems to be a piece of s**t, regarding the comments I read on the internet, for example:

https://nandakumar.org/blog/2022/02/umc202hd-linux.html

« Last Edit: October 03, 2022, 02:35:56 pm by Lars »

Mikhail

  • Newbie
  • *
  • Posts: 39
  • Karma: +2/-1
    • View Profile
Re: XHCI and USB Audio perspectives
« Reply #47 on: October 03, 2022, 02:37:05 pm »
Good news!
Fans of good sound have to wait for the official USB driver package from AN.

Thank you very much, the problem would hardly have been solved without you.

Lars

  • Hero Member
  • *****
  • Posts: 1271
  • Karma: +65/-0
    • View Profile
Re: XHCI and USB Audio perspectives
« Reply #48 on: October 30, 2022, 02:09:07 pm »
I have now uploaded usbdrv245.zip to Hobbes (currently, in "incoming" directory). That contains the updated USBAUDIO and USBAUD2 audio drivers.
For the updated XHCI host controller driver, that's up to AN. I suspect they are going to deliver that with AN 5.1.

David McKenna

  • Hero Member
  • *****
  • Posts: 742
  • Karma: +24/-0
    • View Profile
Re: XHCI and USB Audio perspectives
« Reply #49 on: October 30, 2022, 09:46:58 pm »
Hi Lars,

  Thanks for the update... I can report that it works perfectly, even with my POS Behringer UMC202HD USB audio 2.0 adapter on both USB2 and USB3 (test driver), and sounds great! I also tried it with a CMedia 'matchbox' type USB audio 1.0 adapter and that works as well. Fantastic!

Regards,
« Last Edit: October 31, 2022, 01:35:13 am by David McKenna »

Mikhail

  • Newbie
  • *
  • Posts: 39
  • Karma: +2/-1
    • View Profile
Re: XHCI and USB Audio perspectives
« Reply #50 on: December 06, 2022, 11:27:58 pm »
Question to the community of USB Audio device users.
I am interested in the opinion of those who use USB 3.0 XHCI port to connect an audio device, do you play audio files of different resolutions correctly?
Especially when switching between tracks of different resolutions, for example, when switching from 16bit/44.1kHz to 24bit/48kHz, is there any sound slowing down, and can your audio device display a stream format that does it get?

In my case, from the first time after switching from one resolution file to another, the signal parameters on the audio device do not change and the sound is distorted, only after restarting playback, the sound is played correctly and the device overrides the stream format.

I am using USB drivers 12.14 and have tried different versions of USB audio drivers from Lars with the same result. The software playing the file does not matter, the symptoms are the same on the built-in player and on PM123.

Maybe there are some suggestions, what could be the problem?

Lars

  • Hero Member
  • *****
  • Posts: 1271
  • Karma: +65/-0
    • View Profile
Re: XHCI and USB Audio perspectives
« Reply #51 on: December 07, 2022, 07:31:47 am »
That could either be the audio class driver (USBAUDIO, usbaud2) or the HC driver (USBXHCD). If you can, borrow a USB 2.0 (ehci) plug-in card from someone and see if that makes a difference (don't forget to add the USBEHCD driver to config.sys). If yes, it's the HC driver. If not, it's the audio class driver.

EDIT: I just tried on my system (using USBEHCD HC driver, no XHCI). I can swap sound file play (using different sample rate and resolution) without a problem, meaning, I can start playing one file, interrupting by playing another file with different sample rate and bit resolution and once that second file has finished playing, automatically resuming playing the first file. I have no distortion, glitch or anything else.

But that might also depend on the USB audio HW (not all USB audio HW behaves the very same way even though there are standards ...).
« Last Edit: December 07, 2022, 08:25:26 am by Lars »

Mikhail

  • Newbie
  • *
  • Posts: 39
  • Karma: +2/-1
    • View Profile
Re: XHCI and USB Audio perspectives
« Reply #52 on: December 08, 2022, 12:51:35 am »
Good time of day.

Lars, thank you for your feedback.
I've done the tests you mentioned. So far I have only an audio device based on Amanero. Another one based on Xmos will arrive at the weekend.

So far, the results are as follows:
The problem with changing the frequency on the device receiving the audio stream manifests itself on both EHCI controllers and XHCI.
In the beginning I used USB drivers version 12.14 and USB Audio driver 10.247
I have a motherboard Supermicro x10SBA with an EHCI controller on which I can turn off XHCI, and there is also a motherboard on which there is only XHCI and there is a separate PCI-e board with XHCI. After I made sure that the problem repeats on any of the controllers on the same set of software, I switched to an already tested board with an EHCI controller.

1. Remove the XHCI driver from Config, downgrade the USB driver version to 12.13, then to 12.12 - The problem persists.
2. USB driver version 12.12 and USB Audio driver 10.244 - No problem, everything is clear.
3. USB driver version 12.14 and USB Audio driver 10.244 - No problem, everything is clear.
4. USB drivers version 12.12 and USB Audio drivers SVN2364, SVN2368, 10.247 - The problem persists.

An interesting observation. Reset the audio device to 16bit/44/1kHz mode
I consistently play Wav audio files in various formats one by one, let's say so:
16/44.1 -> 24/48 -> 24/96 -> 24/192,
then on the indicator of the audio device we will see such a sequence of switching formats:
16/44.1 (Ok) -> 16/44.1 (Ops, it was necessary to switch to 24/48) -> 24/48 (Switched but not there, we need 24/96) -> 24/96 (again the parameters of the previous stream))
I have the impression that the switching is not on the frequency of the stream that should start, and on the frequency of the previous one.
« Last Edit: December 08, 2022, 12:33:58 pm by Mikhail »

Lars

  • Hero Member
  • *****
  • Posts: 1271
  • Karma: +65/-0
    • View Profile
Re: XHCI and USB Audio perspectives
« Reply #53 on: December 08, 2022, 10:34:41 am »
Then this is one of the cases where the audio USB HW is different enough in behaviour for two devices to work differently with the very same USB audio class driver.
As so often we have to find the "greatest common denominator" to make it work with Anamero but not to break it with the other devices that work (my device as an example ...).

If I find the time, we can do some trial and error to find that "greatest common denominator" but I cannot promise.

Lars

  • Hero Member
  • *****
  • Posts: 1271
  • Karma: +65/-0
    • View Profile
Re: XHCI and USB Audio perspectives
« Reply #54 on: December 08, 2022, 10:54:17 am »
1. Remove the XHCI driver from Config, downgrade the USB driver version to 12.13, then to 12.12 - The problem persists.
2. USB driver version 12.12 and USB Audio driver 10.245 - No problem, everything is clear.
3. USB driver version 12.14 and USB Audio driver 10.245 - No problem, everything is clear.
4. USB drivers version 12.12 and USB Audio drivers SVN2364, SVN2368, 1.247 - The problem persists.

Are you sure about that ? I have not changed anything except for the support for 4 new subtypes (8 kHz, 24/32-bit,mono/stereo) in USBAUDIO.SYS and USBAUD2.SYS from 10.245 to 10.247. So how can it work with 10.245 but not with 10.247 ?
Have you done a full reinstallation of the 10.247 USB audio driver install package, including all subcomponents that it contains, and not just copying/unzipping files ?

I still claim it has something to do with the HC drivers.

As a test, can you only test with my USB driver set ? Just install all of 10.247 to test with EHCI. If done, you can revert back to 12.14.
« Last Edit: December 08, 2022, 11:01:29 am by Lars »

Mikhail

  • Newbie
  • *
  • Posts: 39
  • Karma: +2/-1
    • View Profile
Re: XHCI and USB Audio perspectives
« Reply #55 on: December 08, 2022, 12:16:43 pm »
Yes, my mistake. The version I used in test 2 and 3 is 10.244
I apologize.
« Last Edit: December 08, 2022, 12:28:21 pm by Mikhail »

Mikhail

  • Newbie
  • *
  • Posts: 39
  • Karma: +2/-1
    • View Profile
Re: XHCI and USB Audio perspectives
« Reply #56 on: December 08, 2022, 12:27:50 pm »
Have you done a full reinstallation of the 10.247 USB audio driver install package, including all subcomponents that it contains, and not just copying/unzipping files ?
I did two installations of USB audio drivers, on two different systems:
1. On a brand new, fresh ArcaOS, I installed the package via minstall
2. On the PXE boot version I copied usbaud2.sys
In both cases, the problem was the same.

As a test, can you only test with my USB driver set ? Just install all of 10.247 to test with EHCI. If done, you can revert back to 12.14.
OK - today I will try and describe the result.
I tried to replace the USB drivers completely with your package version 10.247.
The result is the same.
« Last Edit: December 08, 2022, 01:21:51 pm by Mikhail »

Mikhail

  • Newbie
  • *
  • Posts: 39
  • Karma: +2/-1
    • View Profile
Re: XHCI and USB Audio perspectives
« Reply #57 on: December 08, 2022, 10:39:29 pm »
Amanero is a programmable interface, depending on the firmware, this device can be used for different application environments.
In fact, there are only two branches of current firmware.
I flashed Amanero with two different firmware: for Linux OS and Windows. In order to evaluate their behavior in the OS2 environment.

On the firmware for Linux, the device works fine on USB 12.x drivers from AN + USB Audio 10.244 and those below the version. Starting with version 10.245 USB Audio, there is support for working with XHCI controllers, but there is also a problem of determining the sampling frequency (possible only on Amanero audio adapters, tomorrow I will find out how the XMOS chips behave).

On Windows firmware, the device works fine only with USB + USBAudio 10.xx drivers, and with any versions, including 10.247. On USB 12.xx versions from AN Amanero is not detected. But since a driver for XHCI controllers has not yet been released for version 10.xx, then on my current motherboard I have to use the Amanero firmware for Linux and the USB 12.14 + USB Audio 10.247 drivers. Start playing the track twice when the sampling frequency of the audio file changes.

Lars

  • Hero Member
  • *****
  • Posts: 1271
  • Karma: +65/-0
    • View Profile
Re: XHCI and USB Audio perspectives
« Reply #58 on: December 09, 2022, 12:34:15 am »
Ok, you have proven that it is the USB audio class drivers that matter.

But this is a nightmare. I can try and roll back changes but it's going to be trial and error.
It's obvious that the FW for Linux and Windows behaves differently and for a good reason (obviously, Linux and Windows have different expectations of how an USB audio device should behave). I cannot say how much time I have for this experiment.
Would you be able to install Wireshark and the USB capture/filter driver that comes with it and take a trace of what happens when you play a sound file ? What I would need to know is what commands the OS sends in what sequence when an attempt is made to play a sound file. The OS/2 audio class driver would then have to mirror that behaviour (and hope it does not break for all other devices ...).

And that said, I would think that you would need to do this under Linux because you are using Linux FW (does Wireshark even exist under Linux ? I don't know).

It would make sense to raise a problem report so that the AN stack is able to detect the Anamero device if it uses FW for Windows. You are a paying AN customer, you are entitled to do so.

Lars

  • Hero Member
  • *****
  • Posts: 1271
  • Karma: +65/-0
    • View Profile
Re: XHCI and USB Audio perspectives
« Reply #59 on: December 09, 2022, 01:56:49 am »
On the firmware for Linux, the device works fine on USB 12.x drivers from AN + USB Audio 10.244 and those below the version. Starting with version 10.245 USB Audio, there is support for working with XHCI controllers, but there is also a problem of determining the sampling frequency (possible only on Amanero audio adapters, tomorrow I will find out how the XMOS chips behave).

On Windows firmware, the device works fine only with USB + USBAudio 10.xx drivers, and with any versions, including 10.247. On USB 12.xx versions from AN Amanero is not detected. But since a driver for XHCI controllers has not yet been released for version 10.xx, then on my current motherboard I have to use the Amanero firmware for Linux and the USB 12.14 + USB Audio 10.247 drivers. Start playing the track twice when the sampling frequency of the audio file changes.

Can you save USB descriptor info for these 2 different FW versions ? You can save USB descriptor info by running "lsusb.exe".