6/01/2012

How to verify Audio Playback/recording on MSM8960 Linux Android targets using ADB

Open the ADB shell, and try the below amixer, arec and aplay commands for device enabling, recording and playback.
1. Playback on Single Ended Stereo Device ( Left channel audio will be played on LINEOUT1 and Right channel audio will be played on LINEOUT2)
a. Enabling Single Ended stereo Speaker Device

# Enable DSP AFE for Audio playback over Slimbus RX
amix 'SLIMBUS_0_RX Audio Mixer MultiMedia1' 1
# Set the Slimbus RX Channels
amix 'SLIM_0_RX Channels' Two
# Enable Codec RX Path
amix 'RX3 MIX1 INP1' 'RX1'
amix 'RX4 MIX1 INP1' 'RX2'
amix 'LINEOUT1 DAC Switch' 1
amix 'LINEOUT2 DAC Switch' 1
amix 'LINEOUT1 Volume' 50%
amix 'LINEOUT2 Volume' 50%


b. Starting the Audio Playback

aplay /data/<testfile.wav>

c. Disabling the Single Ended Stereo Speaker Device

amix 'SLIMBUS_0_RX Audio Mixer MultiMedia1' 0
amix 'RX3 MIX1 INP1' 'ZERO'
amix 'LINEOUT1 DAC Switch' 0
amix 'RX4 MIX1 INP1' 'ZERO'
amix 'LINEOUT2 DAC Switch' 0


2. Playback on Single Ended Stereo Device ( Left channel audio will be played on LINEOUT3 and Right channel audio will be played on LINEOUT4)
a. Enabling Single Ended stereo Speaker Device

# Enable DSP AFE for Audio playback over Slimbus RX
amix 'SLIMBUS_0_RX Audio Mixer MultiMedia1' 1
# Set the Slimbus RX Channels
amix 'SLIM_0_RX Channels' Two
# Enable Codec RX Path
amix 'RX5 MIX1 INP1' 'RX1'
amix 'RX6 MIX1 INP1' 'RX2'
amix 'LINEOUT3 DAC Switch' 1
amix 'LINEOUT4 DAC Switch' 1
amix 'LINEOUT3 Volume' 50%
amix 'LINEOUT4 Volume' 50%


b. Starting the Audio Playback

aplay /data/<testfile.wav>

c. Disabling the Single Ended Stereo Speaker Device

amix 'SLIMBUS_0_RX Audio Mixer MultiMedia1' 0
amix 'RX5 MIX1 INP1' 'ZERO'
amix 'LINEOUT3 DAC Switch' 0
amix 'RX6 MIX1 INP1' 'ZERO'
amix 'LINEOUT4 DAC Switch' 0


3. Playback on Mono Differential Device ( Audio Mono Output on LINEOUT1 and inverted output LINEOUT2)
a. Enabling Mono Differential Speaker Device

# Enable DSP AFE for Audio playback over Slimbus RX
amix 'SLIMBUS_0_RX Audio Mixer MultiMedia1' 1
# Set the Slimbus RX Channels
amix 'SLIM_0_RX Channels' One
# Enable Codec RX Path
amix 'RX3 MIX1 INP1' 'RX1'
amix 'RX4 MIX1 INP1' 'RX1'
amix 'RX4 CHAIN INVERT Switch' '1'
amix 'LINEOUT1 DAC Switch' 1
amix 'LINEOUT2 DAC Switch' 1
amix 'LINEOUT1 Volume' 50%
amix 'LINEOUT2 Volume' 50%

b. Starting the Audio Playback

aplay /data/<testfile.wav>

c. Disabling the Mono Differential Speaker Device

amix 'SLIMBUS_0_RX Audio Mixer MultiMedia1' 0
amix 'RX3 MIX1 INP1' 'ZERO'
amix 'LINEOUT1 DAC Switch' 0
amix 'RX4 MIX1 INP1' 'ZERO'
amix 'LINEOUT2 DAC Switch' 0


4. Playback on Mono Differential Device ( Audio Mono Output on LINEOUT3 and inverted output LINEOUT4)
a. Enabling Mono Differential Speaker Device

