Changes between Version 1 and Version 2 of ventana/audio


Ignore:
Timestamp:
03/20/2020 11:35:45 PM (5 years ago)
Author:
Tim Harvey
Comment:

updated amixer settings to enable output output and capture as 5.4+ kernels disable them by default

Legend:

Unmodified
Added
Removed
Modified
  • ventana/audio

    v1 v2  
    11[[PageOutline]]
    22
    3 = Ventana Audio =
    4 The Advanced Linux Sound Architecture (ALSA) system is the current audio driver subsystem in Linux.
     3= Ventana Audio
     4The Advanced Linux Sound Architecture (ALSA) system is the current audio driver subsystem in Linux. For details on detecting and configuring ALSA devices see [wiki:linux/audio linux/audio]
    55
    6 The hardware that is used:
     6The audio hardware available on Ventana boards:
    77 * [http://cache.freescale.com/files/analog/doc/data_sheet/SGTL5000.pdf?pspll=1 Freescale SGTL5000] with line level input and output (standard board configuration) or (custom board configuration)
    88 headphone level output (custom board configuration) - 45mW max into 16ohme@3.3V load, and mic input
    9  * tda1997x (HDMI Audio in)(i.MX6)
    10  * imxhdmisoc (HDMI Audio out)(i.MX6)
     9 * tda1997x (HDMI Audio in)
     10 * imxhdmisoc (HDMI Audio out)
    1111
    1212For information regarding Audio / Video breakout adapters for Ventana see:
     
    1616
    1717
    18 == Devices ==
    19 The following commands are useful when dealing with multiple audio devices (These commands are done on a GW5400 which has multiple sources of audio in/out - different boards will have different devices at varied locations):
    20  * see a list of all audio cards:
    21 {{{
    22 $ cat /proc/asound/cards
    23  0 [sgtl5000audio  ]: sgtl5000-audio - sgtl5000-audio
    24                       sgtl5000-audio
    25  1 [tda1997xaudio  ]: tda1997x-audio - tda1997x-audio
    26                       tda1997x-audio
    27  2 [imxhdmisoc     ]: imx-hdmi-soc - imx-hdmi-soc
    28                       imx-hdmi-soc
    29 }}}
    30   * There are 3 audio cards in the system:
    31    * 0: sgtl5000audio (Analog Audio in/out)
    32    * 1: tda1997xaudio (HDMI Audio in)
    33    * 2: imxhdmisoc (HDMI Audio out)
    34     * Note that this is only available for playback if the framebuffer is not blanked
    35  * see a list of all playback devices:
    36 {{{
    37 $ aplay -l
    38 **** List of PLAYBACK Hardware Devices ****
    39 card 0: sgtl5000audio [sgtl5000-audio], device 0: HiFi sgtl5000-0 []
    40   Subdevices: 1/1
    41   Subdevice #0: subdevice #0
    42 card 2: imxhdmisoc [imx-hdmi-soc], device 0: IMX HDMI TX mxc-hdmi-soc-0 []
    43   Subdevices: 1/1
    44   Subdevice #0: subdevice #0
    45 }}}
    46   * the above shows 2 playback capable devices:
    47    * card 0: the sgtl5000audio device which has one subdevice (0) - this can be represented as 'hw:0,0'
    48    * card 2: the imxhdmisoc device which has one subdevice (0) - this can be represented as 'hw:2,0'
    49    * Note that card 1 is not listed as it is an HDMI Audio input only and not capable of playback
    50  * see a list of all playback device 'names'
    51 {{{
    52 $ aplay -L
    53 null
    54     Discard all samples (playback) or generate zero samples (capture)
    55 sysdefault:CARD=sgtl5000audio
    56     sgtl5000-audio,
    57     Default Audio Device
    58 sysdefault:CARD=imxhdmisoc
    59     imx-hdmi-soc,
    60     Default Audio Device
    61 }}}
    62   * the above shows 3 playback devices shown by name (Note that this is the name what can be used with 'aplay -D <devicename>' to specify playback device):
    63    * null - a null device
    64    * sysdefault:CARD=sgtl5000audio - Analog audio out
    65    * sysdefault:CARD=imxhdmisoc - HDMI audio out
    66  * see a list of all capture devices:
    67 {{{
    68 root@ventana:~# arecord -l
    69 **** List of CAPTURE Hardware Devices ****
    70 card 0: sgtl5000audio [sgtl5000-audio], device 0: HiFi sgtl5000-0 []
    71   Subdevices: 1/1
    72   Subdevice #0: subdevice #0
    73 card 1: tda1997xaudio [tda1997x-audio], device 0: IMX HDMI RX tda1997x-0 []
    74   Subdevices: 1/1
    75   Subdevice #0: subdevice #0
    76 }}}
    77   * the above shows 2 capture capable devices:
    78    * card 0: the sgtl5000audio device which has one subdevice (0) - this can be represented as 'hw:0,0'
    79    * card 1: the tda1997xaudio device which has one subdevice (0) - this can be represented as 'hw:1,0'
    80    * Note that card 2 is not listed as it is an HDMI Audio output only and not capable of capture
    81  * see a list of all record device 'names':
    82 {{{
    83 $ arecord -L
    84 null
    85     Discard all samples (playback) or generate zero samples (capture)
    86 sysdefault:CARD=sgtl5000audio
    87     sgtl5000-audio,
    88     Default Audio Device
    89 sysdefault:CARD=tda1997xaudio
    90     tda1997x-audio,
    91     Default Audio Device
    92 }}}
    93   * the above shows 3 capture devices shown by name (Note that this is the name what can be used with 'arecord -D <devicename>' to specify capture device):
    94    * 'null' - a null device
    95    * 'sysdefault:CARD=sgtl5000audio' - Analog audio in
    96    * 'sysdefault:CARD=tda1997xaudio' - HDMI audio in
    97  * display audio controls:
    98 {{{
    99 amixer
    100 }}}
    101   * you can use the '-c <cardno>' parameter to amixer to specify a specific card (card number for /proc/asound/cards such as 'amixer -c 0' for the first card)
    102   * see 'amixer -h' for details on setting/getting various controls
    103 
    104 
    105 [=#amixer]
    106 == Mixer (mux/gain/volume) ==
    107 The ALSA mixer controls the muxing of inputs to outputs, capture gains, and volume levels.  The settings vary per card.
    108 
    109 You can use the amixer command to get/set/list available controls per card:
    110  * list controls for card0:
    111 {{{
    112 amixer -c0
    113 }}}
    114 
    115 
    11618[=#amixer-sgtl5000]
    117 === sgtl5000 (analog audio) ===
     19=== sgtl5000 (analog audio)
    11820Note that by default, Ventana family boards that have analog audio have a default strapping of [http://en.wikipedia.org/wiki/Line_level line level] audio (both input and output).
    11921
     
    12224
    12325[=#amixer-sgtl5000-lineout]
    124 ==== Line Level Audio Output ====
    125 common amixer settings for line level audio:
    126 {{{
     26==== Line Level Audio Output
     27common {{{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):
     28 * Output (Line out)
     29{{{#!bash
     30# unmute output
     31amixer -c 0 sset Lineout on
    12732# set output level to max
    128 amixer -c 0 -q sset "PCM" 100%
     33amixer -c 0 sset PCM 100%
     34}}}
     35 * Input (Line in)
     36{{{#!bash
    12937# set capture mux
    130 amixer -c 0 -q sset "Capture Mux" LINE_IN
    131 amixer -c 0 -q sset "Line In Function" on
     38amixer -c 0 sset "Capture Mux" LINE_IN
     39amixer -c 0 sset "Line In Function" on
    13240# set capture gain
    133 amixer -c 0 -q sset "Capture" 8
     41amixer -c 0 sset "Capture" 8
     42# enable it
     43amixer -c 0 sset "Capture" cap
    13444}}}
    13545
     
    14050 * sgtl5000 can drive 45mW max into a 16ohm load at 3.3V (53mA)
    14151
    142 common amixer settings for headphone level audio:
    143 {{{
     52common {{{amixer}}} settings for headphone level audio:
     53{{{#!bash
    14454# Set zero cross detect gain
    14555amixer -c 0 sset Headphone Playback ZC 60%
     56# unmute output
     57amixer -c 0 sset Headphone on
     58# set output level to max
     59amixer -c 0 sset PCM 100%
    14660}}}
    14761
     
    16882  * Front Left: Playback 192 [100%]
    16983  * Front Right: Playback 192 [100%]
     84  * disabled
    17085 * Capture Mux (MIC_IN or LINE_IN)
    17186  * MIC_IN
     
    17388  * Front Left: Capture 5 [33%]
    17489  * Front Right: Capture 6 [40%]
     90  * disabled
    17591
    17692