You are on page 1of 32

Qualcomm Technologies, Inc.

SDM660/SDM630 Audio Bringup Guide

80-P8754-50 B
February 24, 2017

Confidential and Proprietary – Qualcomm Technologies, Inc.

NO PUBLIC DISCLOSURE PERMITTED: Please report postings of this document on public servers or websites to:
DocCtrlAgent@qualcomm.com.
Restricted Distribution: Not to be distributed to anyone who is not an employee of either Qualcomm Technologies, Inc. or its
affiliated companies without the express approval of Qualcomm Configuration Management.
Not to be used, copied, reproduced, or modified in whole or in part, nor its contents revealed in any manner to others without the
express written permission of Qualcomm Technologies, Inc.
Qualcomm and QXDM Professional are trademarks of Qualcomm Incorporated, registered in the United States and other countries.
Other product and brand names may be trademarks or registered trademarks of their respective owners.
This technical data may be subject to U.S. and international export, re-export, or transfer (“export”) laws. Diversion contrary to U.S.
and international law is strictly prohibited.

Qualcomm Technologies, Inc.


5775 Morehouse Drive
San Diego, CA 92121
U.S.A.

© 2017 Qualcomm Technologies, Inc. All rights reserved.


Revision history

Revision Date Description


A January 2017 Initial release
B February 2017 Numerous updates were made to this document to include SDM630
chipset information; to be read in its entirety

80-P8754-50 B Confidential and Proprietary – Qualcomm Technologies, Inc. 2


MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Contents

1 Introduction...................................................................................................... 6
1.1 Purpose.......................................................................................................................... 6
1.2 Conventions .................................................................................................................. 6
1.3 Technical assistance ...................................................................................................... 6

2 Bringup with internal codec ........................................................................... 7


2.1 Prerequisites .................................................................................................................. 7
2.2 Audio bringup workflow............................................................................................... 8
2.3 Select the correct DT file .............................................................................................. 9
2.4 Verify that the PIL has loaded the DSP successfully.................................................... 9
2.5 Disable WSA speaker amp ......................................................................................... 10
2.6 Register sound card ..................................................................................................... 10
2.7 Verify codec registration............................................................................................. 11
2.8 Hardware design verification and related software configurations............................. 11
2.8.1 Headset and handset MICBIAS configuration ................................................ 11
2.8.2 NC and NO jack settings ................................................................................. 12
2.8.3 External capacitor settings ............................................................................... 12
2.8.4 Primary mic configuration ............................................................................... 12
2.8.5 MCLK .............................................................................................................. 12
2.9 Software modifications for integrated external audio components............................. 13
2.10 Verify audio-specific GPIO configuration................................................................ 13
2.10.1 Pin_ctl definition for PDM GPIOs ................................................................ 13
2.11 Verify audio paths ..................................................................................................... 15
2.11.1 Play back over speaker .................................................................................. 15
2.11.2 Play back over headphone ............................................................................. 15
2.11.3 Record through primary MIC (analog MIC) ................................................. 16
2.11.4 Record through secondary MIC (analog MIC) .............................................. 17
2.11.5 Record through headset MIC ......................................................................... 17
2.11.6 Record through primary MIC (digital MIC) .................................................. 17
2.11.8 MBHC ........................................................................................................... 20

3 Bringup with external codec – WCD9341 .................................................... 22


3.1 Prerequisite ................................................................................................................. 22
3.2 Audio bringup workflow............................................................................................. 23
3.3 Select the correct DT file ............................................................................................ 24
3.4 Verify that PIL has loaded DSP successfully ............................................................. 24
3.5 Register sound card ..................................................................................................... 25
3.6 Verify codec registration............................................................................................. 25
3.7 Verify hardware design and related software configuration ....................................... 25

80-P8754-50 B Confidential and Proprietary – Qualcomm Technologies, Inc. 3


MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
SDM660/SDM630 Audio Bringup Guide Contents

3.7.1 Headset and handset MICBIAS configuration ................................................ 25


3.7.2 Speaker WSA configuration ............................................................................ 25
3.7.3 NC and NO jack settings ................................................................................. 26
3.7.4 External capacitor settings ............................................................................... 26
3.7.5 Primary mic configuration ............................................................................... 27
3.7.6 MCLK .............................................................................................................. 27
3.8 Software modifications for integrated external audio components............................. 27
3.9 Verify audio-specific GPIO configuration.................................................................. 27
3.9.1 Pin_ctl definition for WSA GPIOs .................................................................. 28
3.10 Verify audio paths ..................................................................................................... 29
3.10.1 Play back over WSA stereo speaker .............................................................. 29
3.10.2 Play back over WSA mono speaker .............................................................. 30
3.10.3 Record through DMIC ................................................................................... 30
3.10.4 Record through AMIC2 ................................................................................. 31

A References..................................................................................................... 32
A.1 Related documents ..................................................................................................... 32
A.2 Acronyms and terms .................................................................................................. 32

80-P8754-50 B Confidential and Proprietary – Qualcomm Technologies, Inc. 4


MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
SDM660/SDM630 Audio Bringup Guide Contents

Figures
Figure 2-1 Audio bringup workflow ............................................................................................................ 8
Figure 3-1 Audio bringup workflow with external codec.......................................................................... 23

Tables
Table 2-1 SDM660/SDM630 GPIOs ......................................................................................................... 13
Table 3-1 SDM660/SDM630 GPIOs for external codec ........................................................................... 27

80-P8754-50 B Confidential and Proprietary – Qualcomm Technologies, Inc. 5


MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
1 Introduction

1.1 Purpose
This document describes how to bring up the audio modules on the SDM660/SDM630 chipset
Android platform.

1.2 Conventions
Function declarations, function names, type declarations, attributes, and code samples appear in a
different font, for example, #include.
Code variables appear in angle brackets, for example, <number>.
Commands to be entered appear in a different font, for example, copy a:*.* b:.
If you are viewing this document using a color monitor, or if you print this document to a color
printer, red boldface indicates code that is to be added, and blue strikethrough indicates code
that is to be replaced or removed.
Shading indicates content that has been added or changed in this revision of the document.

1.3 Technical assistance


For assistance or clarification on information in this document, submit a case to Qualcomm
Technologies, Inc. (QTI) at https://createpoint.qti.qualcomm.com/.
If you do not have access to the CDMATech Support website, register for access or send email to
support.cdmatech@qti.qualcomm.com.

80-P8754-50 B Confidential and Proprietary – Qualcomm Technologies, Inc. 6


MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
2 Bringup with internal codec

NOTE: This chapter describes the changes required for bringup with internal codec in the SDM660
chipset dtsi files. The dtsi files for SDM630 chipset follow a similar naming convention.

Following steps initiate the audio bringup process:


1. Verify if proper Device Tree (DT) file is picked up, see Section 2.3
2. Verify that the Peripheral Image Loader (PIL) has successfully loaded the DSP – See
Section 2.4
3. Verify that the sound card is registered – See Section 2.5
4. Verify the codec registration – See Section 2.7
5. Verify the hardware design with the standard QTI reference schematics and make the
appropriate software changes – See Section 2.8
6. Provide guidelines to modify the software when external audio components are integrated –
See Section 2.9
7. Verify audio-specific GPIO configurations – See Section 2.10
8. Verify the audio paths – See Section 2.11

2.1 Prerequisites
1. Complete the audio hardware schematic review with QTI Customer Engineering (CE)
hardware team.
a. Follow the audio hardware schematic review checklist.
b. Initiate a hardware design review through Salesforce with a new case through New Case
> Record Type of new Record > Design Review.
2. Ensure that all hardware design review comments are implemented.

80-P8754-50 B Confidential and Proprietary – Qualcomm Technologies, Inc. 7


MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
SDM660/SDM630 Audio Bringup Guide Bringup with internal codec

2.2 Audio bringup workflow


Figure 2-1 shows the overall audio bringup workflow.

Step1:
Verify if ADSP is initialized
Design Phase start successfully

Step2:
Verify if sound card is
registered

CE review HW YES
design
Step3
NO Verify codec registration
80-P7747-5C

QCT HW CE team
share review
comments Step4
Verify Tx (capture) &
Rx(render) audio endpoints in
HW configuration

All HW changes Step5.1:


implemented Integrate external MI2S device
Step5: SDM660/SDM630 External MI2S
Verify audio specific GPIOs for Interface Overview (80-P8754-41)
external I2S device(if any)

Review audio MI2S GPIO


YES configuration
Is external MI2S 80-P7747-1 and 80-P7865-1
being used?

NO
1. Verify all SW changes have been
implemented correctly
2. Without this speaker/3rd party DAC
Step6: will not be functional
Verify all audio render and
capture paths

End of
functionality test

Figure 2-1 Audio bringup workflow

80-P8754-50 B Confidential and Proprietary – Qualcomm Technologies, Inc. 8


MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
SDM660/SDM630 Audio Bringup Guide Bringup with internal codec

2.3 Select the correct DT file


Following are the dtsi files for internal codec.
sdm660-internal-codec-pm660a-mtp.dts
sdm660-internal-codec-pm660a-cdp.dts
sdm660-internal-codec-mtp.dts
sdm660-internal-codec-cdp.dts

The following (similar) messages in bootup log signifies that proper DT file, sdm660-internal-
codec- -mtp.dts is picked.
Machine: Qualcomm Technologies, Inc. SDM 660 PM660 + PM660L Int. Audio
Codec CDP
 Files applicable for AMOLED display:
sdm660-internal-codec-pm660a-mtp.dts
sdm660-internal-codec-pm660a-cdp.dts
 Files applicable for normal LCD panel:
sdm660-internal-codec-mtp.dts
sdm660-internal-codec-cdp.dts

2.4 Verify that the PIL has loaded the DSP successfully
Locate the following log marker, which indicates that the PIL, has loaded the aDSP image
successfully:
subsys-pil-tz 15700000.qcom,lpass: adsp: loading from 0x0000000092a00000 to
0x0000000094800000
subsys-pil-tz 15700000.qcom,lpass: adsp: Brought out of reset
apr_tal_link_state_cb: edge[lpass] link state[0]
subsys-pil-tz 15700000.qcom,lpass: Subsystem error monitoring/handling
services are up
subsys-pil-tz 15700000.qcom,lpass: adsp: Power/Clock ready interrupt
received

NOTE: If this message is not present in the bootup log, either the aDSP image is not loaded or the DSP
has crashed.

Perform the following steps only if the message is not present.


1. Locate the module adsp-loader.o in the obj\KERNEL_OBJ\drivers\soc\qcom\qdsp6v2\ folder.
2. Add the following command to the init.target.rc file:

write /sys/kernel/boot_adsp/boot 1

Usually, the aDSP image is loaded statically. The aDSP images require proper configuration in
the source code for accurately loading into the RAM.

80-P8754-50 B Confidential and Proprietary – Qualcomm Technologies, Inc. 9


MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
SDM660/SDM630 Audio Bringup Guide Bringup with internal codec

3. Locate the CONFIG_MSM_ADSP_LOADER configuration macro in /kernel/msm-


4.4/arch/arm/ configs/msm_defconfig.

CONFIG_MSM_ADSP_LOADER=y

4. Ensure that the following code is present in the kernel/msm-4.4/drivers/soc/qcom/Kconfig


file:

config MSM_ADSP_LOADER
tristate "ADSP loader support"
selec t SND_SOC_MSM_APRV2_INTF
depends on MSM_QDSP6_APRV2|| MSM_QDSP6_APRV3 || \
MSM_QDSP6_APRV2_GLINK || MSM_QDSP6_APRV3_GLINKhelp
Enable ADSP image loader.
The ADSP loader brings ADSP out of reset
for the platforms that use APRv2.
Say M if you want to enable this module.

2.5 Disable WSA speaker amp


To disable WSA speaker amp in internal codec configuration, add the following code in msm-
audio.dtsi file.

--- a/arch/arm/boot/dts/qcom/msm-audio.dtsi
+++ b/arch/arm/boot/dts/qcom/msm-audio.dtsi
status = "disabled";
compatible = "qcom,sdm660-asoc-snd";
qcom,model = "sdm660-snd-card";
+ qcom,wsa-disable;
qcom,wcn-btfm;
qcom,mi2s-audio-intf;
qcom,auxpcm-audio-intf;

NOTE: WSA speaker amp is enabled by default with internal codec configuration.

2.6 Register sound card


The sound card is enumerated after the DAI links are mapped as follows:
1. Verify sound card registration

adb root
adb shell
cat /proc/asound/cards

2. Locate sound card name sdm660-snd-card-mtp

80-P8754-50 B Confidential and Proprietary – Qualcomm Technologies, Inc. 10


MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
SDM660/SDM630 Audio Bringup Guide Bringup with internal codec

2.7 Verify codec registration


