wiki:ventana/audio

Version 4 (modified by Cale Collins, 2 years ago) ( diff )

added link for installing userspace utils.

Ventana Audio

The Advanced Linux Sound Architecture (ALSA) system is the current audio driver subsystem in Linux. For details on detecting and configuring ALSA devices see linux/audio

The audio hardware available on Ventana boards:

  • Freescale SGTL5000 with line level input and output (standard board configuration) or (custom board configuration) headphone level output (custom board configuration) - 45mW max into 16ohme@3.3V load, and mic input
  • tda1997x (HDMI Audio in)
  • imxhdmisoc (HDMI Audio out)

For information regarding Audio / Video breakout adapters for Ventana see:

Note that by default, Ventana family boards that have analog audio have a default strapping of line level audio (both input and output). However, there is an option to load Headphone level output/Mic level input on request. Please contact sales@… if you would like a special built with these loadings.

For instructions to install userspace ALSA utilities see our linux/audio page.

sgtl5000 (analog audio)

Note that by default, Ventana family boards that have analog audio have a default strapping of line level audio (both input and output).

However, there is an option to load Headphone level output and/or Mic level input on request. Please contact sales@… if you would like a special built with these loadings.

Line Level Audio Output

common amixer settings for Analog audio output (make sure to look at /proc/asound/cards to find the correct device number to use with the -c option below):

  • Determine Device number:
    # cat /proc/asound/cards
     0 [DWHDMI         ]: dw-hdmi-ahb-aud - DW-HDMI
                          DW-HDMI rev 0x0a, irq 22
     1 [sgtl5000audio  ]: sgtl5000-audio - sgtl5000-audio
                          sgtl5000-audio
     2 [tda1997xaudio  ]: tda1997x-audio - tda1997x-audio
                          tda1997x-audio
    # card=$(cat /proc/asound/cards | grep sgtl5000audio | awk '{ print $1}')
    
    • the above output shows that device '0' is HDMI out, device '1' is analog audio in/out, and device '2' is HDMI audio in. This device numbering can change from kernel to kernel depending on driver init order so we use grep and awk to get the card number for the 'sgtl5000audio' device
  • Output (Line out)
    # get card number for sgtl5000audio device
    card=$(cat /proc/asound/cards | grep sgtl5000audio | awk '{ print $1}')
    # unmute output
    amixer -c $card sset Lineout on
    # set output level to max
    amixer -c $card sset PCM 100%
    
  • Input (Line in)
    # get card number for sgtl5000audio device
    card=$(cat /proc/asound/cards | grep sgtl5000audio | awk '{ print $1}')
    # set capture mux
    amixer -c $card sset "Capture Mux" LINE_IN
    amixer -c $card sset "Line In Function" on
    # set capture gain
    amixer -c $card sset "Capture" 8
    # enable it
    amixer -c $card sset "Capture" cap
    

Headphone Level Audio Output

If you've ordered a board with HP level audio the following specifications apply:

  • sgtl5000 can drive 45mW max into a 16ohm load at 3.3V (53mA)

common amixer settings for headphone level audio:

# get card number for sgtl5000audio device
card=$(cat /proc/asound/cards | grep sgtl5000audio | awk '{ print $1}')
# Set zero cross detect gain
amixer -c $card sset Headphone Playback ZC 60%
# unmute output
amixer -c $card sset Headphone on
# set output level to max
amixer -c $card sset PCM 100%

In addition, you will also have to make a change to your device tree file in the kernel. Below is a sample patch of what you will have to do (filename depends on product you've ordered)

  • arch/arm/boot/dts/imx6qdl-gw52xx.dtsi

    diff --git a/arch/arm/boot/dts/imx6qdl-gw52xx.dtsi b/arch/arm/boot/dts/imx6qdl-gw52xx.dtsi
    index ed71beb..1c0b229 100644
    a b  
    109109               audio-codec = <&codec>;
    110110               audio-routing =
    111111                       "LINE_IN", "Line In Jack",
    112                        "Line Out Jack", "LINE_OUT";
     112                       "Headphone Jack", "HP_OUT";
    113113               mux-int-port = <1>;
    114114               mux-ext-port = <4>;
    115115       };

The defaults for the analog audio (which are found by running 'amixer' with no args) are:

  • Output Level (PCM) (0 - 192)
    • Front Left: Playback 192 [100%]
    • Front Right: Playback 192 [100%]
    • disabled
  • Capture Mux (MIC_IN or LINE_IN)
    • MIC_IN
  • Capture Gain (0-15):
    • Front Left: Capture 5 [33%]
    • Front Right: Capture 6 [40%]
    • disabled

HDMI (digital audio)

The imxhdmisoc audio (output only) device can be used to send digital audio to a connected (and unblanked) HDMI monitor that has speakers.

The tda1997xaudio audio (input only) device (on GW5400 models) can be used to capture digital audio from a connected (and unblanked) HDMI source that streams audio. Note that HDMI audio supports multiple sample-rates and the sample-rate available to capture depends on the incoming source stream. The source stream's audio sample rate can be found via sysfs /sys/bus/i2c/drivers/tda1997x/2-0048/audmode

ALSA utility (alsa-utils package) examples (arecord/aplay)

The alsa-utils package contains the arecord, aplay, amixer applications

aplay:

  • playback pre-recorded sound to analog audio device (GW54xx/GW53xx/GW52xx)
    aplay -D sysdefault:CARD=sgtl5000audio /usr/share/sounds/alsa/Front_Center.wav
    
  • playback pre-recorded sound to HDMI audio output device
    aplay -D sysdefault:CARD=imxhdmisoc /usr/share/sounds/alsa/Front_Center.wav
    

arecord:

  • record 10 seconds of CD quality audio (16bit, 44.1KHz, stereo) from analog audio device to /tmp/foo.wav
    arecord -D sysdefault:CARD=sgtl5000audio -f cd -d 10 -t wav /tmp/foo.wav
    
    • make sure you have specified the capture gain and input device (see above)

Codecs

For Codec support (Encoder / Decoder) details please see:

Gstreamer examples

For GStreamer information and examples please see:

Note: See TracWiki for help on using the wiki.