# Enable DSP AFE for Audio playback over Slimbus RX
amix 'SLIMBUS_0_RX Audio Mixer MultiMedia1' 1
# Set the Slimbus RX Channels
amix 'SLIM_0_RX Channels' One
# Enable Codec RX Path
amix 'RX5 MIX1 INP1' 'RX1'
amix 'RX6 MIX1 INP1' 'RX1'
amix 'RX6 CHAIN INVERT Switch' '1'
amix 'LINEOUT3 DAC Switch' 1
amix 'LINEOUT4 DAC Switch' 1
amix 'LINEOUT3 Volume' 50%
amix 'LINEOUT4 Volume' 50%


b. Starting the Audio Playback

aplay /data/<testfile.wav>

c. Disabling the Mono Differential Speaker Device

amix 'SLIMBUS_0_RX Audio Mixer MultiMedia1' 0
amix 'RX5 MIX1 INP1' 'ZERO'
amix 'LINEOUT3 DAC Switch' 0
amix 'RX6 MIX1 INP1' 'ZERO'
amix 'LINEOUT4 DAC Switch' 0


4b. Playback on Stereo Differential Device ( Audio Left channel on LINEOUT1 and inverted output LINEOUT2, Audio Right channel on LINEOUT3 and inverted output LINEOUT4 )
a. Enabling Stereo Differential Speaker Device ( Lineout 1, 2, 3 4)

# Enable DSP AFE for Audio playback over Slimbus RX
amix 'SLIMBUS_0_RX Audio Mixer MultiMedia1' 1
# Set the Slimbus RX Channels
amix 'SLIM_0_RX Channels' Two
# Enable Codec RX Path
amix 'RX3 MIX1 INP1' 'RX1'
amix 'RX4 MIX1 INP1' 'RX1'
amix 'RX5 MIX1 INP1' 'RX2'
amix 'RX6 MIX1 INP1' 'RX2'
amix 'RX4 CHAIN INVERT Switch' '1'
amix 'RX6 CHAIN INVERT Switch' '1'
amix 'LINEOUT1 DAC Switch' 1
amix 'LINEOUT2 DAC Switch' 1
amix 'LINEOUT3 DAC Switch' 1
amix 'LINEOUT4 DAC Switch' 1
amix 'LINEOUT1 Volume' 50%
amix 'LINEOUT2 Volume' 50%
amix 'LINEOUT3 Volume' 50%
amix 'LINEOUT4 Volume' 50%


b. Starting the Audio Playback

aplay /data/<testfile.wav>

c. Disabling the Stereo Differential Speaker Device

amix 'SLIMBUS_0_RX Audio Mixer MultiMedia1' 0
amix 'RX3 MIX1 INP1' 'ZERO'
amix 'LINEOUT1 DAC Switch' 0
amix 'RX4 MIX1 INP1' 'ZERO'
amix 'LINEOUT2 DAC Switch' 0
amix 'RX5 MIX1 INP1' 'ZERO'
amix 'LINEOUT3 DAC Switch' 0
amix 'RX6 MIX1 INP1' 'ZERO'
amix 'LINEOUT4 DAC Switch' 0
amix 'RX4 CHAIN INVERT Switch' '0'
amix 'RX6 CHAIN INVERT Switch' '0'


5. Playback on Headset device
a. Enabling the Headset Device

# Enable DSP AFE for Audio playback over Slimbus RX
amix 'SLIMBUS_0_RX Audio Mixer MultiMedia1' 1
# Set the Slimbus RX Channels
amix 'SLIM_0_RX Channels' Two
# Enable Codec RX Path
amix 'RX1 MIX1 INP1' 'RX1'
amix 'RX2 MIX1 INP1' 'RX2'
amix 'HPHL DAC Switch' 1
amix 'HPHR DAC Switch' 1
amix 'HPHL Volume' 50%
amix 'HPHR Volume' 50%
amix 'RX1 Digital Volume' 50%
amix 'RX2 Digital Volume' 50%

b. Starting the Audio Playback

aplay /data/<testfile.wav>

C. Disabling the Headset device

amix 'SLIMBUS_0_RX Audio Mixer MultiMedia1' 0
amix 'RX1 MIX1 INP1' 'ZERO'
amix 'RX2 MIX1 INP1' 'ZERO'
amix 'HPHL DAC Switch' 0
amix 'HPHR DAC Switch' 0

6. Playback on Handset Device
a. Enabling the Handset Device

# Enable DSP AFE for Audio playback over Slimbus RX
amix 'SLIMBUS_0_RX Audio Mixer MultiMedia1' 1
# Set the Slimbus RX Channels
amix 'SLIM_0_RX Channels' One
# Enable Codec RX Path
amix 'RX1 MIX1 INP1' 'RX1'
amix 'DAC1 Switch' 1
amix 'RX1 Digital Volume' 50%

