Issues with MIMXRT1060-EVK and usb_device_audio_generator example...

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Issues with MIMXRT1060-EVK and usb_device_audio_generator example...

849 Views
EdSutter
Senior Contributor II

Hi,

I've been using an MIMXRT1060-EVK for a month or so now just getting comfortable with the processor and features.  Now I'm getting more application specific (my project is usb audio), so I'm headed down the USB rabbit hole.

I install and run the usb_device_audio_generator example, and while it does work, I see what seems to be some strange output from "lsusb" on Linux (I'm using a raspberry pi4 at the moment)...

Here's what I do...

1. First I run "arecord -l" on my Linux host to see/verify no audio devices:

pi@homepi401: arecord -l
**** List of CAPTURE Hardware Devices ****

2. Run the usb_device_audio_generator application on my MIMXRT1060-EVK.

3. Plug the EVK into my host, and run "arecord -l" again and now see the device:

pi@homepi401:arecord -l
**** List of CAPTURE Hardware Devices ****
card 2: DEMO [USB AUDIO DEMO], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0

At this point I can run an alsa program I wrote that will pull the stream out of the device and play it out a USB speaker (another USB device on that Linux box).  The audio is strange, so I built my own stream and inserted it into the example just to make sure I was streaming something real.  I had to create audio in 8-bit samples and 8kHz sampling rate, but ignoring that, things worked ok... I could hear the audio I created (I updated the wavData[] array in audio_data.c) coming out of the EVK.  

Next step is to decipher the descriptors.  Being new to USB at this level, this is apparently not a trivial task.  I use the "lsusb" tool on Linux to read them out, and this is where my confusion starts...

The first few lines of the response from "lsusb --verbose -d1fc9:0097" are:

Bus 001 Device 019: ID 1fc9:0097 NXP Semiconductors
Couldn't open device, some information will be missing

 and after that is what appears to be the full descriptor tree for the usb_device_audio_generator example: 

pi@homepi401:lsusb --verbose -d1fc9:0097

Bus 001 Device 022: ID 1fc9:0097 NXP Semiconductors
Couldn't open device, some information will be missing
Device Descriptor:
   bLength 18
   bDescriptorType 1
   bcdUSB 2.00
   bDeviceClass 0
   bDeviceSubClass 0
   bDeviceProtocol 0
   bMaxPacketSize0 64
   idVendor 0x1fc9 NXP Semiconductors
   idProduct 0x0097
   bcdDevice 1.01
   iManufacturer 1
   iProduct 2
   iSerial 0
   bNumConfigurations 1
   Configuration Descriptor:
      bLength 9
      bDescriptorType 2
      wTotalLength 0x0076
      bNumInterfaces 2
      bConfigurationValue 1
      iConfiguration 0
      bmAttributes 0xc0
         Self Powered
      MaxPower 100mA
      Interface Descriptor:
         bLength 9
         bDescriptorType 4
         bInterfaceNumber 0
         bAlternateSetting 0
         bNumEndpoints 1
         bInterfaceClass 1 Audio
         bInterfaceSubClass 1 Control Device
         bInterfaceProtocol 0
         iInterface 0
         AudioControl Interface Descriptor:
            bLength 9
            bDescriptorType 36
            bDescriptorSubtype 1 (HEADER)
            bcdADC 1.00
            wTotalLength 0x0027
            bInCollection 1
            baInterfaceNr(0) 1
         AudioControl Interface Descriptor:
            bLength 12
            bDescriptorType 36
            bDescriptorSubtype 2 (INPUT_TERMINAL)
            bTerminalID 1
            wTerminalType 0x0201 Microphone
            bAssocTerminal 0
            bNrChannels 1
            wChannelConfig 0x0000
            iChannelNames 0
            iTerminal 0
         AudioControl Interface Descriptor:
            bLength 9
            bDescriptorType 36
            bDescriptorSubtype 6 (FEATURE_UNIT)
            bUnitID 2
            bSourceID 1
            bControlSize 1
            bmaControls(0) 0x03
               Mute Control
               Volume Control
            bmaControls(1) 0x00
            iFeature 0
         AudioControl Interface Descriptor:
            bLength 9
            bDescriptorType 36
            bDescriptorSubtype 3 (OUTPUT_TERMINAL)
            bTerminalID 3
            wTerminalType 0x0101 USB Streaming
            bAssocTerminal 0
            bSourceID 2
            iTerminal 0
         Endpoint Descriptor:
            bLength 9
            bDescriptorType 5
            bEndpointAddress 0x81 EP 1 IN
            bmAttributes 3
               Transfer Type Interrupt
               Synch Type None
               Usage Type Data
            wMaxPacketSize 0x0008 1x 8 bytes
            bInterval 4
            bRefresh 0
            bSynchAddress 0
      Interface Descriptor:
         bLength 9
         bDescriptorType 4
         bInterfaceNumber 1
         bAlternateSetting 0
         bNumEndpoints 0
         bInterfaceClass 1 Audio
         bInterfaceSubClass 2 Streaming
         bInterfaceProtocol 0
         iInterface 0
      Interface Descriptor:
         bLength 9
         bDescriptorType 4
         bInterfaceNumber 1
         bAlternateSetting 1
         bNumEndpoints 1
         bInterfaceClass 1 Audio
         bInterfaceSubClass 2 Streaming
         bInterfaceProtocol 0
         iInterface 0
         AudioStreaming Interface Descriptor:
            bLength 7
            bDescriptorType 36
            bDescriptorSubtype 1 (AS_GENERAL)
            bTerminalLink 3
            bDelay 0 frames
            wFormatTag 0x0002 PCM8
         AudioStreaming Interface Descriptor:
            bLength 11
            bDescriptorType 36
            bDescriptorSubtype 2 (FORMAT_TYPE)
            bFormatType 1 (FORMAT_TYPE_I)
            bNrChannels 1
            bSubframeSize 1
            bBitResolution 8
            bSamFreqType 1 Discrete
            tSamFreq[ 0] 8000
         Endpoint Descriptor:
            bLength 9
            bDescriptorType 5
            bEndpointAddress 0x82 EP 2 IN
            bmAttributes 1
               Transfer Type Isochronous
               Synch Type None
               Usage Type Data
            wMaxPacketSize 0x0008 1x 8 bytes
            bInterval 4
            bRefresh 0
            bSynchAddress 0
            AudioStreaming Endpoint Descriptor:
               bLength 7
               bDescriptorType 37
               bDescriptorSubtype 1 (EP_GENERAL)
               bmAttributes 0x00
               bLockDelayUnits 0 Undefined
               wLockDelay 0x0000

There are a few immediate questions (probably more to come)...

1. What does the early message (Couldn't open device, some information will be missing) mean?

2. Why is it "Self-powered" when I have it running off VBUS?

3. How well designed is this Descriptor tree?  Is this typical?

Any thoughts would be appreciated.

Labels (1)
Tags (1)
0 Kudos
3 Replies

709 Views
EdSutter
Senior Contributor II

Ok, I've since found out that 'sudo' is needed to eliminate the

Couldn't open device, some information will be missing

error, but it just generates a different error at the end of the output...

can't get device qualifier: Resource temporarily unavailable
can't get debug descriptor: Resource temporarily unavailable
Device Status: 0x0001
Self Powered

0 Kudos

709 Views
Hui_Ma
NXP TechSupport
NXP TechSupport

Hello,

First of all, sorry for the later reply.

I checked you posted another thread about <Multi-channel audio over USB anyone?>, which showed usb_device_audio_generator example on the MIMXRT1060-EVK works on your site.

If that means you had fixed this thread mentioned issue? 

Please let us know if you have any updated questions. Thanks.


Have a great day,
Mike

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos

709 Views
EdSutter
Senior Contributor II

Mike, 

Thanks for the reply... 

Yes, the basic audio-generator is running (as I stated in the first post), the discussion was intended for a better understanding of the application beyond just "it's working".  There are portions of the descriptor that I don't understand

and have not been able to figure out.  For example...

  • Since my end goal is multi-channel, I was trying  different wTerminalType  values, but it seems to not matter... Microphone works fine with a multi-channel configuration, and MicArray works fine with a single channel setup.
  • The configuration descriptor's bmAttributes show "Self-powered" but this board is running off the VBUS power.
  • There's an "Output-Terminal" type descriptor by my device is a microphone.. Is that needed?
  • etc...

I guess these are more generic to USB, so may be better suited for some other forum outside of iMXRT-specific forum.

I'll go ahead and mark this to be "answered"..

0 Kudos