Noise with some microphones connected to the USB OTG port

Hi,
I have a problem with some USB microphones.

I’m recording audio with this pipeline:

gst-launch-1.0 -v alsasrc device=hw:1,0 ! capsfilter caps=audio/x-raw,format=S16LE,layout=interleaved,rate=48000,channels=2 ! filesink location=file.raw

When the microphone is connected to the no-OTG USB port, the audio is OK, but when the same microphone is connected to the USB OTG port (obviously configured in host mode), the audio has noise in background. I have tried also to disable the USB 3.0, but nothing changed. I’m using R21.5 release.

Can you help me?

Best regards.

Ivan

How is the microphone wired when going to the OTG port? The cable which the kit comes with is type-B, and this puts the port in device mode. Are you using the adapter from a full sized A? Is there a HUB anywhere between?

When the mic is plugged in you should see a listing with “lsusb”. There will be an “ID” column, and that will look something like “0955:7140” (that’s just an example). You can get a verbose listing of just that ID via:

sudo lsusb -d -0955:7140 -vvv

Can you post the result of this when connected to the full sized type-A port? And then, what shows up for both the full sized type-A port and the OTG port from “lsusb -t” (the “-t” gives a tree view and shows if port mode has changed).

Hi linuxdev,

at this moment I’m not testing the microphone on the Jetson TK1, but on three different boards (from different producers) and the problem is the same, so I suppose that it is not a board related problem.

Board A:
2 USB host ports type-A
1 USB OTG port type-A
1 USB OTG port type micro-A

Board B:
1 USB host ports type-A
1 USB OTG port type-A
1 USB OTG port type micro-A

Board C:
1 USB OTG port type-A

I’m not using any external USB hub.

For example, on board B:

No mic connected

lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 8087:07dc Intel Corp. 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

lsusb -t
/:  Bus 03.Port 1: Dev 1, Class=root_hub, Driver=tegra-ehci/1p, 480M
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=tegra-xhci/2p, 5000M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=tegra-xhci/6p, 480M
    |__ Port 2: Dev 3, If 0, Class=Wireless, Driver=btusb, 12M
    |__ Port 2: Dev 3, If 1, Class=Wireless, Driver=btusb, 12M

Mic plugged in USB no-OTG type-A port (audio is OK)

lsusb
Bus 002 Device 004: ID 0424:5537 Standard Microsystems Corp. 
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 008: ID 28e6:0009  
Bus 001 Device 006: ID 0424:2137 Standard Microsystems Corp. 
Bus 001 Device 003: ID 8087:07dc Intel Corp. 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

lsusb -t
/:  Bus 03.Port 1: Dev 1, Class=root_hub, Driver=tegra-ehci/1p, 480M
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=tegra-xhci/2p, 5000M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=tegra-xhci/6p, 480M
    |__ Port 2: Dev 3, If 0, Class=Wireless, Driver=btusb, 12M
    |__ Port 2: Dev 3, If 1, Class=Wireless, Driver=btusb, 12M
    |__ Port 3: Dev 6, If 0, Class=Hub, Driver=hub/7p, 480M
        |__ Port 6: Dev 8, If 0, Class=Audio, Driver=snd-usb-audio, 12M
        |__ Port 6: Dev 8, If 1, Class=Audio, Driver=snd-usb-audio, 12M
        |__ Port 6: Dev 8, If 2, Class=Audio, Driver=snd-usb-audio, 12M
        |__ Port 6: Dev 8, If 3, Class=Human Interface Device, Driver=usbhid, 12M