b. Starting the Audio Playback

aplay /data/<testfile.wav>

C. Disabling Handset device

amix 'SLIMBUS_0_RX Audio Mixer MultiMedia1' 0
amix 'RX1 MIX1 INP1' 'ZERO'
amix 'DAC1 Switch' 0

7. Audio recording over Handset ( AMIC1 Input)
In the release builds, AMIC1 uses MIC BIAS1 Internal and defined in msm8960.c common_audio_map. This audio_map needs to be updated based on OEM device MIC BIAS configurations
a. Enabling the Handset TX device ( AMIC1)

#Enable DSP AFE for Audio Recording over Slimbus TX
amix 'MultiMedia1 Mixer SLIM_0_TX' 1
# Set the Slimbus TX Channels
amix 'SLIM_0_TX Channels' One
# Enable Codec TX Path
amix 'SLIM TX7 MUX' 'DEC6'
amix 'DEC6 MUX' 'ADC1'
amix 'DEC6 Volume' 100%

b. Starting the Audio Recording

arec -D hw:0,0 -C 1 -R 48000 /data/<recordfile.wav>

c. Disabling the Handset TX device ( AMIC1)

amix 'MultiMedia1 Mixer SLIM_0_TX' 0
amix 'SLIM TX7 MUX' 'ZERO'
amix 'DEC6 MUX' 'ZERO'

8. Audio Recording Over Headset (AMIC2 Input)
a.Enabling the Headset TX device ( AMIC2)
In the release builds, AMIC2 uses MIC BIAS2 External and defined in msm8960.c common_audio_map. This audio_map needs to be updated based on OEM device MIC BIAS configurations

#Enable DSP AFE for Audio Recording over Slimbus TX
amix 'MultiMedia1 Mixer SLIM_0_TX' 1
# Set the Slimbus TX Channels
amix 'SLIM_0_TX Channels' One
# Enable Codec TX Path
amix 'SLIM TX7 MUX' 'DEC5'
amix 'DEC5 MUX' 'ADC2'
amix 'DEC5 Volume' 100%

b. Starting the Audio Recording

arec -D hw:0,0 -C 1 -R 48000 /data/<recordfile.wav>

c. Disabling the Headset TX device ( AMIC2)

amix 'MultiMedia1 Mixer SLIM_0_TX' 0
amix 'SLIM TX7 MUX' 'ZERO'
amix 'DEC5 MUX' 'ZERO'

9. Audio Recording Over AMIC3 Input
a.Enabling the AMIC3
In the release builds, AMIC3 uses MIC BIAS3 Internal and defined in msm8960.c fluid_audio_map. This audio_map needs to be updated based on OEM device MIC BIAS configurations

#Enable DSP AFE for Audio Recording over Slimbus TX
amix 'MultiMedia1 Mixer SLIM_0_TX' 1
# Set the Slimbus TX Channels
amix 'SLIM_0_TX Channels' One
# Enable Codec TX Path
amix 'SLIM TX7 MUX' 'DEC4'
amix 'DEC4 MUX' 'ADC3'
amix 'DEC4 Volume' 100%

b. Starting the Audio Recording

arec -D hw:0,0 -C 1 -R 48000 /data/<recordfile.wav>

c. Disabling the AMIC3

amix 'MultiMedia1 Mixer SLIM_0_TX' 0
amix 'SLIM TX7 MUX' 'ZERO'
amix 'DEC4 MUX' 'ZERO'


10. Audio Recording using (DMIC1 Input)
In the release builds, DMIC1 uses MIC BIAS1 External and defined in msm8960.c common_audio_map. This audio_map needs to be updated based on OEM device MIC BIAS configurations
a.Enabling Digital MIC ( DMIC1)

#Enable DSP AFE for Audio Recording over Slimbus TX
amix 'MultiMedia1 Mixer SLIM_0_TX' 1
# Set the Slimbus TX Channels
amix 'SLIM_0_TX Channels' One
# Enable Codec TX Path
amix 'SLIM TX7 MUX' 'DEC1'
amix 'DEC1 MUX' 'DMIC1'
#Enable CAPLESS switch
amix 'MICBIAS1 CAPLESS Switch' 1

b. Starting the Audio Recording

arec -D hw:0,0 -C 1 -R 48000 /data/<recordfile.wav>

c. Disabling the Digital MIC ( DMIC1)

