Audio + Joystick on Teensy 3.2?

Fletcher

Member
I'm building a device that will adapt a surplus military radio headset for use with a PC simulator. The headset has mono audio, a microphone, and a two-position push-to-talk switch. I am already using an old Teensy 3.0 to output the state of the PTT switch as two joystick buttons, and it just occurred to me to check if the newer Teensy + audio shield could do live audio I/O -- looks like Paul's working on this!

So my question is: Is it plausible to create a custom USB descriptor for the Teensy such that a single board can provide both audio I/O (1ch in, 1ch out) and game controller USB endpoints simultaneously?

This would let me run the whole kit off a single USB connection, which would be great for simplicity -- my original plan was to stuff a small USB hub inside the box, and hack up a USB sound card to my headphone and mic amp circuits.
 
So my question is: Is it plausible to create a custom USB descriptor for the Teensy such that a single board can provide both audio I/O (1ch in, 1ch out) and game controller USB endpoints simultaneously?

Yes, very do-able.

You'll need to edit usb_desc.h to define your own. The main issue is assigning unique interface numbers and unique endpoint numbers, and getting the endpoint defs to match the numbers you assigned to each interface.
 
Yes, very do-able.

You'll need to edit usb_desc.h to define your own. The main issue is assigning unique interface numbers and unique endpoint numbers, and getting the endpoint defs to match the numbers you assigned to each interface.

Thank you for the pointer to the relevant files, Paul -- I set this up yesterday and my device is now successfully interfaced!

Just a note: The "Audio + MIDI + Serial" profile in Teensyduino 1.6.9 beta 2 and beta 3 isn't working for me on Win 7 Enterprise (but seems to work fine on Win 10 Pro). I get 4 teensy multimedia devices, 3 of which fail to initialize with Code 10. The "Audio" profile works fine, and my hacked up "audio + joystick" profile also works fine (I just added a joystick interface/endpoint to the end of the audio-only profile.
 
So far it seems like my test setup connected to a personal machine (Win 10 pro) works and a nearly identical firmware on nearly identical hardware at work (win 7 enterprise, win 8.1 enterprise, win 10 enterprise) exhibits this behaviour. If I had a spare teensy/audio board I could test virgin hardware that I'm sure is good on all these different OSes using the USBPassthrough example sketch with the "Audio" and "Audio + MIDI + Serial" profiles. Don't have any hardware handy, but I'm digging the Audio board, so will probably order another set to experiment more with outside this project. I'll let you know when I have a chance to run these experiments.
 
I've managed to reproduce this issue with Windows 10. Or at least I think I have. Here's what I'm seeing in the device manager:

Capture.PNG
 
Ok, I believe I've fixed it. :)

https://github.com/PaulStoffregen/cores/commit/b5fb899b0248833f7a30493a20b3e3c4104e48bb

It's showing up properly in the device manager now.

Capture.PNG

I'm listening to it play USB audio through a Teensy 3.6 and audio shield, and stuff is printing on COM9 in the serial monitor. I don't have any MIDI software set up on this machine, so I'm not able to test all 3 at this time.

Also tried with "All of the Above", which is playing and printing. But again, not using the many other interfaces at the same time. Can't even imagine how I'd set up such a crazy test!
 
Ok, I believe I've fixed it. :)

https://github.com/PaulStoffregen/cores/commit/b5fb899b0248833f7a30493a20b3e3c4104e48bb

It's showing up properly in the device manager now.

View attachment 8675

I'm listening to it play USB audio through a Teensy 3.6 and audio shield, and stuff is printing on COM9 in the serial monitor. I don't have any MIDI software set up on this machine, so I'm not able to test all 3 at this time.

Also tried with "All of the Above", which is playing and printing. But again, not using the many other interfaces at the same time. Can't even imagine how I'd set up such a crazy test!

I have a similar problem now by may 2023.
 
Back
Top