PM8916 Set in DragonBoard410c#ANDROID#99

PM8916 Configurations:

I need the following settings on the PM8916:

Disabled:
1-Mbias#2(MIC_BIAS2);
2-MIC2_IN(ADC#2/3);
3-MIC3_IN(ADC#2/3);
4-EARO_P(RDAC#1);
5-EARO_M(RDAC#2);
6-HPH_L(RDAC#1);
7-HPH_R(RDAC#2);

Enabled:
1-Mbias#1(MIC_BIAS1);
2-MIC1_IN(ADC#1);
3-SPKR_DRV_P(RDAC#3);
4-SPKR_DRV_M(RDAC#3);

I need the configurations above to become standard. So that whenever I call my [DragonBoard 410c] it already starts with these settings as default.

Can someone guide me about this?

Another question is:

How do I set the [ADC # 1; MIC1_IN] from 0dB to 24dB on the PM8916?

I’m using a DragonBoard410c#ANDROID#99.

Thank you!

I’ve never really used Android myself but how did you get on with the document from Qualcomm: https://developer.qualcomm.com/qfile/29468/lm80-p0436-43_stereocontaudioroutappnote.pdf

If you try and combine information from the Linux section (which has speaker config) and the Android section (which demonstrates tinymix commands) you might get somewhere. It also looks like document gives hints about how to make mixer settings more permanent.

This document does not help much.

How can I modify the [mixer_paths_sbc.xml] file and which code lines should I modify so that the audio is routed to the [J7] connector by default?

I think you really need to provide some clues about what you have already tried. The following is general guidance about how to ask questions effectively but I think a lot of it applies here:

Basically your choice of microphone implies you have modded your board; you really could be the only person who can test this.

Anyhow first off you should be trying to figure out the right sequence of tinymix commands to get the result you want. What commands have you already tried to get the speakers/mic running?

Similarly, assuming you made some experimental changes to the XML file (for example to modify the HPHL control mentioned in the PDF document), what happened as a result?

BTW I did take a quick look at the source for tinymix (I’ve only ever used amixer). It looks like running it without arguments will list all possible mixer controls. Can you use that to help convert the Debian commands into Android ones?

Here’s the complete sequence I’m doing:

Adb root
adb remount
adb shell
tinymix ‘PRI_MI2S_RX Mixer de áudio MultiMedia1’ 1
tinymix ‘RX3 MIX1 INP1’ ‘RX1’
tinymix ‘SPK DAC Switch’ 1
exit
adb root
adb remount
adb pull /etc/init.qcom.post_boot.sh
adb push init.qcom.post_boot.sh /etc/init.qcom.post_boot.sh
adb reboot

Adb root
adb remount
adb pull /etc/init.qcom.post_boot.sh
vim init.qcom.post_boot.sh

— add these lines
tinymix ‘PRI_MI2S_RX Mixer de áudio MultiMedia1’ 1
tinymix ‘RX3 MIX1 INP1’ ‘RX1’
tinymix ‘SPK DAC Switch’ 1
— :wq (write quit)

adb push init.qcom.post_boot.sh /etc/init.qcom.post_boot.sh
adb reboot
Adb root
adb remount
adb pull /etc/init.qcom.post_boot.sh
vim init.qcom.post_boot.sh

— add these lines
tinymix ‘PRI_MI2S_RX Mixer de áudio MultiMedia1’ 1
tinymix ‘RX3 MIX1 INP1’ ‘RX1’
tinymix ‘SPK DAC Switch’ 1
— :wq (write quit)

adb push init.qcom.post_boot.sh /etc/init.qcom.post_boot.sh
adb reboot

Follow their instructions see attached photos. The audio comes out only through HDMI.

Is ‘PRI_MI2S_RW Mixer de áudio MultiMedia1’ listed in the output of tinymix (we’re using a very low level kernel interface here… I don’t think it is internationalized by this point in the stack).

I would expect tinymix to be replying with “Invalid mixer control” to that command.

I’d not bother trying to make the configuration sticky just yet. Focus first on figuring out the right tinymix commands to send via adb to make something happen (even if that is just successfully sending audio through the headphone output).

Do you want me to modify the line: tinymix ‘PRI_MI2S_RX Mixer de áudio MultiMedia1’ 1
For the line: ‘PRI_MI2S_RW Mixer de áudio MultiMedia1’ ??

I don’t think so.

As I said before, running [tinymix] without arguments will list all possible mixer controls. Getting that list would be a good start because then there is a clear list of the controls you have to play with.

After that I’d suggest confirming that the commands listed in the PDF document (for headphones) do correctly steer audio away from HDMI (noting that I think /data/test.wav might need to be a .wav file you supply yourself using adb push). If possible try to use jumper wire and pair of headphones to show that it actually worked…

Only when you’re confident with the documented procedures would I recommend you start to deviate from them!

I need to activate only the Speaker:
SPKR_DRV_P (RDAC # 3);
SPKR_DRV_M (RDAC # 3);

Here’s the complete sequence I’m doing:

Adb root
adb remount
adb shell
tinymix 'PRI_MI2S_RX Audio Mixer MultiMedia1' 1
tinymix 'RX3 MIX1 INP1' 'RX1'
tinymix 'SPK DAC Switch' 1
exit
adb reboot

Is that correct?

When I’m in the commands [tinymix] at the command prompt, I always get the answers for each of the commands below:

tinymix 'PRI_MI2S_RX Audio Mixer MultiMedia1' 1
tinymix 'RX3 MIX1 INP1' 'RX1'
tinymix 'SPK DAC Switch' 1

However my DB410c card does not undergo any changes.

No idea I’m afraid.

That’s why I suggested you try the headphone settings first. I know that’s not what you’re trying to acheive but I think its possible that some of the headphone configuration may also be needed for speakers (the setting of RDAC2 MUX in particular attracted my attention).

You mean there is no audible change or that reading back the settings using tinymix shows that they did not change value?

There is no audible change. The main sound continues to come out over the HDMI port.

I need to know which [tinymix] command sets the Speaker to receive the primary audio. I do not want it to be on the HDMI port.

I’m afraid my advice doesn’t change much here.

Basically I think it is possible that the app-note may have enabled the speakers after already enabling the headphones (i.e. that there is something in the headphone settings that influences the speaker setting too). I’ve got no proof of that but its worth checking out.

I also think you should try applying the changes the get headphones working, check it (to make sure its all spelled right) and then try applying the speaker changes on top of that.