lsusb -d 28e6:0009 -vvv
Bus 001 Device 008: ID 28e6:0009  
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  idVendor           0x28e6 
  idProduct          0x0009 
  bcdDevice            0.03
  iManufacturer           1 Biamp Systems
  iProduct                2 Devio CR-1 USB Audio
  iSerial                 3 000000000000
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength          234
    bNumInterfaces          4
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xc0
      Self Powered
    MaxPower                0mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass         1 Audio
      bInterfaceSubClass      1 Control Device
      bInterfaceProtocol      0 
      iInterface              0 
      AudioControl Interface Descriptor:
        bLength                10
        bDescriptorType        36
        bDescriptorSubtype      1 (HEADER)
        bcdADC               1.00
        wTotalLength           72
        bInCollection           2
        baInterfaceNr( 0)       1
        baInterfaceNr( 1)       2
      AudioControl Interface Descriptor:
        bLength                12
        bDescriptorType        36
        bDescriptorSubtype      2 (INPUT_TERMINAL)
        bTerminalID             1
        wTerminalType      0x0405 Echo-canceling speakerphone
        bAssocTerminal          6
        bNrChannels             2
        wChannelConfig     0x0003
          Left Front (L)
          Right Front (R)
        iChannelNames           0 
        iTerminal               0 
      AudioControl Interface Descriptor:
        bLength                10
        bDescriptorType        36
        bDescriptorSubtype      6 (FEATURE_UNIT)
        bUnitID                 2
        bSourceID               1
        bControlSize            1
        bmaControls( 0)      0x41
          Mute Control
          Automatic Gain Control
        bmaControls( 1)      0x02
          Volume Control
        bmaControls( 2)      0x02
          Volume Control
        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 
      AudioControl Interface Descriptor:
        bLength                12
        bDescriptorType        36
        bDescriptorSubtype      2 (INPUT_TERMINAL)
        bTerminalID             4
        wTerminalType      0x0101 USB Streaming
        bAssocTerminal          0
        bNrChannels             2
        wChannelConfig     0x0003
          Left Front (L)
          Right Front (R)
        iChannelNames           0 
        iTerminal               0 
      AudioControl Interface Descriptor:
        bLength                10
        bDescriptorType        36
        bDescriptorSubtype      6 (FEATURE_UNIT)
        bUnitID                 5
        bSourceID               4
        bControlSize            1
        bmaControls( 0)      0x01
          Mute Control
        bmaControls( 1)      0x02
          Volume Control
        bmaControls( 2)      0x02
          Volume Control
        iFeature                0 
      AudioControl Interface Descriptor:
        bLength                 9
        bDescriptorType        36
        bDescriptorSubtype      3 (OUTPUT_TERMINAL)
        bTerminalID             6
        wTerminalType      0x0405 Echo-canceling speakerphone
        bAssocTerminal          1
        bSourceID               5
        iTerminal               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                  1 frames
        wFormatTag              1 PCM
      AudioStreaming Interface Descriptor:
        bLength                26
        bDescriptorType        36
        bDescriptorSubtype      2 (FORMAT_TYPE)
        bFormatType             1 (FORMAT_TYPE_I)
        bNrChannels             2
        bSubframeSize           2
        bBitResolution         16
        bSamFreqType            6 Discrete
        tSamFreq[ 0]         8000
        tSamFreq[ 1]        16000
        tSamFreq[ 2]        24000
        tSamFreq[ 3]        32000
        tSamFreq[ 4]        44100
        tSamFreq[ 5]        48000
      Endpoint Descriptor:
        bLength                 9
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            5
          Transfer Type            Isochronous
          Synch Type               Asynchronous
          Usage Type               Data
        wMaxPacketSize     0x00c8  1x 200 bytes
        bInterval               1
        bRefresh                0
        bSynchAddress           0
        AudioControl Endpoint Descriptor:
          bLength                 7
          bDescriptorType        37
          bDescriptorSubtype      1 (EP_GENERAL)
          bmAttributes         0x01
            Sampling Frequency
          bLockDelayUnits         0 Undefined
          wLockDelay              0 Undefined
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        2
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass         1 Audio
      bInterfaceSubClass      2 Streaming
      bInterfaceProtocol      0 
      iInterface              0 
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        2
      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           4
        bDelay                  3 frames
        wFormatTag              1 PCM
      AudioStreaming Interface Descriptor:
        bLength                11
        bDescriptorType        36
        bDescriptorSubtype      2 (FORMAT_TYPE)
        bFormatType             1 (FORMAT_TYPE_I)
        bNrChannels             2
        bSubframeSize           2
        bBitResolution         16
        bSamFreqType            1 Discrete
        tSamFreq[ 0]        48000
      Endpoint Descriptor:
        bLength                 9
        bDescriptorType         5
        bEndpointAddress     0x01  EP 1 OUT
        bmAttributes            9
          Transfer Type            Isochronous
          Synch Type               Adaptive
          Usage Type               Data
        wMaxPacketSize     0x00c0  1x 192 bytes
        bInterval               1
        bRefresh                0
        bSynchAddress           0
        AudioControl Endpoint Descriptor:
          bLength                 7
          bDescriptorType        37
          bDescriptorSubtype      1 (EP_GENERAL)
          bmAttributes         0x01
            Sampling Frequency
          bLockDelayUnits         1 Milliseconds
          wLockDelay              4 Milliseconds
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        3
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      0 No Subclass
      bInterfaceProtocol      0 None
      iInterface              0 
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.11
          bCountryCode            0 Not supported
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength     161
         Report Descriptors: 
           ** UNAVAILABLE **
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x84  EP 4 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0025  1x 37 bytes
        bInterval               1
