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

Lars

  • Hero Member
  • *****
  • Posts: 1271
  • Karma: +65/-0
    • View Profile
Re: XHCI and USB Audio perspectives
« Reply #60 on: December 09, 2022, 01:58:22 am »
By the way: I have an XMOS device as a USB audio 2.0 device:

Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass          239 Miscellaneous Device
  bDeviceSubClass         2 ?
  bDeviceProtocol         1 Interface Association
  bMaxPacketSize0        64
  idVendor           0x20b1 XMOS Ltd
  idProduct          0x3060
  bcdDevice            0.03
  iManufacturer           1
  iProduct                2
  iSerial                 0
  bNumConfigurations      2
...

That device at least works fine with USBAUD2.SYS version 10.247.

Mikhail

  • Newbie
  • *
  • Posts: 39
  • Karma: +2/-1
    • View Profile
Re: XHCI and USB Audio perspectives
« Reply #61 on: December 09, 2022, 02:09:39 am »
In fact, I drew a slightly different conclusion from the situation.
I believe that the problem is in the USB stack from AN and since for both firmware versions your drivers 10.xx are suitable, as long as we don't run into the need to connect the device to the XHCI controller. As soon as the XHCI and USBD driver from AN appears, miracles begin. For example , such:
If there are 2 XHCI controllers in the system and we connect a USB Audio device to the port of the second controller, then playback speeds up - multiple times, and the timer of the player runs very fast and the sound is distorted.
When using the XHCI driver from AN, fatal errors appear, crashes when switching tracks (I mentioned them in the letter).

The fact that there is an acceptable USB audio operation on the EHCI controller ports with firmware for Linux only shows that the EHCI driver can be called selectively working.

By the way, the device on the Amanero controller works fine both under Windows OS on linux firmware and under Linux OS on Windows firmware. There are nuances when switching to DSD format and separate drivers are needed under windows when using the Windows firmware version, which just smooth out these clicks.

It seems to me if there was a 10.250 version of the driver with the file usbxhcd.sys then there would be no such problems in it :-)

Yes, I can save the descriptors. I'll post them here. I have already read the descriptors once, on the previous Amanero device with old firmware. Here they are below and in the attachment.

