Changes between Version 2 and Version 3 of ventana/audio


Ignore:
Timestamp:
06/30/2020 07:08:52 PM (7 months ago)
Author:
Tim Harvey
Comment:

updated examples to determine card number for sgtl5000audio device

Legend:

Unmodified
Added
Removed
Modified
  • ventana/audio

    v2 v3  
    2626==== Line Level Audio Output
    2727common {{{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 * Determine Device number:
     29{{{#!bash
     30# cat /proc/asound/cards
     31 0 [DWHDMI         ]: dw-hdmi-ahb-aud - DW-HDMI
     32                      DW-HDMI rev 0x0a, irq 22
     33 1 [sgtl5000audio  ]: sgtl5000-audio - sgtl5000-audio
     34                      sgtl5000-audio
     35 2 [tda1997xaudio  ]: tda1997x-audio - tda1997x-audio
     36                      tda1997x-audio
     37# card=$(cat /proc/asound/cards | grep sgtl5000audio | awk '{ print $1}')
     38}}}
     39  - 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
    2840 * Output (Line out)
    2941{{{#!bash
     42# get card number for sgtl5000audio device
     43card=$(cat /proc/asound/cards | grep sgtl5000audio | awk '{ print $1}')
    3044# unmute output
    31 amixer -c 0 sset Lineout on
     45amixer -c $card sset Lineout on
    3246# set output level to max
    33 amixer -c 0 sset PCM 100%
     47amixer -c $card sset PCM 100%
    3448}}}
    3549 * Input (Line in)
    3650{{{#!bash
     51# get card number for sgtl5000audio device
     52card=$(cat /proc/asound/cards | grep sgtl5000audio | awk '{ print $1}')
    3753# set capture mux
    38 amixer -c 0 sset "Capture Mux" LINE_IN
    39 amixer -c 0 sset "Line In Function" on
     54amixer -c $card sset "Capture Mux" LINE_IN
     55amixer -c $card sset "Line In Function" on
    4056# set capture gain
    41 amixer -c 0 sset "Capture" 8
     57amixer -c $card sset "Capture" 8
    4258# enable it
    43 amixer -c 0 sset "Capture" cap
     59amixer -c $card sset "Capture" cap
    4460}}}
    4561
     
    5268common {{{amixer}}} settings for headphone level audio:
    5369{{{#!bash
     70# get card number for sgtl5000audio device
     71card=$(cat /proc/asound/cards | grep sgtl5000audio | awk '{ print $1}')
    5472# Set zero cross detect gain
    55 amixer -c 0 sset Headphone Playback ZC 60%
     73amixer -c $card sset Headphone Playback ZC 60%
    5674# unmute output
    57 amixer -c 0 sset Headphone on
     75amixer -c $card sset Headphone on
    5876# set output level to max
    59 amixer -c 0 sset PCM 100%
     77amixer -c $card sset PCM 100%
    6078}}}
    6179