Device Status:     0x0001
  Self Powered

Mic plugged in USB OTG type-A port (audio is NOT OK)

lsusb
Bus 002 Device 007: ID 0424:5537 Standard Microsystems Corp. 
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 8087:07dc Intel Corp. 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 003: ID 28e6:0009  
Bus 003 Device 002: ID 0424:2137 Standard Microsystems Corp. 
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

lsusb -t
/:  Bus 03.Port 1: Dev 1, Class=root_hub, Driver=tegra-ehci/1p, 480M
    |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/7p, 480M
        |__ Port 6: Dev 3, If 0, Class=Audio, Driver=snd-usb-audio, 12M
        |__ Port 6: Dev 3, If 1, Class=Audio, Driver=snd-usb-audio, 12M
        |__ Port 6: Dev 3, If 2, Class=Audio, Driver=snd-usb-audio, 12M
        |__ Port 6: Dev 3, If 3, Class=Human Interface Device, Driver=usbhid, 12M
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=tegra-xhci/2p, 5000M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=tegra-xhci/6p, 480M
    |__ Port 2: Dev 3, If 0, Class=Wireless, Driver=btusb, 12M
    |__ Port 2: Dev 3, If 1, Class=Wireless, Driver=btusb, 12M

lsusb -d 28e6:0009 -vvv
Bus 003 Device 003: ID 28e6:0009  
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  idVendor           0x28e6 
  idProduct          0x0009 
  bcdDevice            0.03
  iManufacturer           1 Biamp Systems
  iProduct                2 Devio CR-1 USB Audio
  iSerial                 3 000000000000
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength          234
    bNumInterfaces          4
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xc0
      Self Powered
    MaxPower                0mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass         1 Audio
      bInterfaceSubClass      1 Control Device
      bInterfaceProtocol      0 
      iInterface              0 
      AudioControl Interface Descriptor:
        bLength                10
        bDescriptorType        36
        bDescriptorSubtype      1 (HEADER)
        bcdADC               1.00
        wTotalLength           72
        bInCollection           2
        baInterfaceNr( 0)       1
        baInterfaceNr( 1)       2
      AudioControl Interface Descriptor:
        bLength                12
        bDescriptorType        36
        bDescriptorSubtype      2 (INPUT_TERMINAL)
        bTerminalID             1
        wTerminalType      0x0405 Echo-canceling speakerphone
        bAssocTerminal          6
        bNrChannels             2
        wChannelConfig     0x0003
          Left Front (L)
          Right Front (R)
        iChannelNames           0 
        iTerminal               0 
      AudioControl Interface Descriptor:
        bLength                10
        bDescriptorType        36
        bDescriptorSubtype      6 (FEATURE_UNIT)
        bUnitID                 2
        bSourceID               1
        bControlSize            1
        bmaControls( 0)      0x41
          Mute Control
          Automatic Gain Control
        bmaControls( 1)      0x02
          Volume Control
        bmaControls( 2)      0x02
          Volume Control
        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 
      AudioControl Interface Descriptor:
        bLength                12
        bDescriptorType        36
        bDescriptorSubtype      2 (INPUT_TERMINAL)
        bTerminalID             4
        wTerminalType      0x0101 USB Streaming
        bAssocTerminal          0
        bNrChannels             2
        wChannelConfig     0x0003
          Left Front (L)
          Right Front (R)
        iChannelNames           0 
        iTerminal               0 
      AudioControl Interface Descriptor:
        bLength                10
        bDescriptorType        36
        bDescriptorSubtype      6 (FEATURE_UNIT)
        bUnitID                 5
        bSourceID               4
        bControlSize            1
        bmaControls( 0)      0x01
          Mute Control
        bmaControls( 1)      0x02
          Volume Control
        bmaControls( 2)      0x02
          Volume Control
        iFeature                0 
      AudioControl Interface Descriptor:
        bLength                 9
        bDescriptorType        36
        bDescriptorSubtype      3 (OUTPUT_TERMINAL)
        bTerminalID             6
        wTerminalType      0x0405 Echo-canceling speakerphone
        bAssocTerminal          1
        bSourceID               5
        iTerminal               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                  1 frames
        wFormatTag              1 PCM
      AudioStreaming Interface Descriptor:
        bLength                26
        bDescriptorType        36
        bDescriptorSubtype      2 (FORMAT_TYPE)
        bFormatType             1 (FORMAT_TYPE_I)
        bNrChannels             2
        bSubframeSize           2
        bBitResolution         16
        bSamFreqType            6 Discrete
        tSamFreq[ 0]         8000
        tSamFreq[ 1]        16000
        tSamFreq[ 2]        24000
        tSamFreq[ 3]        32000
        tSamFreq[ 4]        44100
        tSamFreq[ 5]        48000
      Endpoint Descriptor:
        bLength                 9
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            5
          Transfer Type            Isochronous
          Synch Type               Asynchronous
          Usage Type               Data
        wMaxPacketSize     0x00c8  1x 200 bytes
        bInterval               1
        bRefresh                0
        bSynchAddress           0
        AudioControl Endpoint Descriptor:
          bLength                 7
          bDescriptorType        37
          bDescriptorSubtype      1 (EP_GENERAL)
          bmAttributes         0x01
            Sampling Frequency
          bLockDelayUnits         0 Undefined
          wLockDelay              0 Undefined
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        2
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass         1 Audio
      bInterfaceSubClass      2 Streaming
      bInterfaceProtocol      0 
      iInterface              0 
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        2
      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           4
        bDelay                  3 frames
        wFormatTag              1 PCM
      AudioStreaming Interface Descriptor:
        bLength                11
        bDescriptorType        36
        bDescriptorSubtype      2 (FORMAT_TYPE)
        bFormatType             1 (FORMAT_TYPE_I)
        bNrChannels             2
        bSubframeSize           2
        bBitResolution         16
        bSamFreqType            1 Discrete
        tSamFreq[ 0]        48000
      Endpoint Descriptor:
        bLength                 9
        bDescriptorType         5
        bEndpointAddress     0x01  EP 1 OUT
        bmAttributes            9
          Transfer Type            Isochronous
          Synch Type               Adaptive
          Usage Type               Data
        wMaxPacketSize     0x00c0  1x 192 bytes
        bInterval               1
        bRefresh                0
        bSynchAddress           0
        AudioControl Endpoint Descriptor:
          bLength                 7
          bDescriptorType        37
          bDescriptorSubtype      1 (EP_GENERAL)
          bmAttributes         0x01
            Sampling Frequency
          bLockDelayUnits         1 Milliseconds
          wLockDelay              4 Milliseconds
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        3
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      0 No Subclass
      bInterfaceProtocol      0 None
      iInterface              0 
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.11
          bCountryCode            0 Not supported
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength     161
         Report Descriptors: 
           ** UNAVAILABLE **
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x84  EP 4 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0025  1x 37 bytes
        bInterval               1
