nxp-mcuxpresso / mcux-sdk-examples

MCUXpresso SDK Examples
Other
57 stars 28 forks source link

usb audio class device not cross platform #20

Open raveslave opened 11 months ago

raveslave commented 11 months ago

In the examples, I noted this define: USB_DEVICE_WORKAROUND_AUDIO_20_WINDOWS, confirmed that you can either get it to run on windows, or mac, but not both...

Since an audio class device is expected to run on both macOS, Linux and Windows, any plans to fix this "compile time workaround"? Would be great if the official NXP UAC2 device driver could get a little update to work cross-platform.

AidenHu commented 11 months ago

The workaround is to fix the issue that Windows OS (like Windows 10) does not comply with the USB Audio 2.0 spec. Although we still not get the official confirm about this finding from MSFT, but we provide a solution related to the macro USB_DEVICE_WORKAROUND_AUDIO_20_WINDOWS. This macro is disabled by default. User need to enable this macro manually if the environment meet the 3 conditions:

  1. device is full speed running audio 2.0
  2. usb host is Windows OS that supports USB audio 2.0, like Win 10
  3. use feedback endpoint

We can make sure that our case can work on the OS that totally comply with USB audio spec no matter audio 1.0 or audio 2.0, but we can not meet not meet the requirement for cross-platform working based on the wrong behavior of Windows OS itself, sorry about this.

raveslave commented 11 months ago

thanks for reply, we're aware of audio-class is broken on windows resulting in most sound-card vendors choose to provide their own drivers as a workaround... wish we could have Microsoft jump in an resolve this once and for all including driverless multi-channel support.

so it is possible to run stereo in & out on both macOS and Windows10/11 driverless as long as we make use of the high-speed phy, correct!?

I will have to try again on the LPC55 ev-kit as I'm not sure if I tested using the FS or HS phy

AidenHu commented 10 months ago

Yes, if you use USB HS then you can ignore this issue on Windows 10/11. For your last 3 questions:

  1. You can use the recently released 2.15.0 SDK from https://mcuxpresso.nxp.com
  2. If you use LPCxpresso55s69 and LPCxpresso55s16, you can use the HS port except for the FS port. About hub, I am not sure what your purpose is, so sorry that I can not give more comments.
  3. Previously I tested the usb_hid_audio_unified case on Linux/Mac OS/Windows, actually the aim is not only for the test-protocol.