Audio headset issue

Hai,
We have connected audio Jack in analog expansion connector lines, CDC_HPH_L, CDC_HPH_R, CDC_HS_DET and GND.
and speaker SPKR_OUT_P & SPKR_OUT_M.

I have two problems,

  1. Not able to hear audio via headset
  2. Speaker is working but Could not able to increase volume for media player by pressing Vol(+) button.

mixer_paths_sbc.xml files contains this entry

<path name=”headset-mic”>
<path name=”adc2″ />
<ctl name=”ADC2 MUX” value=”INP2″ />
<ctl name=”IIR1 INP1 MUX” value=”DEC1″ />
</path>

I was able to get the speaker running with the following commands (under Android).

# Enable Speaker and Play:
tinymix &#039;PRI_MI2S_RX Audio Mixer MultiMedia1&#039; 1
tinymix &#039;RX3 MIX1 INP1&#039; &#039;RX1&#039;
tinymix &#039;SPK DAC Switch&#039; 1
tinyplay /data/audio/test.wav

# Disable Sequence:
tinymix &#039;PRI_MI2S_RX Audio Mixer MultiMedia1&#039; 0
tinymix &#039;RX3 MIX1 INP1&#039; &#039;ZERO&#039;
tinymix &#039;SPK DAC Switch&#039; 0

This worked for the headset audio out

tinymix &#039;PRI_MI2S_RX Audio Mixer MultiMedia1&#039; 1
tinymix &#039;RX1 MIX1 INP1&#039; &#039;RX1&#039;
tinymix &#039;RX2 MIX1 INP1&#039; &#039;RX2&#039;
tinymix &#039;RDAC2 MUX&#039; &#039;RX2&#039;
tinymix &#039;HPHL&#039; &#039;Switch&#039;
tinymix &#039;HPHR&#039; &#039;Switch&#039;
tinymix &#039;MI2S_RX Channels&#039; &#039;Two&#039;
tinyplay /data/audio/test.wav
tinyplay /data/audio/left.wav
tinyplay /data/audio/right.wav

and the headset microphone

# Enable Headset mic capture:
#---------------------------
tinymix &#039;MultiMedia1 Mixer TERT_MI2S_TX&#039; 1
tinymix &#039;DEC1 MUX&#039; &#039;ADC2&#039;
tinymix &#039;ADC2 MUX&#039; &#039;INP2&#039;
tinycap /data/audio/capture_hs.wav -D 0 -d 0 -c 1 -r 48000 -b 16 &amp;
# note PID, and when done capturing audio
kill -2 &lt;PID&gt;
tinyplay /data/audio/capture_hs.wav

#Disable Headset mic capture:
#----------------------------
tinymix &#039;MultiMedia1 Mixer TERT_MI2S_TX&#039; 0
tinymix &#039;DEC1 MUX&#039; &#039;ZERO&#039;
tinymix &#039;ADC2 MUX&#039; &#039;ZERO&#039;

Full Disclosure: I am an employee of Qualcomm Canada, any opinions expressed in this post or any other post may not reflect the opinions of my employer.

Thank you for the reply ljking.

i got speaker working. But still media volume is Zero while pressing Vol(+) button,Could not able to play mp3 audio via music player.

After executing all the above commands for headset audio out, output of tinyplay
shell@msm8916_64:/ # tinyplay /data/audio/test.wav
[ 83.589248] q6asm_callback: cmd = 0x10bcd returned error = 0x5
[ 83.594077] __q6asm_cmd: DSP returned error[-5] opcode 68557
Playing sample: 1 ch, 16000 hz, 16 bit
[ 83.612904] wcd_imped_config, invalid imped, greater than 48 Ohm
[ 83.612904] = 48
[ 84.131211] wcd_imped_config, invalid imped, greater than 48 Ohm
[ 84.131211] = 48

No sound coming out in headset.!

Any ideas as to why I get a “failed to open mixer” message?

I executed the commands as a root user.

You will note that I ran the commands under Android, and you are running them under Linux. There may be issues in Linux, I didn’t test them there.

ljking I ran the commands via adb for android.

Speaker is not working for media application like Music player and cannot adjust the volume (media volume is always Zero).

If Music player is running meanwhile adjusting “Ring Volume” in Sound & notification setting, i can hear both ring volume and mp3 song until the ring.

And headset is working only for the very first time(Both via adb and application).

Any idea ??

Hi ljking,

As you have given mixer commands for the speaker and Headset.
I have connected earphone on the expansion. so i want to switch audio on the earphone.
can i get the mixer commands for the Earphone also.

Thanks,
Deepak

Hi Deepak:
I’m not sure what you mean by “earphone”. Which pins on the audio expansion connector did you connect to?

Hi ljking,

I have one custom board based on the Snapdragon 410 based APQ8016. So i have CDC_EAR_P and CDC_EAR_M on my expansion connector.

so I want to switch audio on the connected earphone on the expansion. so i need mixer commands for it.

Regards,
Deepak

Hi Deepak

Looking at the 410c schematic the signals CDC_EAR_P and CDC_EAR_M are not connected from the PMIC to any other point on the board (they are NC), hence I have no way to test what tinymix commands might be necessary to activate that particular output. You will need to talk to the manufacturer of the board you are using for support of the correct tinymix commands to run this output.

Full Disclosure. I am an employee of Qualcomm Canada, any opinions expressed in this of any other post may not reflect the opinions of my employer.

Hi ljking,

After troubleshooting with the mixer file and Audio codec driver. I have made and tested below commands for earpiece/headphones.


#Earpiece
#Enable

tinymix &#039;PRI_MI2S_RX Audio Mixer MultiMedia1&#039; 1
tinymix &#039;RX1 MIX1 INP1&#039; &#039;RX1&#039;
tinymix &#039;RDAC2 MUX&#039; &#039;RX1&#039;
tinymix &#039;RX1 Digital Volume&#039; &#039;84&#039;
tinymix &#039;EAR PA Gain&#039; &#039;POS_6_DB&#039;
tinymix &#039;EAR_S&#039; &#039;Switch&#039;

#Disable
tinymix &#039;PRI_MI2S_RX Audio Mixer MultiMedia1&#039; 0
tinymix &#039;RX1 MIX1 INP1&#039; &#039;ZERO&#039;
tinymix &#039;RDAC2 MUX&#039; &#039;ZERO&#039;
tinymix &#039;EAR PA Gain&#039; &#039;POS_1P5_DB&#039;
tinymix &#039;EAR_S&#039; &#039;ZERO&#039;

Regards,
Deepak

Hi sathya,

I run into the same problem that the music app does not have sound output but tinyplay can play music with speaker normally. What I did is to modify the mixer_paths_sbc.xml to speaker the default output at power up. Did you solve the problem?

Thanks in advance!

Hi,

More information.
I am working on linux_android_board_support_package_vla.br.1.2.7-01010-8x16.0-4.
when I issue tinymix commands stated as above, tinyplay can work but my app which plays movies does not have sound occasionally.
When no tinymix commands are issued, when we click Alarm and Ring volume in Settings/Sound & notification, we can hear sound. Does this mean that apps can control speaker output without tinymix commands? But this does not happen for Media volume. Neither my app does not have sound output.
Can anyone drop me some hints?

Thanks in advance!

I need to disable: MIC2_IN; MIC3_IN; HPH L; HPH R; HPH_REF; HSET_DET;

And enable only: MIC1_IN; SPKR_DRV_P; SPKR_DRV_M;

Then I need my DragonBoard 410c (Android # 99) always starts at: MIC1_IN; SPKR_DRV_P; SPKR_DRV_M;

Can you pass me the procedures to get to that result?