Device Status:     0x0001
  Self Powered

Thank you, best regards.

Ivan

Since the issue follows the mic it is probably the mic causing this, but I am still curious. Is the microphone the Intel item (ID 8087:07dc)? Also, I see some sort of bluetooth wireless…is this related to the mic? Also, is the noise white noise or is it more “digital” where pieces go missing? Is there a specific model number on the mic?

Hi linuxdev,
note also that the mic works perfectly on other PC systems (Windows, Mac and Linux).

The microphone is the “Devio CR-1 USB Audio” device (ID 28e6:0009). Yes, the bluetooth is related to the same system, but I’m not using it. The noise is something like a “scratching” noise in background. I think I had the same issue with another mic, but I don’t remember the exact model number. It is strange that the noise appears only with the OTG port, on the no-OTG ports the mic works perfectly.

Thank you, best regards.

Ivan

Is the device self-powered? Or does it get power from the USB port?

I think that the device is self-powered (I can read it also in the lsusb -d 28e6:0009 -vvv status) and the same issue appears also when I connect it through an external self-powered USB hub.

The noise is something like scratching/crackling noise.

Thank you.

Ivan

You may describe further how you connect to microUSB, I suppose you have an adapter. If you can try another one it would be good to know.

The noise you describe makes me wonder if you may have a bad(poor) contact for ground or power. This might be enough for powering the digital part thanks to capacitors (so it answers to lsusb), but this may affect the analog part recording before the ADC. This is pure speculation, however, it might also be a driver/software problem.