amix 'MultiMedia1 Mixer SLIM_0_TX' 0
amix 'SLIM TX7 MUX' 'ZERO'
amix 'DEC1 MUX' 'ZERO'
amix 'MICBIAS1 CAPLESS Switch' 0

11. Audio Recording using (DMIC2 Input)
In the release builds, DMIC2 uses MIC BIAS1 External and defined in msm8960.c common_audio_map. This audio_map needs to be updated based on OEM device MIC BIAS configurations
a.Enabling Digital MIC ( DMIC2)

#Enable DSP AFE for Audio Recording over Slimbus TX
amix 'MultiMedia1 Mixer SLIM_0_TX' 1
# Set the Slimbus TX Channels
amix 'SLIM_0_TX Channels' One
# Enable Codec TX Path
amix 'SLIM TX7 MUX' 'DEC2'
amix 'DEC2 MUX' 'DMIC2'
amix 'MICBIAS1 CAPLESS Switch' 1

b. Starting the Audio Recording

arec -D hw:0,0 -C 1 -R 48000 /data/<recordfile.wav>

c. Disabling the Digital MIC ( DMIC2)

amix 'MultiMedia1 Mixer SLIM_0_TX' 0
amix 'SLIM TX7 MUX' 'ZERO'
amix 'DEC2 MUX' 'ZERO'
amix 'MICBIAS1 CAPLESS Switch' 0





12. Stereo Audio Recording using DMIC1 and DMIC2 Inputs
In the release builds, DMIC1 uses MIC BIAS1 External and DMIC2 uses MIC BIAS1 External. It is defined in msm8960.c common_audio_map. This audio_map needs to be updated based on OEM device MIC BIAS configurations





a.Enabling Digital MICs ( DMIC1 and DMIC2)

#Enable DSP AFE for Audio Recording over Slimbus TX
amix 'MultiMedia1 Mixer SLIM_0_TX' 1
# Set the Slimbus TX Channels
amix 'SLIM_0_TX Channels' Two
# Enable Codec TX Path
amix 'SLIM TX7 MUX' 'DEC1'
amix 'SLIM TX8 MUX' 'DEC2'
amix 'DEC1 MUX' 'DMIC1'
amix 'DEC2 MUX' 'DMIC2'
amix 'MICBIAS1 CAPLESS Switch' 1
amix 'MICBIAS2 CAPLESS Switch' 1

b. Starting the Audio Recording

arec -D hw:0,0 -C 2 -R 48000 /data/<recordfile.wav>

c. Disabling Digital MICs ( DMIC1 and DMIC2)

amix 'MultiMedia1 Mixer SLIM_0_TX' 0
amix 'SLIM TX7 MUX' 'ZERO'
amix 'SLIM TX8 MUX' 'ZERO'
amix 'DEC1 MUX' 'ZERO'
amix 'DEC2 MUX' 'ZERO'
amix 'MICBIAS1 CAPLESS Switch' 0
amix 'MICBIAS2 CAPLESS Switch' 0


*AMIX Control For Volume

amix 'LINEOUT1 Volume' 0% - Low Volume
amix 'LINEOUT1 Volume' 100% -Max Volume



* AMIX Controls For ES2 Release

=========================

Note : "LINEOUT1 (1..4) DAC Switch" and "CHAIN INVERT Switch" are obsolete and are not used anymore.




Added new mixer Control for enabling the Differentil Mode .




amix 'RX4 DSM MUX' 'DSM_INV' - RX4 Chain


amix 'RX6 DSM MUX' 'DSM_INV' - RX6 Chain





From Tabla - 1.0/1.1




1. Playback on Differnential Stereo Device ( Left channel audio will be played on LINEOUT1 & LINEOUT2 and Right channel audio will be played on LINEOUT3 & LINEOUT4)
a. Enabling Single Ended stereo Speaker Device


# Enable DSP AFE for Audio playback over Slimbus RX
amix 'SLIMBUS_0_RX Audio Mixer MultiMedia1' 1

# Set the Slimbus RX Channels
amix 'SLIM_0_RX Channels' 'Two'

# Enable Codec RX Path
amix 'RX3 MIX1 INP1' 'RX1'
amix 'RX5 MIX1 INP1' 'RX2'
amix 'RX4 DSM MUX' 'DSM_INV'
amix 'RX6 DSM MUX' 'DSM_INV'
amix 'LINEOUT1 Volume' '60%'
amix 'LINEOUT2 Volume' '60%'
amix 'LINEOUT3 Volume' '60%'
amix 'LINEOUT4 Volume' '60%'