Verify codec registration by following commands:
adb root
adb shell
cat /d/asoc/codecs
Locate for the following codecs for internal codec.
msm_digital_codec
xxxx.qcom,spmi:qcom,pm660l@xx
Refer to SDM660/SDM630 Chipset Audio Hardware (80-P7747-5C) for hardware details.

2.8 Hardware design verification and related software


configurations

2.8.1 Headset and handset MICBIAS configuration


The following changes are made in the kernel/msm-4.4/arch/arm/boot/dts/msm-audio.dtsi file
depending on the hardware configuration for headset and handset.
 Headset with external MICBIAS

qcom,msm-hs-micbias-type = "external";
"MIC BIAS External2", "Headset Mic",
"AMIC2", "MIC BIAS External2",

 Headset with internal MICBIAS

qcom,msm-hs-micbias-type = "internal";
"MIC BIAS Internal2", "Headset Mic",
"AMIC2", "MIC BIAS Internal2",

 Handset with external MICBIAS

"MIC BIAS External", "Handset Mic",


"AMIC1", "MIC BIAS External",

 Handset with internal MICBIAS

"MIC BIAS Internal1", "Handset Mic",


"AMIC1", "MIC BIAS Internal1",

80-P8754-50 B Confidential and Proprietary – Qualcomm Technologies, Inc. 11


MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
SDM660/SDM630 Audio Bringup Guide Bringup with internal codec

2.8.2 NC and NO jack settings


Modify the following dtsi file parameters (0 for NC, 1 for NO) based on the jack settings:

int_codec: sound {

qcom,msm-mbhc-hphl-swh = <0>;
qcom,msm-mbhc-gnd-swh = <0>;

2.8.3 External capacitor settings


 Add the following command to the dtsi file if the handset has CAP.

qcom, msm-micbias1-ext-cap

 Add the following command to the dtsi file if the headset has CAP.

qcom,msm-micbias2-ext-cap

 Add both the commands if the headset and handset have CAP.

2.8.4 Primary mic configuration


To connect the primary mic to an audio input other than the default (audio input1), make the
following changes in the codec driver file.
If you are viewing this document using a color monitor, or if you print this document to a color
printer, red boldface indicates code that is to be added, and blue strikethrough indicates code
that is to be replaced or removed.

{"ADC1", NULL, "AMIC1"}


{"ADC2_INP2", NULL, "AMIC1"},

2.8.5 MCLK
The MSM™ chipset drives the master clock needed by the codec. The MCLK clock frequency
and the source of the clock are defined in the device tree. Based on the external codec and
external speaker amp requirements, the MCLK frequency is modified.
To modify the MCLK frequency, change the kernel/arch/arm/boot/dts/msm-audio.dtsi file as
follows:
int_codec: sound {

qcom,msm-mclk-freq = <9600000>;

80-P8754-50 B Confidential and Proprietary – Qualcomm Technologies, Inc. 12


MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
SDM660/SDM630 Audio Bringup Guide Bringup with internal codec

2.9 Software modifications for integrated external audio


components
Refer to SDM660/SDM630 External MI2S Interface Overview (80-P8754-41).

2.10 Verify audio-specific GPIO configuration


Table 2-1 shows the GPIOs defined for the SDM660/SDM630 audio subsystems to ensure that
the software is correctly configured as per QTI recommendations. The QTI CE hardware team
reviews the configuration as described in Section 2.1.

Table 2-1 SDM660/SDM630 GPIOs


PIN name GPIO # Comments
LPI_CDC_PDM_RX2 LPI_GPIO_25 Audio codec PDM 0 receives 2
LPI_CDC_PDM_RX1 LPI_GPIO_23 Audio codec PDM 0 receives 1
LPI_CDC_PDM_RX0 LPI_GPIO_21 Audio codec PDM 0 receives 0
LPI_CDC_PDM_TX0 LPI_GPIO_20 Audio codec PDM 0 transmits 0
LPI_CDC_PDM_SYNC LPI_GPIO_19 Audio codec PDM 0 sync
LPI_CDC_PDM_CLK LPI_GPIO_18 Audio codec PDM 0 clock
LPI_DMIC1_CLK LPI_GPIO_26 Digital MIC1 clock
LPI_DMIC1_DATA LPI_GPIO_27 Digital MIC1 data
LPI_DMIC2_CLK LPI_GPIO_28 Digital MIC2 clock
LPI_DMIC2_DATA LPI_GPIO_29 Digital MIC2 data
SWR_CLK GPIO_24 SoundWire clock
SWR_DATA GPIO_25 SoundWire data

Refer to SDM660 Device Specification (Advance Information) (80-P7747-1) and SDM630 Device
Specification (Advance Information) (80-P7865-1) for detailed information about audio GPIOs.

NOTE: Ensure that the following audio specific GPIOs are defined in the dtsi file
and the GPIO numbers are according to the MSM GPIO layout. The use cases in the machine
driver file determine the GPIO configurations.

2.10.1 Pin_ctl definition for PDM GPIOs


sdm660-lpi.dtsi
cdc_pdm_gpios_active: cdc_pdm_gpios_active {
mux {
pins = "gpio18", "gpio19",
"gpio20", "gpio21",
"gpio23", "gpio25";
function = "func1";
};

config {

80-P8754-50 B Confidential and Proprietary – Qualcomm Technologies, Inc. 13


MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
SDM660/SDM630 Audio Bringup Guide Bringup with internal codec

pins = "gpio18", "gpio19",


"gpio20", "gpio21",
"gpio23", "gpio25";
drive-strength = <8>;
};
};

cdc_pdm_gpios_sleep: cdc_pdm_gpios_sleep {
mux {
pins = "gpio18", "gpio19",
"gpio20", "gpio21",
"gpio23", "gpio25";
function = "func1";
};

config {
pins = "gpio18", "gpio19",
"gpio20", "gpio21",
"gpio23", "gpio25";
drive-strength = <2>;
};
};

cdc_comp_gpios_active: cdc_pdm_comp_gpios_active {
mux {
pins = "gpio22", "gpio24";
function = "func1";
};

config {
pins = "gpio22", "gpio24";
drive-strength = <8>;
};
};

cdc_comp_gpios_sleep: cdc_pdm_comp_gpios_sleep {
mux {
pins = "gpio22", "gpio24";
function = "func1";
};

config {
pins = "gpio22", "gpio24";
drive-strength = <2>;
bias-disable;
};
};

80-P8754-50 B Confidential and Proprietary – Qualcomm Technologies, Inc. 14


MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
SDM660/SDM630 Audio Bringup Guide Bringup with internal codec

2.11 Verify audio paths


Ensure that the following conditions are met in the MI2S interface:
 MI2S bit and word select clocks are running at the correct frequencies
 Data line contains data
 MCLK is running at the configured frequency

2.11.1 Play back over speaker


1. Start audio playback
2. Enable the Rx codec path (speaker device)

tinymix 'Speaker Boost' 'ENABLE'


tinymix 'RX3 MIX1 INP1' 'RX1'
tinymix 'RX3 Digital Volume' 67%
tinymix 'SPK' 'Switch'
tinymix 'INT0_MI2S_RX Channels' 'One'

3. Enable DSP AFE for playback over MI2S

tinymix 'INT0_MI2S_RX Audio Mixer MultiMedia1' 1

4. Play the PCM audio

tinyplay <filename.wav >

5. Stop audio playback


6. Disable the Rx codec path

tinymix 'RX3 MIX1 INP1' 'ZERO'


tinymix 'SPK' 'ZERO

7. Disable DSP AFE for audio playback over I2S

tinymix 'INT0_MI2S_RX Audio Mixer MultiMedia1' 0

2.11.2 Play back over headphone

1. Start audio playback


2. Enable the Rx codec path

tinymix 'RX1 MIX1 INP1' 'RX1'


tinymix 'RX2 MIX1 INP1' 'RX2'
tinymix 'RDAC2 MUX' 'RX2'
tinymix 'HPHL' 'Switch'

80-P8754-50 B Confidential and Proprietary – Qualcomm Technologies, Inc. 15


MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
SDM660/SDM630 Audio Bringup Guide Bringup with internal codec

tinymix 'HPHR' 'Switch'


tinymix 'INT0_MI2S_RX Channels' 'Two'

3. Enable DSP AFE for playback over MI2S

tinymix 'INT0_MI2S_RX Audio Mixer MultiMedia1' 1

4. Play the PCM audio

tinyplay <filename.wav >

5. Stop audio playback


6. Disable the Rx codec path

tinymix 'RX1 MIX1 INP1' 'ZERO'


tinymix 'RX2 MIX1 INP1' 'ZERO'
tinymix 'RDAC2 MUX' 'ZERO'
tinymix 'HPHL' 'ZERO'
tinymix 'HPHR' 'ZERO'
tinymix 'INT0_MI2S_RX Channels' 'One'

7. Disable DSP AFE for audio playback over I2S

tinymix 'INT0_MI2S_RX Audio Mixer MultiMedia1' 0

2.11.3 Record through primary MIC (analog MIC)


1. Enter the following commands:

#Enable DSP AFE for Audio Recording over I2S


tinymix 'MultiMedia1 Mixer INT3_MI2S_TX' 1
#Enable Codec TX Path
tinymix 'DEC1 MUX' 'ADC1'

2. Start audio recording:

tinycap /data/rec.wav

3. Disable sequence:

tinymix 'MultiMedia1 Mixer INT3_MI2S_TX' 0


tinymix 'DEC1 MUX' 'ZERO

80-P8754-50 B Confidential and Proprietary – Qualcomm Technologies, Inc. 16


MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
SDM660/SDM630 Audio Bringup Guide Bringup with internal codec

2.11.4 Record through secondary MIC (analog MIC)


1. Enter the following commands:
tinymix 'MultiMedia1 Mixer INT3_MI2S_TX' 1
tinymix 'DEC1 MUX' 'ADC2'
tinymix 'ADC2 MUX' 'INP3'

2. Start audio recording:


tinycap /data/rec.wav

3. Disable sequence:
tinymix 'MultiMedia1 Mixer INT3_MI2S_TX' 0
tinymix 'DEC1 MUX' 'ZERO'
tinymix 'ADC2 MUX' 'ZERO'

2.11.5 Record through headset MIC


1. Enter the following commands:
tinymix 'MultiMedia1 Mixer INT3_MI2S_TX' 1
tinymix 'DEC1 MUX' 'ADC2'
tinymix 'ADC2 MUX' 'INP2'
tinymix 'IIR1 INP1 MUX' 'DEC1'

2. Start audio recording:


tinycap /data/rec.wav

3. Disable sequence:
tinymix 'MultiMedia1 Mixer INT3_MI2S_TX' 0
tinymix 'DEC1 MUX' 'ZERO'
tinymix 'ADC2 MUX' 'ZERO'
tinymix 'IIR1 INP1 MUX' 'ZERO'

2.11.6 Record through primary MIC (digital MIC)


1. Enter the following commands:
tinymix 'MultiMedia1 Mixer INT3_MI2S_TX' 1
tinymix 'DEC1 MUX' 'DMIC3'

2. Start audio recording:


tinycap /data/rec.wav

3. Disable sequence:
tinymix 'MultiMedia1 Mixer INT3_MI2S_TX' 0
tinymix 'DEC1 MUX' 'ZERO'

80-P8754-50 B Confidential and Proprietary – Qualcomm Technologies, Inc. 17


MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
SDM660/SDM630 Audio Bringup Guide Bringup with internal codec

2.11.7 Voice call


In voice and VoLTE use cases, the device path and control path uses apps processor. All data is
exchanged between the voice firmware (encoders/decoders) and voice software.
For a call to be established, the MPSS is responsible for connection and packet exchange over the
network. It also informs the Qualcomm Radio Interface Layer (QCRIL) layer on the APSS about
the different states during the call establishment or teardown.
The QCRIL module interfaces with the MPSS and exchanges Qualcomm Modem Interface
(QMI) messages during an MO or MT voice call.

2.11.7.1 Apps processor path


The following processes take place in the apps processor.
1. The call manager module calls the setMode(MODE_INCALL) API in the audio manager to
indicate to the audio layer that a voice/VoLTE call is set up.
2. The call manager calls setMode(MODE_NORMAL) in the audio manager to indicate the
teardown of the voice/VoLTE layer.
3. QCRIL learns if the call is voice or VoLTE from the Radio Interface Layer (RIL) in the
Android telephony. It then calls AudioSystem::setParameters() and passes the following
information:
a. Call state information indicating the state to which the voice/VoLTE session should
transition
b. Session ID of the voice/VoLTE call
c. The qcril_am_call_audio_api(uint32 audio_vsid, uint32
audio_call_state) function in the
vendor/qcom/proprietary/qcril/qcril_qmi/qcril_am.cc file calls
AudioSystem::setParameters(0, keyValPairs) keyValPairs has the format
vsid=voice_vsid;call_state=state, where:
– vsid – key and voice_vsid is a unique session number indicating a VoLTE, Voice
QChat session
– call_state – key and state is a number indicating CALL_ACTIVE, CALL_INACTIVE,
CALL HOLD, and CALL_LOCAL_HOLD
– In the audio layer, the session IDs of voice call subscription are defined in
/hardware/qcom/audio/hal/voice_extn/voice_extn.c and
/hardware/qcom/audio/hal/voice_extn.h files

#define VOICEMMODE1_VSID 0x11C05000


#define VOICEMMODE2_VSID 0x11DC5000

– Call states are defined as follows:


#define BASE_CALL_STATE 1
#define CALL_INACTIVE (BASE_CALL_STATE)
#define CALL_ACTIVE (BASE_CALL_STATE + 1)
#define CALL_HOLD (BASE_CALL_STATE + 2)
#define CALL_LOCAL_HOLD (BASE_CALL_STATE + 3)

80-P8754-50 B Confidential and Proprietary – Qualcomm Technologies, Inc. 18


MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
SDM660/SDM630 Audio Bringup Guide Bringup with internal codec

d. The unique session ID for a VoLTE/voice call is passed from QCRIL to the audio layer
by calling AudioSystem::setParameters(). Eventually, the control flows through the APIs.

static int adev_set_parameters(struct audio_hw_device *dev, const


char *kvpairs)
|
int voice_set_parameters(struct audio_device *adev, struct
str_parms *parms)
|
int voice_extn_set_parameters(struct audio_device *adev,struct
str_parms *parms)
|
static int update_call_states(struct audio_device *adev,const
uint32_t vsid, const int call_state)
|
static int update_calls(struct audio_device *adev)

e. update_calls() function – Starts call (start_call()), stops call (stop_call()), to put call on
hold and update call states for the particular call session for which session ID is passed to
it.

01-13 14:17:40.638 212 1148 D voice_extn: update_calls: INACTIVE ->


ACTIVE vsid: 0x11C05000

f. start_call() function – Sets up the hostless PCM playback and capture sessions for the use
case passed to it.

01-13 14:17:40.638 212 1148 D voice: start_call: enter usecase:voice-


call

g. stop_call() function – Is used to tear down the hostless PCM playback and capture
sessions for the use case passed to it.

01-13 14:16:04.438 212 1152 D voice: stop_call: exit: status(0)

h. The mixer controls for setting up the data path in the DSP for a voice/VoLTE call –
Listed in device/qcom/<chipset>/mixer_paths.xml.
i. enable_audio_route() function – Sets the mixer controls for voice/VoLTE use cases. The
mixer controls for VoLTE invoke functions in the kernel, which in turn sends commands
to the DSP to set up the data path.
j. Commands to the DSP for managing the voice/VoLTE session – Sent by the voice driver,
implemented in the msm-pcm-voice-v2.c file in the kernel.
k. Default VoLTE voice or default modem voice strings – Passed within the command
payload sent from APSS to the DSP voice module. The strings indicate whether the
commands are specific for a voice/VoLTE session.

80-P8754-50 B Confidential and Proprietary – Qualcomm Technologies, Inc. 19


MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
SDM660/SDM630 Audio Bringup Guide Bringup with internal codec

2.11.7.2 Modem path


The VS layer provides the main interface to voice application clients. VS works as a gateway
between the protocol stack and the voice firmware for vocoder control and voice packet
exchanges.
In the current design, voice call goes through VS for all RATs.
VS is designed for more flexibility and efficient concurrency control between multiple clients.
Following message in QXDM Professional™ tool log shows that the client enables the VS.

Voice Recognition/Medium 17:30:17.889


vs.c 03152 vs_call(): VS_VOC_CMD_ENABLE cmd_id=0x00012e29,
rc=0x00000000

To get the QXDM Professional log with the required log mask, use QCATs vocoder playback
function to play vocoder packets and PCM separately. The following voice quality issues may be
present.
1. Rx path vocoder packet is OK but the PCM is not – Verify the voice Rx tuning parameters
2. Tx path PCM is OK but the vocoder packet is not – Verify the voice Tx tuning parameters.
3. Rx path vocoder packet is not OK – Input from protocol layer may not be correct. Check for a
CRC error. If no error is present, it could be a network issue.
4. Tx path vocoder packet is OK but noise is still heard on the far end – Check the vocoder input
voice samples. If the noise is present in the vocoder input, it could be a network issue.
5. Mute on Rx or Tx path – Caused due to device issues. Ensure that the codec widgets of the
device are correctly connected. Check if the gain is muted or not. Voice quality issues also
occur due to the vocoder packets and PCM playback.

2.11.8 MBHC
The codec driver detects headset insertion/removal and button press/release events using adb
shell. To verify, check the headset and button jacks created in MBHC driver
(wcd-mbhc-v2.c) by calling snd_soc_jack_new(). Event numbers are found in the kernel logs (X
indicates the button-jack input event number and Y indicates the headset-jack input event
number).

Input: sdm660-snd-card Button Jack as /devices/platform/soc-


audio.0/sound/card0/inputX
Input: sdm660-snd-card Headset Jack as /devices/platform/soc-
audio.0/sound/card0/inputY

2.11.8.1 Insert or remove headset


To verify headset insertion or removal, connect the target device to a PC via USB and run the
following adb commands (Y indicates the headset-jack input device event number):

#adb shell getevent /dev/input/eventY

80-P8754-50 B Confidential and Proprietary – Qualcomm Technologies, Inc. 20


MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
SDM660/SDM630 Audio Bringup Guide Bringup with internal codec

If the headset is inserted, the following messages are displayed in the adb shell window:

/dev/input/eventY: 0005 0002 00000001


/dev/input/eventY: 0005 0004 00000001 (this line is only present if headset
has a microphone)
/dev/input/eventY: 0000 0000 00000000

If the headset is removed the following messages are displayed in the adb shell window:

/dev/input/eventY: 0005 0002 00000000


/dev/input/eventY: 0005 0004 00000000 (this line present only if headset
has a microphone)
/dev/input/eventY: 0000 0000 00000000

The headset inserted or removed events are present in kernel logs too. Locate reporting insertion
or reporting removal in the log. Reporting insertion 1 indicates a headphone with no microphone.
Reporting insertion 3 indicates a headset with a microphone.

2.11.8.2 Headset button press or release


To verify whether the headset button is pressed or released, connect the target device to a PC via
USB and run the following adb commands (X indicates the headset-jack input device event
number):

#adb shell getevent /dev/input/eventX

If the headset button is pressed, the following messages are displayed in the adb shell window:

/dev/input/eventX: 0001 0001 00000001


/dev/input/eventX: 0000 0000 00000000

If the headset button is released, the following messages are displayed in the adb shell window:

/dev/input/eventX: 0001 0001 00000000


/dev/input/eventX: 0000 0000 00000000

Headset button press or release events are also present in the kernel logs. Locate button pressed
or button released. To enable kernel MBHC debugging logs, run the following adb commands:

#mount -t debugfs debugfs /sys/kernel/debug


#echo -n "file sdm660-common.c +p" >
/sys/kernel/debug/dynamic_debug/control
#echo -n "file msm-analog-cdc.c +p"
> /sys/kernel/debug/dynamic_debug/control
#echo -n "file msm-digital-cdc.c +p"
> /sys/kernel/debug/dynamic_debug/control

80-P8754-50 B Confidential and Proprietary – Qualcomm Technologies, Inc. 21


MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
3 Bringup with external codec – WCD9341

NOTE: This chapter describes the changes required for bringup with external codec in the SDM660
chipset dtsi files. The dtsi files for SDM630 chipset follow a similar naming convention.

The audio bringup process with external codec consists of the following steps:
1. Verify if proper DT (Device Tree) file is picked up – See Section 3.3
2. Verify that the PIL has successfully loaded the DSP – See Section 3.4
3. Verify that the sound card is registered – See Section 3.5
4. Verify the codec registration – See Section 3.6
5. Verify the hardware design with the standard QTI reference schematics and make the
appropriate software changes – See Section 3.7
6. Provide guidelines to modify the software when external audio components are integrated –
See Section 3.8
7. Verify audio-specific GPIO configurations – See Section 3.9
8. Verify the audio paths – See Section 3.10

3.1 Prerequisite
1. Complete the audio hardware schematic review with QTI Customer Engineering (CE)
hardware team.
a. Follow the audio hardware schematic review checklist.
b. Initiate a hardware design review through Salesforce with a new case through New Case
> Record Type of new Record > Design Review.
2. Ensure that all hardware design review comments are implemented.

80-P8754-50 B Confidential and Proprietary – Qualcomm Technologies, Inc. 22


MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
SDM660/SDM630 Audio Bringup Guide Bringup with external codec – WCD9341

3.2 Audio bringup workflow

Step1:
Verify if ADSP is initialized
Design Phase start successfully

Step2:
Verify if sound card is
registered

CE review HW YES
design
Step3
NO Verify codec registration
80-P7747-5C

QCT HW CE team
share review
comments Step4
Verify Tx (capture) &
Rx(render) audio endpoints in
HW configuration

All HW changes
implemented
Step5: Step5.1:
Verify audio specific GPIOs for Integrating external MI2S device
external I2S device(if any) 80-P8754-41

YES Review audio MI2S GPIO


configuration
Is external MI2S
80-P7747-1 and 80-P7865-1
being used?

NO
1. Verify all SW changes have been
implemented correctly
2. Without this speaker/3rd party DAC
Step6: will not be functional
Verify all audio render and
capture paths

End of
functionality test

Figure 3-1 Audio bringup workflow with external codec

80-P8754-50 B Confidential and Proprietary – Qualcomm Technologies, Inc. 23


MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
SDM660/SDM630 Audio Bringup Guide Bringup with external codec – WCD9341

3.3 Select the correct DT file


Following are the dtsi files for external codec.
sdm660-mtp.dts – For external codec, LCD display
sdm660-pm660a-mtp.dts – For external codec, AMOLED display

3.4 Verify that PIL has loaded DSP successfully


Locate the following log marker, which indicates that the PIL has loaded the aDSP image
successfully:

subsys-pil-tz 15700000.qcom,lpass: adsp: loading from 0x0000000092a00000 to


0x0000000094800000
subsys-pil-tz 15700000.qcom,lpass: adsp: Brought out of reset
apr_tal_link_state_cb: edge[lpass] link state[0]
subsys-pil-tz 15700000.qcom,lpass: Subsystem error monitoring/handling
services are up
subsys-pil-tz 15700000.qcom,lpass: adsp: Power/Clock ready interrupt
received

NOTE: If this message is not present in the bootup log, either the aDSP image is not loaded or the DSP
has crashed.

Perform the following steps only if the message is not present:


1. Check for the adsp-loader.o module in the obj\KERNEL_OBJ\drivers\soc\qcom\qdsp6v2\
folder.
2. Add the following command to the init.target.rc file:

write /sys/kernel/boot_adsp/boot 1

Usually, the aDSP image is loaded statically. The aDSP images require proper configuration in
the source code for accurately loading into the RAM.
3. Locate the CONFIG_MSM_ADSP_LOADER configuration macro in /kernel/msm-
4.4/arch/arm/ configs/msm_defconfig.

CONFIG_MSM_ADSP_LOADER=y

4. Ensure that the following code is present in the kernel/msm-4.4/drivers/soc/qcom/Kconfig


file:

config MSM_ADSP_LOADER
tristate "ADSP loader support"
select SND_SOC_MSM_APRV2_INTF
depends on MSM_QDSP6_APRV2|| MSM_QDSP6_APRV3 || \
MSM_QDSP6_APRV2_GLINK || MSM_QDSP6_APRV3_GLINK
help
Enable ADSP image loader.

80-P8754-50 B Confidential and Proprietary – Qualcomm Technologies, Inc. 24


MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
SDM660/SDM630 Audio Bringup Guide Bringup with external codec – WCD9341

The ADSP loader brings ADSP out of reset


for the platforms that use APRv2.
Say M if you want to enable this module.

3.5 Register sound card


The sound card is enumerated after the DAI links are mapped as follows:
1. Verify sound card registration with the following command in the adb shell:

adb root
adb shell
cat /proc/asound/cards

2. Ensure that an entry with sound card name “sdm660-tavil-snd-card” is present for WCD9341.

3.6 Verify codec registration


Verify codec registration by following commands:
adb root
adb shell
cat /d/asoc/codecs
Locate for the following codec
qcom,tavil-slim-pgd
Refer to SDM660/SDM630 Chipset Audio Hardware (80-P7747-5C) for hardware details.

3.7 Verify hardware design and related software


configuration

3.7.1 Headset and handset MICBIAS configuration


No changes are required for the WCD external codec configuration. The WCD external codec
does not take MICBIAS from PMIC, but generates MICBIAS.

3.7.2 Speaker WSA configuration


tavil_codec {
swr_master {
compatible = "qcom,swr-wcd";
#address-cells = <2>;
#size-cells = <0>;

wsa881x_0211: wsa881x@20170211 {
compatible = "qcom,wsa881x";
reg = <0x0 0x20170211>;
qcom,spkr-sd-n-node = <&wsa_spkr_wcd_sd1>;

80-P8754-50 B Confidential and Proprietary – Qualcomm Technologies, Inc. 25


MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
SDM660/SDM630 Audio Bringup Guide Bringup with external codec – WCD9341

};

wsa881x_0212: wsa881x@20170212 {
compatible = "qcom,wsa881x";
reg = <0x0 0x20170212>;
qcom,spkr-sd-n-node = <&wsa_spkr_wcd_sd2>;
};

wsa881x_0213: wsa881x@21170213 {
compatible = "qcom,wsa881x";
reg = <0x0 0x21170213>;
qcom,spkr-sd-n-node = <&wsa_spkr_wcd_sd1>;
};

wsa881x_0214: wsa881x@21170214 {
compatible = "qcom,wsa881x";
reg = <0x0 0x21170214>;
qcom,spkr-sd-n-node = <&wsa_spkr_wcd_sd2>;
};
};
};
};
The swr_master has four WSA entries. They are applicable if stereo WSA speakers are connected
to the WCD external codec via PDM interface. For mono WSA speaker, add two WSA entries
inside the swr_master node based on WSA chip ID ((reg = <0x00 0x20170211> and reg = <0x00
0x20170212) OR (reg = <0x00 0x21170213> and reg = <0x00 0x21170214>))

3.7.3 NC and NO jack settings


Modify the following dtsi file parameters (0 for NC, 1 for NO) based on the jack settings:
Add the following changes in the sound card node of the dtsi file:

sound {

qcom,msm-mbhc-hphl-swh = <0>;
qcom,msm-mbhc-gnd-swh = <0>;

3.7.4 External capacitor settings


There is no need to set/modify the external capacitor settings.

80-P8754-50 B Confidential and Proprietary – Qualcomm Technologies, Inc. 26


MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
SDM660/SDM630 Audio Bringup Guide Bringup with external codec – WCD9341

3.7.5 Primary mic configuration


To connect the primary mic to an audio input other than the default (audio input1), make the
following changes in the codec driver file wcd9335.c:

{"ADC1", NULL, "AMIC1"}


{"ADC2", NULL, "AMIC1"},

3.7.6 MCLK
The MSM drives the master clock needed by the codec. The MCLK clock frequency and the
source of the clock are defined in the device tree. Based on the external codec and external
speaker amp requirements, the MCLK frequency is modified.
To modify the MCLK frequency, change the kernel/arch/arm/boot/dts/msm-audio.dtsi file as
follows:

tavil_snd: sound-tavil{
……………………………………………………………………………,
……………………………………………………………………………,
qcom,msm-mclk-freq = <9600000>;
……………………………………………………………………………

3.8 Software modifications for integrated external audio


components
Refer to SDM660/SDM630 External MI2S Interface Overview (80-P8754-41) for more details.

3.9 Verify audio-specific GPIO configuration


Table 3-1 lists the GPIOs defined for the SDM660/SDM630 audio subsystems to ensure that the
software is correctly configured to QTI recommendations. The QTI CE hardware team must
review this configuration as described in Section 3.1.

Table 3-1 SDM660/SDM630 GPIOs for external codec


PIN name GPIO # Comments
DMIC0_CLK GPIO_89 Digital MIC0 clock
DMIC0_DATA GPIO_90 Digital MIC0 data
WSA_L_EN WCD_GPIO_1 Enable WSA speaker_L interface
WSA_R_EN WCD_GPIO_2 Enable WSA speaker_R interface

Refer to SDM660/SDM630 Chipset Audio Hardware (80-P7747-5C) for detailed information.


Ensure that the following audio-specific GPIOs are defined in the msm-audio.dtsi file and the
GPIO numbers are according to the MSM GPIO layout.

80-P8754-50 B Confidential and Proprietary – Qualcomm Technologies, Inc. 27


MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
SDM660/SDM630 Audio Bringup Guide Bringup with external codec – WCD9341

3.9.1 Pin_ctl definition for WSA GPIOs


sdm660-pinctrl.dtsi

spkr_1_wcd_en_active {
mux {
pins = "gpio2";
};
config {
pins = "gpio2";
output-high;
};
};

spkr_1_wcd_en_sleep: spkr_1_wcd_en_sleep {
mux {
pins = "gpio2";
};
config {
pins = "gpio2";
input-enable;
};
};

spkr_2_wcd_en_active: spkr_2_sd_n_active {
mux {
pins = "gpio3";
};
config {
pins = "gpio3";
output-high;
};
};

spkr_2_wcd_en_sleep: spkr_2_sd_n_sleep {
mux {
pins = "gpio3";
};
config {
pins = "gpio3";
input-enable;
};
};

80-P8754-50 B Confidential and Proprietary – Qualcomm Technologies, Inc. 28


MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
SDM660/SDM630 Audio Bringup Guide Bringup with external codec – WCD9341

3.10 Verify audio paths


Ensure that the following conditions are met in the MI2S interface:
 MI2S bit and word select clocks are running at the correct frequencies
 Data line contains data
 MCLK is running at the configured frequency

3.10.1 Play back over WSA stereo speaker


1. Run the following tinymix commands to prepare the front end and back end paths:

tinymix 'SLIM RX0 MUX' 'AIF1_PB'


tinymix 'CDC_IF RX0 MUX' 'SLIM RX0'
tinymix 'SLIM RX1 MUX' 'AIF1_PB'
tinymix 'CDC_IF RX1 MUX' 'SLIM RX1'
tinymix 'SLIM_0_RX Channels' 'Two'
tinymix 'RX INT7_1 MIX1 INP0' 'RX0'
tinymix 'RX INT8_1 MIX1 INP0' 'RX1'
tinymix 'COMP7 Switch' 1
tinymix 'COMP8 Switch' 1
tinymix 'SpkrLeft COMP Switch' 1
tinymix 'SpkrLeft BOOST Switch' 1
tinymix 'SpkrLeft VISENSE Switch' 1
tinymix 'SpkrLeft SWR DAC_Port Switch' 1
tinymix 'SpkrRight COMP Switch' 1
tinymix 'SpkrRight BOOST Switch' 1
tinymix 'SpkrRight VISENSE Switch' 1
tinymix 'SpkrRight SWR DAC_Port Switch' 1
tinymix 'SLIMBUS_0_RX Audio Mixer MultiMedia1' 1

2. Play the PCM audio:

tinyplay <filename.wav >

3. Stop audio playback.


4. Run the following tinymix commands to disable the front end and back end:

tinymix 'SLIM RX0 MUX' 'ZERO'


tinymix 'SLIM RX1 MUX' 'ZERO'
tinymix 'SLIM_0_RX Channels' 'One'
tinymix 'RX INT7_1 MIX1 INP0' 'ZERO'
tinymix 'RX INT8_1 MIX1 INP0' 'ZERO'
tinymix 'COMP7 Switch' 0
tinymix 'COMP8 Switch' 0
tinymix 'SpkrLeft COMP Switch' 0
tinymix 'SpkrLeft BOOST Switch' 0
tinymix 'SpkrLeft VISENSE Switch' 0
tinymix 'SpkrLeft SWR DAC_Port Switch' 0

80-P8754-50 B Confidential and Proprietary – Qualcomm Technologies, Inc. 29


MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
SDM660/SDM630 Audio Bringup Guide Bringup with external codec – WCD9341

tinymix 'SpkrRight COMP Switch' 0


tinymix 'SpkrRight BOOST Switch' 0
tinymix 'SpkrRight VISENSE Switch' 0
tinymix 'SpkrRight SWR DAC_Port Switch' 0
tinymix 'SLIMBUS_0_RX Audio Mixer MultiMedia1' 0

3.10.2 Play back over WSA mono speaker


1. Run the following tinymix commands to prepare the front end and back end paths:

tinymix 'SLIM RX0 MUX' 'AIF1_PB'


tinymix 'CDC_IF RX0 MUX' 'SLIM RX0'
tinymix 'SLIM_0_RX Channels' 'One'
tinymix 'RX INT7_1 MIX1 INP0' 'RX0'
tinymix 'COMP7 Switch' 1
tinymix 'SpkrLeft COMP Switch' 1
tinymix 'SpkrLeft BOOST Switch' 1
tinymix 'SpkrLeft VISENSE Switch' 1
tinymix 'SpkrLeft SWR DAC_Port Switch' 1
tinymix 'SLIMBUS_0_RX Audio Mixer MultiMedia1' 1
2. Play the PCM audio:

tinyplay <filename.wav >

3. Stop audio playback.


4. Run the following tinymix commands to disable the front end and back end:

tinymix 'SLIM RX0 MUX' 'ZERO'


tinymix 'RX INT7_1 MIX1 INP0' 'ZERO'
tinymix 'COMP7 Switch' 0
tinymix 'SpkrLeft COMP Switch' 0
tinymix 'SpkrLeft BOOST Switch' 0
tinymix 'SpkrLeft VISENSE Switch' 0
tinymix 'SpkrLeft SWR DAC_Port Switch' 0
tinymix 'SLIMBUS_0_RX Audio Mixer MultiMedia1' 0

3.10.3 Record through DMIC


1. Run the following tinymix commands to prepare the front end and back end paths:

tinymix 'AIF1_CAP Mixer SLIM TX7' 1


tinymix 'CDC_IF TX7 MUX' 'DEC7'
tinymix 'SLIM_0_TX Channels' 'One'
tinymix 'ADC MUX7' 'DMIC'
tinymix 'DMIC MUX7' 'DMIC2'
tinymix 'DEC7 Volume' 84
tinymix 'MultiMedia1 Mixer SLIM_0_TX' 1

80-P8754-50 B Confidential and Proprietary – Qualcomm Technologies, Inc. 30


MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
SDM660/SDM630 Audio Bringup Guide Bringup with external codec – WCD9341

2. Start audio recording:

tinycap /data/dmic0.wav -c 1 -r 48000

3. Stop audio recording.


4. Run the following tinymix commands to disable the front end and back end:
tinymix 'AIF1_CAP Mixer SLIM TX7' 0
tinymix 'CDC_IF TX7 MUX' 'ZERO'
tinymix 'SLIM_0_TX Channels' 'One'
tinymix 'ADC MUX7' 'ZERO'
tinymix 'DMIC MUX7' 'ZERO'
tinymix 'DEC7 Volume' 0
tinymix 'MultiMedia1 Mixer SLIM_0_TX' 0

3.10.4 Record through AMIC2


1. Run the following tinymix commands to prepare front end and back end paths:

tinymix 'AIF1_CAP Mixer SLIM TX7' 1


tinymix 'CDC_IF TX7 MUX' 'DEC7'
tinymix 'SLIM_0_TX Channels' 'One'
tinymix 'ADC MUX7' 'AMIC'
tinymix 'AMIC MUX7' 'ADC2'
tinymix 'DEC7 Volume' 84
tinymix 'MultiMedia1 Mixer SLIM_0_TX' 1
2. Start audio recording:

tinycap /data/amic5.wav -c 1 -r 48000

3. Stop audio recording.


4. Run the following tinymix commands to disable the front end and back end:

tinymix 'SLIM_0_TX Channels' 'One'


tinymix 'AIF1_CAP Mixer SLIM TX7' 0
tinymix 'CDC_IF TX7 MUX' 'ZERO'
tinymix 'ADC MUX7' 'ZERO'
tinymix 'AMIC MUX7' 'ZERO'
tinymix 'DEC7 Volume' 0
tinymix 'MultiMedia1 Mixer SLIM_0_TX' 0

80-P8754-50 B Confidential and Proprietary – Qualcomm Technologies, Inc. 31


MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
A References

A.1 Related documents


Title Number

Qualcomm Technologies, Inc.


SDM660/SDM630_Linux_Android_Audio_Overview 80-P8754-21
SDM660 Device Specification (Advance Information) 80-P7747-1
SDM660/SDM630 Chipset Audio Hardware 80-P7747-5C
SDM660/SDM630 External MI2S Interface Overview 80-P8754-41
Multibutton Headset Control 80-NL239-27
SDM630 Device Specification (Advance Information) 80-P7865-1

A.2 Acronyms and terms


Acronym or term Definition
DT Device tree
OMTP Open mobile terminal platform
PIL Peripheral image loader
QCRIL Qualcomm radio interface layer

80-P8754-50 B Confidential and Proprietary – Qualcomm Technologies, Inc. 32


MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION

You might also like