Hi Honey_Patouceul,

the problem appears also with mic connected to the full size type-A USB OTG port so I don’t think it is related to the microUSB adapter.

Thank you.

Ivan

Sorry I haven’t correctly understood your case. For ruling it out, have you tried another microphone ?

Yes,
I have also a no-self-powered mic, and with this, on the OTG port, the audio si ok. Anyway I have to understand why with the Devio CR-1 mic (and, if I remember correctly, also with another self-powered mic I have tested a while ago) there is noise if I use the OTG port.

Thank you.

Ivan

If anyone is interested I found this data sheet on the device:
[url]http://cdn.biamp.com/software/docs/default-source/downloads/biamp_data_sheet_devio_cr-t1_cr-c1_feb_17_en-us.pdf?sfvrsn=0[/url]

I see it is a self-powered device, and not actually just a microphone. Meaning the microphone does not pass directly to the TK1, instead it does processing (echo cancellation), and then sends this to the Jetson.

For terminology there is no full-sized type-A OTG…they don’t exist. It is just a type-A for the full-sized port (something like a printer would have a full-sized type-B port…a printer is a device, so is a microphone). The OTG applies to the micro port because there is a detect pin which tells the system if a micro-A or a micro-B is connected…when type-A the port expects a device, e.g., a microphone; when type-B, the Jetson itself becomes a device for another host to use (but what it becomes has to be programmed). In all cases, even with the micro-OTG port, the connector from your device has to use a type-A cable. A micro-A is a type-A…the cable which comes with the system for flashing is a micro-B and wouldn’t work for the microphone…this is why there was a question from @Honey_Patouceul about an adapter from full-sized to micro. I am also wondering what cable adapter you used? Or was it a dedicated type-A micro cable? If it was a type-B, then it couldn’t work.

Note that your device has a front panel connector on the far left side which is a full-sized type-B connector, and that somehow this has to connect to a host’s USB port. Very likely the device came with a cable for going to a full-sized port, but did this mic come with a cable to go from that port on the front left to the micro-A port of the Jetson?

Hi linuxdev,

thank you for the explanation. Sorry, maybe I’m a bit confused with the terminology and what OTG is. I thought OTG only means that a port can be configured as a host or as a device, independently of the connector type, and that, with the micro-AB connectors, you can automatically put the port in host/device mode. Furthermore, I as understand, the K1 doesn’t have this automatism implemented in the drivers and so you have to configure the port type with software “/sys/devices/platform/tegra-otg/enable_host”, “/sys/devices/platform/tegra-otg/enable_device” (those settings are by default “1” for “enable_host” and “0” for “enable_device”).

Anyway, as I said, I’m not using the Jetson TK1, but three different K1 based boards, from three different producers. I will re-explain the boards connectors:

Board A:
2 USB full size Type-A “host-only” ports
1 USB full size Type-A port that can be host or device (through this port I can also reflash the system with usb recovery mode)
1 USB micro AB Type port that can be host or device (through this port I can also reflash the system with usb recovery mode)

Board B:
1 USB full size Type-A “host-only” port
1 USB full size Type-A port that can be host or device (through this port I can also reflash the system with usb recovery mode)
1 USB micro AB Type port that can be host or device (through this port I can also reflash the system with usb recovery mode)

Board C:
1 USB full size Type-A port that can be host or device (through this port I can also reflash the system with usb recovery mode)

I think that the USB full size Type-A ports that can be host or device consisting of the K1 USB0_X OTG capable port pins and the K1 USB3_X USB 3.0 port pins, but I’m not sure of this.

On all the three boards, if I connect the mic to the “host-only” ports (not available for Board C), the audio is OK. If I connect the mic to the ports that can be host or device, the audio is bad, independently if I use an adapter to connect the mic to the micro USB port (I used the white adapter I have found in the Jetson TX1 Developer Kit, the DEVIO CR-1 has no cables to go to a micro-A port) or I connect the mic directly to the full-size Type-A ports.

Can I suppose that the noise appears when the mic is connected to the K1 USB0_X port and/or is maybe related to the tegra-ehci driver?

