USB interface for multi channel outputs, not just stereo

Big thanks to @alex6679 for all the helps, we have met twice for last two saturdays, unfortunately we still could not spot the reason why my Mac could not work with teensy 4.1 for USB multi-channels. In the beginning I was on OS Ventura (13.x.x) and then updated to Sequoia (15.0.1).

I am posting the screenshots of the spec of my USB and Mac OS here for further debugging and really looking for mac users who can share their experience if they have made it work. cheers.

Screenshot 2024-10-13 at 10.41.23 AM copy.jpg
Screenshot 2024-10-13 at 10.41.40 AM.jpg
 
@AntiLoop Thanks for the idea, I will test it later today. Actually I have been testing with 3.3V power supply not 5V, because I only know the two 2.2k pull up resistor works with the 3.3V, maybe that’s an issue too? And do you know what are the correct pull-up resistors for the 5V?
 
@Weiweiweiwear I thought the Teensy is powered by the usb connection to the Mac? If you are talking about the power supply of the audio codec: I think it's best to disconnect the audio codec from the Teensy. For debugging it's normally best to find a hardware setup and software that is on the one hand as minimalistic as possible and at the same time allows you to reproduce the problem.
 
Ah you are right, yes it’s maybe not so relevant and better to disconnect the cs42448 during USB wise testing. It’s just I can only testify it with the board without you.
 
I can give more details about what we tried:

At our tests we set the number of channels to 2, we chose 44.1kHz as sample rate and 16bit resolution. We used the simple usb input example from my repository. There were no buffer over- or underruns and we received a signal at the Teensy. The problem is that this signal consists of zeros/silence. At the start up of the Teensy we see that the Teensy receives the expected sound signal for a fraction of a second. But then it always switches to zeros.

We switched back to the original usb input code from the T4 core and received the correct signal. The differences between the new usb input and the code from T4 core can be split into two parts: I switched from UAC1 standard to UAC2 and I changed the implementation of the AudioInputUSB class (i.e. how the usb feedback is computed, the behavior at buffer over- and underruns,... ). In order to find out which of these two changes causes the problem, I merged the two implementations. I used the implementation of the UAC1 standard from the T4 core and combined it with the new implementation of the AudioInputUSB class. With this mixed implemenation, we then received the correct signal and I therefore think that the problem is related to the UAC2 standard. Maybe my implementation does not completely comply with the UAC2 standard.

My current problem is: When we debug the Teensy code, everything just looks fine (except that the received signal consists of zeros). I would therefore now focus on the USB host and try to find out, why the Mac sends only silence to the Teensy. We had a look at the MacOs sound settings and here also everything looks fine. The Teensy is detected as a stereo, 16bit, 44.1kHz audio device. We would be very glad if some experienced Mac user can help us. Are there for example some log files similar to linux, that would tell us if there is a problem with the Teensy?

@AntiLoop : Just to make sure that we understood you correctly: You successfully use my implementation of usb input on a Mac? That means on your Mac my UAC2 implemtation doesn't cause problems? Do you also use 2 channels/ 44.1kHz/ 16bit as we did at our tests? Do you know of any sound settings that @Weiweiweiwear could check?
 
@AntiLoop Thanks for the idea, I will test it later today. Actually I have been testing with 3.3V power supply not 5V, because I only know the two 2.2k pull up resistor works with the 3.3V, maybe that’s an issue too? And do you know what are the correct pull-up resistors for the 5V?
Perhaps,the pullup resistor takes part of a RC circuit and can influence the speed response if the circuit is speed sensitive like TDM,look at that:

 
I really appreciate your efforts to help. In our last tests, we removed the audio codec from the Teensy because it wasn't necessary to reproduce the issue. The problem that Weiweiweiwear is facing seems to be related to the USB input, particularly to my implementation of the UAC2 standard.
 
Hummm if there's any "conventional" test code or other test method for USB audio multichannel I can test with in any existed library or example code?
 
Hi all and @alex6679

Thanks for all the helps again, I have tested my teensy 4.1 and CS42448 on a PC and its working all great, now back to Mac and capture my USB packets. I have found a way to capture USB packets with Wireshark on Mac, hope the attached file helps, let me know if you need a longer capture since the file size limitation here!
  1. common+R under rebooting
  2. enter "csrutil disable"
  3. go back so OS and enter "sudo ifconfig XHC20 up"
  4. go to system report and find your USB device and copy the location ID
  5. go to XHC20 in your Wireshark, enter your device location ID
  6. send datas to your device and start capturing
 

Attachments

  • weiweiwei_Teensy4_USB.json.zip
    267.5 KB · Views: 21
Back
Top