4CH IN - 4CH OUT USB Soundcard on teensy 4.1

Status
Not open for further replies.

VP.dplns

Member
Hi everyone,
I'll start my project to programming the teensy 4.1 to be apearing as a 4ch sound card.
Before starting I wanted to know if anyone achieved to transform any teensy on 4ch soundcard or have any advice to achieve that.
I checked the teensy's code and I think I'll start to look on the usb_audio.cpp or maybe usb_desc.c and usb_desc.h files.
If someone have any clues it'll be welcomed.

In the future the teensy will be connected to a codec and will exchange TDM signals.

Let me know if you have anything.

Best regards
 
Hi Paul,
Thank you for this link it defenitely have some good info inside.
But he didn't share the code he develloped right ?

By the way, 8in8o is a little bit much for me because I want to keep space for other datas like sensors.
So i'll go with 4I4O, I'll post messages of my progression.
 
Hi Paul,
I read all the USB device Class definition for audio device and I found something that I don't understand concerning the usb_desc.c file.
In the #ifdef AUDIO_INTERFACE section, when the Standard AS Interface Descriptor is decribed for the INTERFACE 3 (Received from PC)
:
Code:
// Standard AS Interface Descriptor
	// USB DCD for Audio Devices 1.0, Section 4.5.1, Table 4-18, page 59
	// Alternate 0: default setting, disabled zero bandwidth
	9,					// bLenght
	4,					// bDescriptorType = INTERFACE
	AUDIO_INTERFACE+2,			// bInterfaceNumber
	0,					// bAlternateSetting
	0,					// bNumEndpoints
	1,					// bInterfaceClass, 1 = AUDIO
	2,					// bInterfaceSubclass, 2 = AUDIO_STREAMING
	0,					// bInterfaceProtocol
	0,					// iInterface
	// Alternate 1: streaming data
	9,					// bLenght
	4,					// bDescriptorType = INTERFACE
	AUDIO_INTERFACE+2,			// bInterfaceNumber
	1,					// bAlternateSetting
	2,					// bNumEndpoints
	1,					// bInterfaceClass, 1 = AUDIO
	2,					// bInterfaceSubclass, 2 = AUDIO_STREAMING
	0,					// bInterfaceProtocol
	0,					// iInterface

It's indicated that the interface in Alternate 1 is using 2 endpoints I don't undestand why.
Can you explain it to me ?
I can't see why there are 2 endpoint associated to that interface (Received from PC) and only 1 in the interface 2 (Transmit to the PC).

Thank you.
 
I also have a question concerning the version of the USB used.
In the Class-specific AC Interface Header Descriptor :
Code:
	// Class-specific AC Interface Header Descriptor
	// USB DCD for Audio Devices 1.0, Table 4-2, page 37-38
	10,					// bLength
	0x24,					// bDescriptorType, 0x24 = CS_INTERFACE
	0x01,					// bDescriptorSubtype, 1 = HEADER
	0x00, 0x01,				// bcdADC (version 1.0)
	LSB(62), MSB(62),			// wTotalLength
	2,					// bInCollection
	AUDIO_INTERFACE+1,			// baInterfaceNr(1) - Transmit to PC
	AUDIO_INTERFACE+2,			// baInterfaceNr(2) - Receive from PC
It's indicated that the rev 1.0 of the USB specification is used, does it means the teensy 4.1 is using the USB1.0 standart so the max speed is 12 Mbit/s in Full speed mode ?
If we want to reach the 480 Mbit/s of the USB 2 do we have to change the bcdADC to 2.0 and follow the new document rev2 of the USB device Class definition for audio device ?

Thanks again.
 
It's indicated that the rev 1.0 of the USB specification is used, does it means the teensy 4.1 is using the USB1.0 standart so the max speed is 12 Mbit/s in Full speed mode ?

No. It is audio class 1.0, specifically this document:

https://www.usb.org/sites/default/files/audio10.pdf


I read all the USB device Class definition for audio device

Really?


It's indicated that the interface in Alternate 1 is using 2 endpoints I don't undestand why.
Can you explain it to me ? I can't see why there are 2 endpoint associated to that interface (Received from PC) and only 1 in the interface 2 (Transmit to the PC).

We are using asynchronous mode, described in 3.3.1 on page 19.

See 3.7.2.2 "Isochronous Synch Endpoint" on page 32 and 4.6.2.1 "Standard AS Isochronous Synch Endpoint Descriptor" on page 63-64.. Also in the USB 2.0 spec, read 5.12.4.2 "Feedback" starting on page 73.

The extra endpoint transmits explicit asynchronous rate feedback to the host. In this mode, the host is responsible for adjusting its transmit rate to match the device's requirements.
 
Thank you for your answers Frank B and Paul.
No. It is audio class 1.0, specifically this document:

https://www.usb.org/sites/default/files/audio10.pdf

So what are the difference beetween those :
http://dl.project-voodoo.org/usb-audio-spec/USB Audio v2.0/Audio20 final.pdf
https://www.usb.org/document-library/usb-audio-devices-rev-30-and-adopters-agreement


Yes, I'm trying to understand every line of the usb_desc.c for the audio part.

Doc USB photo.jpg

We are using asynchronous mode, described in 3.3.1 on page 19.

See 3.7.2.2 "Isochronous Synch Endpoint" on page 32 and 4.6.2.1 "Standard AS Isochronous Synch Endpoint Descriptor" on page 63-64.. Also in the USB 2.0 spec, read 5.12.4.2 "Feedback" starting on page 73.

The extra endpoint transmits explicit asynchronous rate feedback to the host. In this mode, the host is responsible for adjusting its transmit rate to match the device's requirements.

Wow thank you very much for those informations. I'll check these specifical parts.
 
Hi everyone,
I have another question about the Maximum packet size.
I don't understand how to choose the bMaxPacketSize0 (equal to 64 bytes?) and wMaxPacketSize (equal to 180 bytes?).
In the doc they say it determined by the audio bandwith constraints but I don't see the relation.
I didn't find that much info on the doc about that.
Does somebody have any clues on that ?
Thank you
 
Status
Not open for further replies.
Back
Top