Thank you.

Ivan

FYI, OTG is actually two receptacles in one. There is no such thing as an OTG cable. Cables advertising OTG typically are just type-B and can be used for charging and/or device mode, e.g., a smart phone acting as bulk storage. There are also type-A cables (and more often adapters) to turn a type-B into a type-A in the case of a micro-OTG connector.

On all boards (without any exception) there would have to be a violation of USB specs to use the full size Type-A port for recovery mode or to act as device mode (type-A is defined only for host mode). Basically you would need a custom cable which can connect a type-A to another type-A. Only an A-to-B connection would be without risk of hardware damage (nobody makes a type-A to type-A adapter for good reason). Whatever cable is used on this type-A port in recovery mode would be a risk if ever plugged in between a regular host and that port. Is there a special cable for this? If the microphone used this, then odd wiring could cause noise.

Having wiring which routes to the type-A, but which is never configured as device is ok. Once type-A connectors are wired they should never ever be used as device (an OTG connector has extra pins…thus the ID detect pin can be used to automatically change the definition of the port as type-A or type-B).

It sounds like the current issue is one of a wiring error…not your microphone, and not the SoC, but of the board which put device mode on a type-A host-only port. Only custom wiring could do this, and the port would not be useful for switching back and forth between modes the way an OTG port does with its detect pin.

Hi linuxdev,
I don’t think that nobody makes a type-A to type-A adapter:

https://www.amazon.com/Cable-Cord-Besgoods-2-Pack-Braided/dp/B075CXZ7L3/
https://www.walmart.com/c/kp/male-to-male-usb-cables

I use one of this for flashing the boards in USB recovery mode through the full-size type-A port.

Anyway, when I connect the mic, I don’t use any special cable, but a usual full-sized type-B to type-A cable: https://images-na.ssl-images-amazon.com/images/I/41RInB4E1nL._SX466_.jpg .

To understand the problem, do you think that the connection should be ok, and so without noise, if I connect the Devio CR-1 front-panel full-sized type-B port using this cable: https://images-na.ssl-images-amazon.com/images/I/41RInB4E1nL._SX466_.jpg connected to the Jeston TK1 micro USB type-AB port through this type of adapter: https://gloimg.gbtcdn.com/soa/gb/pdm-product-pic/Electronic/2017/10/16/goods_img_big-v1/20171016163610_87143.jpg ? (obviously with the TK1 OTG port configured as host)

Thank you, best regards.

Ivan

The only possible use of those type-A to type-A cables is if there is also a type-B to type-B adapter such that in the end it is type-A to type-B (a case where two wrongs do make a right because in the end you get a type-A to type-B). In any other use the cables are not valid. I’m reminded of a comedy listing of engineer versions of Murphy’s Law (variations on “if anything can go wrong, it will”). There is a picture of an adapter bolt with the end away from the bolt head being larger diameter than the end next to the bolt in order to fit odd size holes. These cables should be on that list if not sold with type-B to type-B adapters to fix the invalid wiring. There is a twist here though, those are USB3 cables. There might be some special cases where adapting to type-C changes things, but type-A and type-B concepts disappear in type-C (the two systems still know what is connected, but there is extra wiring…there is still a host and still a device).

Note: The TK1 dev kit uses USB3 on a backwards compatible type-A port for the full-sized case, not a type-C. Extra wires add bandwidth ability, but it is still type-A. The micro port has no ability to run at USB3 speeds, nor does it have any wiring to take advantage of any USB3 cable. Perhaps differences in boards you use versus the TK1 dev board are part of the confusion.

The cable you show as type-A to type-B is perfect. Often people don’t like how large the connector is, but they happen to be more sturdy than a micro connector, and are popular on larger equipment like printers. The the less common more “squarish” end is type-B and is the full sized equivalent to the micro-B USB cable used to flash the Jetson on dev carrier boards.

The cable you ask about is type-A to type-B (full sized). This cable should do a good job (assumes the type-B end goes to the microphone since the microphone is the device…and I happen to see a full-sized type-B intended for that purpose on the picture of the front of the device). The adapter which goes from full-sized to micro does not show the micro end close enough to say if this is a type-A or type-B at that end. If it is type-B, and if the type-B goes to the microphone, then it will work; if it is a type-A, and the type-A goes to the host Jetson, then it will work. The converse, where the type-B goes to the Jetson or the type-A goes to the microphone will not work if the device is the microphone.

