Project

General

Profile

Example audio line

Objective

This wiki page demonstrates how to verify that the audio out and audio in lines are working.

Prerequisites

  • Audio speaker or stereo headphones with a 3.5mm plug in order to listen to the audio
  • Audio stereo cable with 3.5mm plug at both ends (or a microphone with a 3.5mm plug)
  • Locate the audio sockets on the dev-kit.

Steps

Audio Out

  • Enter the following commands to adjust the output volume
    amixer set PCM 85%
    amixer set 'Line DAC' 85%
    
  • Plug the speaker or headphones into the Stereo Out socket.
  • Enter the following command to play a 440 Hz tone which alternates 5 times between the left and right channels
    speaker-test -c2 -f440 -t sine -l 5
    
  • You should hear a tone which alternates between the left and right speakers or the left and right sides of the headphones. If you only have a mono speaker, then you will just hear a steady tone.

Audio In

  • Enter the following command to adjust the input volume
    amixer set PGA 30%
    
  • When using a stereo audio cable
    • Enter the following commands to work with something like a loop-around cable.
      amixer sset 'Left PGA Mixer Line1L' off
      amixer sset 'Right PGA Mixer Line1R' off
      amixer sset 'Left PGA Mixer Mic2L' on
      amixer sset 'Right PGA Mixer Mic2R' on
      
    • Plug one end of the cable into the Stereo Out socket and one end of the cable into the Line In socket.
    • Create two terminal windows into the device (use the serial console and an ssh connection or 2 ssh connections)
    • In one terminal enter this command
      speaker-test -c2 -f440 -t sine -l 5
      
    • In the other terminal enter this command
      arecord -f dat test.wav
      
    • When the speaker-test command finishes, hit ctrl-C in the second window to stop the arecord.
    • Remove the cable from the Stereo Out socket and insert the speaker or headphones
    • Enter the following command to playback the recorded audio
      aplay test.wav
      
    • You should hear the tone that was generated by the speaker-test command.
  • When using a microphone.
    • Enter the following commands to work with a microphone.
      amixer sset 'Left PGA Mixer Line1L' on
      amixer sset 'Right PGA Mixer Line1R' on
      amixer sset 'Left PGA Mixer Mic2L' off
      amixer sset 'Right PGA Mixer Mic2R' off
      
    • Start recording using this command
      arecord -f dat test_mic.wav
      
    • Say something deep and profound
    • Hit ctrl-C to stop the record.
    • Connect the speaker to the Stereo Out socket.
    • Use the following command to play the recording
      aplay test_mic.wav
      
    • You should hear your recorded message

Mic In

The devkit has connected the audio input as a Stereo Line In instead of a Mic In. In order to use the port as a Mic In, a board modification would be required.

Devkit:

According to the TLV320AIC3104 EVM Users Guide, to support a stereo mic in on IN2, it should be hooked up like:

Depop R226 and R227 and connect to MICBIAS using separate 2.2k resistors. This should create a working 2-channel mic input.
Though to fully match the EVM schematic, R222/R223 should be 0hms and C128/130 should be 0.1uF.

Note: It may be necessary to alter the alsamixer settings as well as the simple-audio-card routing in the device tree.

Conclusion

This wiki page has demonstrated how to verify that the Stereo Out is working and then how to make a recording from the Line In and play it back.

Go to top
Add picture from clipboard (Maximum size: 1 GB)