b. Starting the Audio Playback

aplay /data/<testfile.wav>


c. Disabling the Differential Stereo Speaker Device


amix 'SLIMBUS_0_RX Audio Mixer MultiMedia1' 0
amix 'RX3 MIX1 INP1' 'ZERO'
amix 'RX5 MIX1 INP1' 'ZERO'

amix 'RX4 DSM MUX' 'CIC_OUT'


amix 'RX6 DSM MUX' 'CIC_OUT'



2. Playback on Mono Differential Device ( Audio Mono Output on LINEOUT1 and inverted output LINEOUT2)
a. Enabling Mono Differential Speaker Device

# Enable DSP AFE for Audio playback over Slimbus RX
amix 'SLIMBUS_0_RX Audio Mixer MultiMedia1' 1
# Set the Slimbus RX Channels
amix 'SLIM_0_RX Channels' One
# Enable Codec RX Path
amix 'RX3 MIX1 INP1' 'RX1'
amix 'RX4 DSM MUX' 'DSM_INV'

amix 'LINEOUT1 Volume' '60%'
amix 'LINEOUT2 Volume' '60%'

b. Starting the Audio Playback

aplay /data/<testfile.wav>

c. Disabling the Mono Differential Speaker Device

amix 'SLIMBUS_0_RX Audio Mixer MultiMedia1' 0
amix 'RX3 MIX1 INP1' 'ZERO'
amix 'RX4 DSM MUX' 'CIC_OUT'

For Tabla 2.0



1. Playback on Differnential Stereo Device ( Left channel audio will be played on LINEOUT1 & LINEOUT3 and Right channel audio will be played on LINEOUT2 & LINEOUT4)
a. Enabling Single Ended stereo Speaker Device


# Enable DSP AFE for Audio playback over Slimbus RX
amix 'SLIMBUS_0_RX Audio Mixer MultiMedia1' 1

# Set the Slimbus RX Channels
amix 'SLIM_0_RX Channels' 'Two'

# Enable Codec RX Path
amix 'RX3 MIX1 INP1' 'RX1'
amix 'RX5 MIX1 INP1' 'RX2'
amix 'RX4 DSM MUX' 'DSM_INV'
amix 'RX6 DSM MUX' 'DSM_INV'
amix 'LINEOUT1 Volume' '60%'
amix 'LINEOUT2 Volume' '60%'
amix 'LINEOUT3 Volume' '60%'
amix 'LINEOUT4 Volume' '60%'


b. Starting the Audio Playback

aplay /data/<testfile.wav>


c. Disabling the Differential Stereo Speaker Device


amix 'SLIMBUS_0_RX Audio Mixer MultiMedia1' 0
amix 'RX3 MIX1 INP1' 'ZERO'
amix 'RX5 MIX1 INP1' 'ZERO'

amix 'RX4 DSM MUX' 'CIC_OUT'


amix 'RX6 DSM MUX' 'CIC_OUT'



2. Playback on Mono Differential Device ( Audio Mono Output on LINEOUT1 and inverted output LINEOUT3)
a. Enabling Mono Differential Speaker Device

# Enable DSP AFE for Audio playback over Slimbus RX
amix 'SLIMBUS_0_RX Audio Mixer MultiMedia1' 1
# Set the Slimbus RX Channels
amix 'SLIM_0_RX Channels' One
# Enable Codec RX Path
amix 'RX3 MIX1 INP1' 'RX1'
amix 'RX4 DSM MUX' 'DSM_INV'

amix 'LINEOUT1 Volume' '60%'
amix 'LINEOUT3 Volume' '60%'

b. Starting the Audio Playback

aplay /data/<testfile.wav>

c. Disabling the Mono Differential Speaker Device

amix 'SLIMBUS_0_RX Audio Mixer MultiMedia1' 0
amix 'RX3 MIX1 INP1' 'ZERO'
amix 'RX4 DSM MUX' 'CIC_OUT'

1 comment:

  1. Hi guys, I was trying to test my card with aplay and arec both of them seem to be working ok, I can see logs aplay: Playing... and arec gives me the recorded file but none of them has any sound.
    Neither my playback outputs any sound through speaker nor my recorded file contains any sound, although the size and duration seems ok.
    Any idea about what could happen ?
    Thanks~

    ReplyDelete