Code: [Select]
Bus 001 Device 002: ID 16d0:0a23 
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass          239
  bDeviceSubClass         2
  bDeviceProtocol         1
  bMaxPacketSize0        64
  idVendor           0x16d0
  idProduct          0x0a23
  bcdDevice            1.9b
  iManufacturer           1 Amanero Technologies
  iProduct                2 Combo384 Amanero
  iSerial                 3 413-001
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength          213
    bNumInterfaces          2
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0x40
      (Missing must-be-set bit!)
      Self Powered
    MaxPower                0mA
    Interface Association:
      bLength                 8
      bDescriptorType        11
      bFirstInterface         0
      bInterfaceCount         2
      bFunctionClass          1
      bFunctionSubClass       0
      bFunctionProtocol      32
      iFunction               0
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass         1
      bInterfaceSubClass      1
      bInterfaceProtocol     32
      iInterface              0
      AudioControl Interface Descriptor:
        bLength                 9
        bDescriptorType        36
        bDescriptorSubtype      1 (HEADER)
        bcdADC               2.00
        bCategory               1
        wTotalLength           72
        bmControl            0x00
      AudioControl Interface Descriptor:
        bLength                 8
        bDescriptorType        36
        bDescriptorSubtype     10 (CLOCK_SOURCE)
        bClockID               41
        bmAttributes         0x03 Internal programmable Clock
        bmControls           0x07
          Clock Frequency Control (read/write)
          Clock Validity Control (read-only)
        bAssocTerminal          0
        iClockSource            2 Combo384 Amanero
      AudioControl Interface Descriptor:
        bLength                 8
        bDescriptorType        36
        bDescriptorSubtype     11 (CLOCK_SELECTOR)
        bUnitID                40
        bNrInPins               1
        baCSourceID( 0)        41
        bmControls           0x03
          Clock Selector Control (read/write)
        iClockSelector          2 Combo384 Amanero
      AudioControl Interface Descriptor:
        bLength                17
        bDescriptorType        36
        bDescriptorSubtype      2 (INPUT_TERMINAL)
        bTerminalID            42
        wTerminalType      0x0101
        bAssocTerminal          0
        bCSourceID             40
        bNrChannels             2
        bmChannelConfig   0x00000000
        bmControls    0x0000
        iChannelNames           0
        iTerminal               0
      AudioControl Interface Descriptor:
        bLength                18
        bDescriptorType        36
        bDescriptorSubtype      6 (FEATURE_UNIT)
        bUnitID                10
        bSourceID              42
        bmaControls( 0)      0x0000000f
          Mute Control (read/write)
          Volume Control (read/write)
        bmaControls( 1)      0x0000000f
          Mute Control (read/write)
          Volume Control (read/write)
        bmaControls( 2)      0x0000000f
          Mute Control (read/write)
          Volume Control (read/write)
        iFeature                0
      AudioControl Interface Descriptor:
        bLength                12
        bDescriptorType        36
        bDescriptorSubtype      3 (OUTPUT_TERMINAL)
        bTerminalID            43
        wTerminalType      0x0301
        bAssocTerminal          0
        bSourceID              10
        bCSourceID             40
        bmControls         0x0000
        iTerminal               0
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass         1
      bInterfaceSubClass      2
      bInterfaceProtocol     32
      iInterface              0
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       1
      bNumEndpoints           2
      bInterfaceClass         1
      bInterfaceSubClass      2
      bInterfaceProtocol     32
      iInterface              0
      AudioStreaming Interface Descriptor:
        bLength                16
        bDescriptorType        36
        bDescriptorSubtype      1 (AS_GENERAL)
        bTerminalLink          42
        bmControls           0x00
        bFormatType             1
        bmFormats               1
          PCM
        bNrChannels             2
        bmChannelConfig   0x00000003
          Front Left (FL)
          Front Right (FR)
        iChannelNames           0
      AudioStreaming Interface Descriptor:
        bLength                 6
        bDescriptorType        36
        bDescriptorSubtype      2 (FORMAT_TYPE)
        bFormatType             1 (FORMAT_TYPE_I)
        bSubslotSize            4
        bBitResolution         32
      ** UNRECOGNIZED:  08 25 01 00 00 02 08 00
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x05  EP 5 OUT
        bmAttributes            5
          Transfer Type            Isochronous
          Synch Type               Asynchronous
          Usage Type               Data
        wMaxPacketSize     0x0308  1x 776 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes           17
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Feedback
        wMaxPacketSize     0x0004  1x 4 bytes
        bInterval               4
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       2
      bNumEndpoints           2
      bInterfaceClass         1
      bInterfaceSubClass      2
      bInterfaceProtocol     32
      iInterface              0
      AudioStreaming Interface Descriptor:
        bLength                16
        bDescriptorType        36
        bDescriptorSubtype      1 (AS_GENERAL)
        bTerminalLink          42
        bmControls           0x00
        bFormatType             1
        bmFormats               1
          PCM
        bNrChannels             2
        bmChannelConfig   0x00000003
          Front Left (FL)
          Front Right (FR)
        iChannelNames           0
      AudioStreaming Interface Descriptor:
        bLength                 6
        bDescriptorType        36
        bDescriptorSubtype      2 (FORMAT_TYPE)
        bFormatType             1 (FORMAT_TYPE_I)
        bSubslotSize            4
        bBitResolution         32
      ** UNRECOGNIZED:  08 25 01 00 00 02 08 00
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x05  EP 5 OUT
        bmAttributes            5
          Transfer Type            Isochronous
          Synch Type               Asynchronous
          Usage Type               Data
        wMaxPacketSize     0x0308  1x 776 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes           17
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Feedback
        wMaxPacketSize     0x0004  1x 4 bytes
        bInterval               4
Device Qualifier (for other device speed):
  bLength                10
  bDescriptorType         6
  bcdUSB               2.00
  bDeviceClass            0
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0        64
  bNumConfigurations      1
Device Status:     0x0000
  (Bus Powered)
