This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux ALSA Audio driver usage for Centaurus

I am new to Linux and ALSA. Here is what I am trying to do....

WE have two input/output pairs for audio. The 1st pair is the LineIN/LineOut and the second pair is MicIn/HpOut. On our Centaurus EVM the LineIn connected to LINE1L+ and LINE1R+ of AIC3106. The LineOut is connected to LEFT_LO= and RIGHT_LO+. Similarly the MicIn is connected to MIC3R and MIC3L, the corresponding output for this input (i.e. HpOut) is connected to HPLOUT and HPROUT. I want to be able to select either pair and play audio using the left channel. So this is what I do 

LineIn/LinOut pair

./amixer sset 'Left PGA Mixer Mic3L' off
./amixer sset 'Left PGA Mixer Mic3R' off
./amixer sset 'Left PGA Mixer Line1L' on
./amixer sset 'Left PGA Mixer Line1R' on
./amixer sset 'Left HP Mixer DACL1' off
./amixer sset 'Right HP Mixer DACL1' off
./amixer sset 'Left Line Mixer DACL1' on
./amixer sset 'Right Line Mixer DACL1' on
./arecord -v --device="hw:0,0" --format=S16_LE --rate=16000 --channels=2 --period-size=160 --buffer-size=320 |\
./aplay   -v --device="hw:0,0" --format=S16_LE --rate=16000 --channels=2 --period-size=160 --buffer-size=320

In this case the audio plays fine. however for the other pair when I set

 

MicIn/HpOut pair

./amixer sset 'Left PGA Mixer Line1L' off
./amixer sset 'Left PGA Mixer Line1R' off
./amixer sset 'Left PGA Mixer Mic3L' on
./amixer sset 'Left PGA Mixer Mic3R' on
./amixer sset 'Left Line Mixer DACL1' off
./amixer sset 'Right Line Mixer DACL1' off
./amixer sset 'Left HP Mixer DACL1' on
./amixer sset 'Right HP Mixer DACL1' on
./arecord -v --device="hw:0,0" --format=S16_LE --rate=16000 --channels=2 --period-size=160 --buffer-size=320 |\
./aplay   -v --device="hw:0,0" --format=S16_LE --rate=16000 --channels=2 --period-size=160 --buffer-size=320

I get following error

arecord: main:660: audio open error: Invalid argument
aplay: playback:2455: read error

What is going wrong?

Sachin

  • Sachin,

     

    It seems that snd_pcm_open failed after switching to MicIn/HpOut pair.  Could you check with "aplay -l" to see if the device is still there?

     

    MicIn/HpOut pair

    ./amixer sset 'Left PGA Mixer Line1L' off
    ./amixer sset 'Left PGA Mixer Line1R' off
    ./amixer sset 'Left PGA Mixer Mic3L' on
    ./amixer sset 'Left PGA Mixer Mic3R' on
    ./amixer sset 'Left Line Mixer DACL1' off
    ./amixer sset 'Right Line Mixer DACL1' off
    ./amixer sset 'Left HP Mixer DACL1' on
    ./amixer sset 'Right HP Mixer DACL1' on

    alsa -l    (---> this is lower 'L')

     

    BTW, did you modify anything in amixer.c?  Is it same if you use "amixer" instead of "./amixer"?

     

    Regards,

    Chan