There are many adapters from full-sized to micro which the micro end might be either type-A or type-B…this is because the OTG port can accept either (although the port function can be only one of device or host depending on the type connected at any particular time).

From wikipedia on USB, here is an image of the more “square” type-A micro:
[url]https://en.wikipedia.org/wiki/File:USB_Micro-A.svg[/url]
…here is an image of the type-B micro with beveled edges on two of the four edges when viewed straight on:
[url]USB - Wikipedia

Is your micro adapter type-A (square) or type-B (beveled)? Does the micro end connect to the Jetson or to the microphone?

Hi linuxdev,

yes, the type-B part of the type-A to type-B full sized cable goes to the microphone. I checked the adapter that goes from full-sized to micro and it is type-A (the micro connector is the more “square” one: File:USB Micro-A.svg - Wikipedia ). I connect the micro part of this adapter to the K1 board. So I suppose the connection with those cables is ok, right?

Anyway, I have noise also with this connection, both on Board A and Board B.

Thank you.

Ivan

Correct, that connection should be ok. This is the adapter means it is type-A at host and type-B at microphone. Sometimes the quality of the micro-to-full adapters is suspect, but you said you have another microphone which works without noise on that location. Do both microphones use the same adapter and cables (other than any cable which is built in to the actual microphone)?

If one microphone works without noise and the other one does have noise, I tend to lean towards what @Honey_Patouceul was suggesting…a ground issue. Especially since one microphone is USB powered and the other uses external power. A lack of ground in some part of the system is one possibility, but a ground loop is a bit more hideous and difficult to fix or detect. A poor quality cable or adapter can provide poor grounding and noise. Barring bad grounding from poor cable quality, then a ground loop is more likely. See:
[url]https://en.wikipedia.org/wiki/Ground_loop_(electricity)[/url]
…especially this part:
[url]Ground loop (electricity) - Wikipedia

One way to test this if you are so motivated would be to power the “Devio CR-1 USB Audio” from a battery source. I realize you probably don’t have a battery around of the right spec, but it is a thought if you want to test further.

Incidentally, if such a ground loop is the cause, then I’d wonder if a power supply is doing this, or if perhaps the local wiring ground is not correct. You can buy inexpensive ground test plug-in tools at the hardware store for basic wiring test, but they won’t tell you if one of the grounds is old and corroded or oxidized. This is an example, you can get these almost anywhere:
[url]Amazon.com

Hi linuxdev,
I noticed something strange that maybe can help to understand the problem.

The Devio CR-1 mic it is a full-speed device (you can see it lsusb -t output) and it supports 8000, 16000, 24000, 32000, 44100 and 48000 rates:

cat /proc/asound/card1/stream0:
Biamp Systems Devio CR-1 USB Audio at usb-tegra-ehci.0-1.6, full speed : USB Audio
Capture:
  Status: Stop
  Interface 1
    Altset 1
    Format: S16_LE
    Channels: 2
    Endpoint: 1 IN (ASYNC)
    Rates: 8000, 16000, 24000, 32000, 44100, 48000

When I capture connected on “tegra-ehci” with a rate >= 44100 then I have noise. But when I capture on “tegra-ehci” with a lower rate (for example 32000) the audio is OK without noise. When I capture connected on “tegra-xhci” the audio is always OK without noise, also with the 44100 and 48000 rates.

I have another full-speed mic that supports only 48000 and this works correctly with 48000 rate, both on “tegra-ehci” and “tegra-xhci”. The only difference with the Devio is in “Endpoint” value:

cat /proc/asound/card1/stream0 
Polycom,Inc. Polycom CX100 at usb-tegra-ehci.0-1, full speed : USB Audio
Capture:
  Status: Stop
  Interface 1
    Altset 1
    Format: S16_LE
    Channels: 2
    Endpoint: 2 IN (SYNC)
    Rates: 48000

Maybe this can help?

Thank you.

Ivan

Sample rates and differences in how samples are interpreted can indeed cause such noise, but I don’t know enough about it to say if this particular difference would be an issue. Certainly interference from outside noise (such as a ground loop) can be dependent upon sample rate, but the “Endpoint” difference is suspicious.

Does anyone know if the “Endpoint: 1” versus “Endpoint: 2” will cause the same effect as noise?