« Last Edit: December 09, 2022, 06:06:24 am by Mikhail »

Lars

  • Hero Member
  • *****
  • Posts: 1271
  • Karma: +65/-0
    • View Profile
Re: XHCI and USB Audio perspectives
« Reply #62 on: December 09, 2022, 12:29:56 pm »
I looked at both of the descriptor dumps (Linux and Windows). Are these really for the same physical device ?

The "Linux dump" shows an audio interface (which of course was expected).
However, the "Windows dump" shows a vendor specific bulk interface (like it were a memory stick) but no audio interface.
With the Windows descriptor set, the device should never be detected as an audio device.
To me, the Windows descriptor set looks like it is for FW update or some such.

Mikhail

  • Newbie
  • *
  • Posts: 39
  • Karma: +2/-1
    • View Profile
Re: XHCI and USB Audio perspectives
« Reply #63 on: December 09, 2022, 08:21:49 pm »
The descriptors for the Windows firmware version were written correctly. For USB drivers version 12.14, the descriptors are read this way.
On USB drivers version 10.247, the result is completely different - more complete.

By the way, I compared a few descriptors and on the Linux version of the firmware, the files there are the same (It seems).

I also considered the descriptors from the M2tech hiface two device, it really works better, especially if installed in the USB 3.0 XHCI port on a PCIe card. There are no questions about the work at all, and frequency switching works and there are no artifacts in the sound, the device does not support DSD from 44/16 to 192/24. Everything would be fine, but if you plug M2tech into the port of the motherboard, then a crackle in the sound and freezes when executing player commands begins.

Lars

  • Hero Member
  • *****
  • Posts: 1271
  • Karma: +65/-0
    • View Profile
Re: XHCI and USB Audio perspectives
« Reply #64 on: December 10, 2022, 02:25:20 pm »
The problems you describe regarding the M2tech device are clearly a problem of the host controller driver USBXHCD.SYS (most likely) and/or USBD.SYS (less likely) because USBAUD2.SYS does not touch the HW and knows nothing about what HC instance or USB port is used (it does not distinguish between the onboard HC and the plugin card HC).
Since you are using AN USB stack, you will need to raise a problem report with AN.
If they don't respond, the only advice remaining is: switch over to another OS, Linux or Windows, whatever you prefer.
« Last Edit: December 12, 2022, 03:09:44 pm by Lars »

Mikhail

  • Newbie
  • *
  • Posts: 39
  • Karma: +2/-1
    • View Profile
Re: XHCI and USB Audio perspectives
« Reply #65 on: December 10, 2022, 07:08:14 pm »
If they don't respond, the only advice remaining is: switch over to another OS, Linux or Windows, whatever you prefer.
I am deeply immersed in the topic of sound quality of different operating systems on specially prepared computers. OS/2 in general and OS/4 in particular sounds the best of all systems. If the difference was not fundamental, I would have switched to Windows or Linux a long time ago. There would be much less problems with compatibility.

Lars

  • Hero Member
  • *****
  • Posts: 1271
  • Karma: +65/-0
    • View Profile
Re: XHCI and USB Audio perspectives
« Reply #66 on: December 17, 2022, 01:19:34 pm »
As to point 3) in my last email to you: please try the attached and see if that makes a difference.
Unfortunately, I cannot send any ZIP file to you that contains .SYS driver files (Google rejects).
You could also send me an upload link via private message.

Mikhail

  • Newbie
  • *
  • Posts: 39
  • Karma: +2/-1
    • View Profile
Re: XHCI and USB Audio perspectives
« Reply #67 on: January 13, 2023, 11:36:08 pm »
I will clarify the current status.
USB Audio devices of Class 2.0 on the ports of XHCI controllers do not work stably.
The problems described in the topics above have not yet been solved.
Most devices experience problems with cracking and dropping samples, sometimes slightly noticeable, sometimes very noticeable.
Other devices cannot synchronize the sampling frequency of the audio stream with the signal source the first time. As a result, the playback speed changes.

Unfortunately - AN rejected my ticket to the XHCI driver with this problem.

If there are those who wish to repeat the appeal, use only the release versions of drivers and OS when preparing logs.