This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux/Am5728: How to test UAC function with windows PC?

Part Number: AM5728

Tool/software: Linux

Hi,

I have inserted gadget module(g_audio, f_uac1, libcomposite) in AM527x board and connected usb device between AM572x(micro usb) and Windows PC.

How to the test the UAC functionality(playback and record) in windows machine?

Regards,

Mukesh kumar

  • Hi Mukesh,

       As a first step, check if the sound card is detected on the windows PC in device manager.

    You can use audacity tool in windows to test the UAC functionality.

      Can you please let us know, which kernel version are you using?

  • Hi Sai Prasad,
    Current kernel Version I am using is 4.9.2.8(ti-processor-sdk-linux-am57xx-evm-04.00.00.04-Linux-x86-Install.bin) which I downloaded from
    software-dl.ti.com/.../index_FDS.html.

    Sound card is getting detected in windows PC when I insert the gadget module in AM572x but I am not able to test the UAC functionality in Audacity. When I start recording in audacity(with sound card detected) , I am not getting any waves(sine) in audacity and also set alt is not received in gadget(AM572x). Getting Enpoint STALLED Error in usb analyzer.

  • Hi Mukesh,

    Are you able to play the audio using audacity ? Can you also check if you are able to record the audio from AM572x using arecord.
    Please share the complete dmesg logs while recording(including boot logs).
  • Following are the observation on testing default usb audio gadget driver in AM572x for linux 4.9.28,

    UAC1 - Linux PC(Not Working) , Windows PC(Not working)

    UAC2 - Linux PC(Parital Working - Data(192 bytes) is transferring from device to PC with 0's), Windows PC(Not Working)

    Attached dmesg,usb analyzer log of AM572x for UAC1 on Linux PC.

     8267.am572x_dmesg_04sep2017_uac1.txt2671.Linux_PC_dmesg_04Sep2017_uac1.txt

    In Windows,

    [Q] Are you able to play the audio using audacity ?

    No

    In UAC1,

    sound card is detected(AC Interface) in device manager but only playback device is shown in sound(control panel)

    and I am not able to play audio using audacity - getting error "Error Opening Sound device" (Attached Screenshot)

    In UAC2,

    sound card is detected in device manager with error 10(Attached Screenshot)

    Audio device is not shown in audacity.

    [Q] Can you also check if you are able to record the audio from AM572x using arecord?

    Do I need to test with default hardware devices[card 0] or with the gadget device created after inserting g_audio module[card 2]?

    With default card[card 0],

    aplay - working fine.

    arecord - file is created but we could hear only noise while playing.

    Followed below procedure to test recording with gadget device created after inserting module(g_audio)[card 2],

    In UAC1,

    To display all listed all audio capture - used 'arecord -l'

    root@am57xx-evm:~# arecord -l
    **** List of CAPTURE Hardware Devices ****
    card 0: BeagleBoardX15 [BeagleBoard-X15], device 0: davinci-mcasp.0-tlv320aic3x-hifi tlv320aic3x-hifi-0 []
    Subdevices: 0/1
    Subdevice #0: subdevice #0
    root@am57xx-evm:~# aplay -l
    **** List of PLAYBACK Hardware Devices ****
    card 0: BeagleBoardX15 [BeagleBoard-X15], device 0: davinci-mcasp.0-tlv320aic3x-hifi tlv320aic3x-hifi-0 []
    Subdevices: 0/1
    Subdevice #0: subdevice #0
    card 1: H58040000encode [HDMI 58040000.encoder], device 0: HDMI 58040000.encoder snd-soc-dummy-dai-0 []
    Subdevices: 1/1
    Subdevice #0: subdevice #0

    But no UAC gadget device shown, so not able to record using arecord.

    In UAC2,

    root@am57xx-evm:~# arecord -l
    **** List of CAPTURE Hardware Devices ****
    card 0: BeagleBoardX15 [BeagleBoard-X15], device 0: davinci-mcasp.0-tlv320aic3x-hifi tlv320aic3x-hifi-0 []
    Subdevices: 1/1
    Subdevice #0: subdevice #0
    card 2: UAC2Gadget [UAC2_Gadget], device 0: UAC2 PCM [UAC2 PCM]
    Subdevices: 1/1
    Subdevice #0: subdevice #0

    UAC2 gadget device detected, So Tried following command to record audio using arecord,

    root@am57xx-evm:~# arecord -D plug:hw:2 -f S16_LE -c 2 -r 48000 file.wav
    
    Recording WAVE 'file.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Stereo
    
    arecord: pcm_read:2096: read error: Input/output error

    file.wav contains only 44 bytes (wav header) data after record.