Android audio subsystem (driver+android)

MBHC: Multibutton Headset Control, multi-button headset control, is the most commonly used mechanism in mobile phone line-controlled headsets
MBHC Detection: multi-button headset control detection

A headset is an integration of a headset and a microphone, which is different from an ordinary headset. Ordinary earphones are often stereo, and the headset is mostly mono. At the same time, the earphone has a microphone that ordinary earphones do not have. The headsets are divided into wireless headsets and wired headsets. These two headsets have their own characteristics.

A headset is an integration of a headset and a microphone. In fact, the headset is integrated with the microphone.

The difference and use of Line-in and Mic-in and Line-out

mic in、line in&line out、speaker out、headphone out 区别

Linux drives ALSA model:

Linux ALSA sound card driver 1: Introduction to ALSA architecture
Linux ALSA sound card driver 2: Sound card creation
Linux ALSA sound card driver 3: PCM device creation
Linux ALSA sound card driver 4: Control device creation
Linux ALSA sound card driver 5: Mobile ALSA in the device (ASoC)
Linux ALSA sound card driver 6: Machine
Linux in ASoC architecture ALSA sound card driver 7: Codec in ASoC architecture
Linux ALSA sound card driver 8: Platform in ASoC architecture

Detailed explanation of DAPM in ALSA sound card driver:

One of the detailed explanations of
DAPM in the ALSA sound card driver : kcontrol The second one of DAPM in the ALSA sound card driver: widget-kcontrol with path and power management information The
third of
DAPM in the ALSA sound card driver : how to define various widgets in the ALSA sound card driver DAPM detailed four: initialize and register widget and route in the
driver. DAPM detailed five in the ALSA sound card driver: establish the connection relationship between widgets.
DAPM detailed six in the ALSA sound card driver: the essence lies in the whole body
DAPM Detailed seven ALSA sound drivers are: dapm event mechanism (dapm event)

Linux ALSA Audio System: Physical Link Chapter
Linux ALSA Audio System: Logical Device Chapter

Qualcomm platform

ASOC audio path analysis of Qualcomm msm8996 platform (based on androidN and linux3.1x)
qcom audio-related dsp driver notes (based on msm8996 platform)
PA power management on Qualcomm msm8996 platform (wsa881x)
Qualcomm Audio HAL audio path setting
[audio] headphone plug Pull/wire control button recognition process
Qualcomm platform headset detection (msm8909)
Qualcomm platform headset plug detection
Qualcomm platform audio debugging notes
Qualcomm platform headset knowledge record
Qualcomm audio MBHC headset system software related configuration summary

DAPM (two)

DAPM one: Overview
DAPM two: audio paths and dapm kcontrol
DAPM three: audio paths and asound.conf
DAPM five: in-depth analysis of dapm mechanism (on)
DAPM six: in-depth analysis of dapm mechanism (on)

Android audio system

Android audio system: from AudioTrack to AudioFlinger AudioPolicyService of
Android audio system in-
depth analysis of AudioPolicyService of
Android audio AudioFlinger of Android audio system (1) AudioFlinger of
Android audio system (2) AudioFlinger of
Android audio system (3) AudioFlinger of
Android audio system (4) )
AudioTrack of Android Audio System (1) AudioTrack of
Android Audio System (2)

Pop sound guide of audio driver

POP sound refers to the popping sound generated by the transient impact caused by various operations of audio devices at the moment of power-on, power-off, and after power-on.

1. Reasons for pop sound

(1) Module (the signal from the communication module has pulse skipping) The
solution: before the module is turned on or off, the audio gain of the module is faded.
(2) PA generation
Solution idea: gradual processing of PA gain
(3) CODEC generation
Solution idea: control selection of sound card path sequence, and gradual processing of sound card gain

2. Some scenes of pop sound

(1) When answering the phone, the
solution: first open the module audio channel, and then set the audio mode when the other party is ringing (phone), then set the gain of the codec to the minimum, then
perform the gradual process on the power amplifier, and finally the codec The gain is increased to the normal size.
(2) When actively hanging up the phone.
Solution: First, the phone sets the audio mode within the first time when the hangup state is acquired, and then performs other operations. Second, the power amplifier is gradually reduced, and
finally the codec is set.
(3) Passively hang up the phone.
Solution: If it is not the pop sound generated by the module, the solution is the same as the active hang up scenario. If it is generated by a module, the module needs to
do the gradual change when the call is hung up .
(4)
Solution when switching equipment : Mainly add delay when switching equipment.
(5) Play music/music switch
Solution: When the player is turned on or the music switch is paused, the volume is gradually changed.

Noise & pop noise solutions

1. The loudspeaker has serious "creaking" and broken sound. Most of the reasons may be the unstable V(out) voltage, so it is best to measure the output voltage when there is no load. At the same time, it can also measure VCC-the output/input voltage of boost. The normal VCC can be obtained by the customer's feedback resistance and VCC load resistance.

2. The customer has noise: It is estimated that it is signal interference. Generally, the interference factor of the power supply accounts for the largest proportion. It is recommended to measure the quiescent current IQ.

3. POP tone: After all, this POP tone is caused by the DC level jump on the earphone channel when the codec starts to work; there will be no negative voltage on mobile phones or general handheld devices, and the audio signal must be at a DC level (For example, on 1/2VDD), such a DC jump from 0 level to 1/2VDD will inevitably produce POP sound on the earphone after passing through the DC blocking capacitor. After all, the sound of capacitor charging and discharging was put aside.

4. How to reduce the POP tone:
Method 1: Generally speaking, the POP tone on the IC and when the power is off is caused by the instantaneous jump of the bias voltage. Therefore, in order to reduce the POP sound, the transient of the paranoid voltage Vbias of the IC must be suppressed. The reflection method on the layout is to increase the filter capacitor of Vbias. For TPA6132, the reference design is 1 uF, but the bias capacitance becomes too large, which will cause the IC's settling time to become longer, which will make people feel that the sound has not come out for a long time. In addition, too large capacitance will cause THD+N to deteriorate.
Method 2: For TPA6132, we change the timing to turn off the class before the noise comes out, and modify the timing of Depop_mute# and Speaker_mute# through software to make it turn off in advance.
Method 3: Power-on noise, noise bounced off the ground plane (such as the pop sound caused by ground noise that is not controlled by speak off after the beep pin of some decoding chips is grounded), etc. The first thing is to find out the source. Find another way. If you can't find it or you can't solve it after finding it, you can try to string a resistor to suppress the amplitude of the pop sound. Of course, this also reduces the maximum volume of the headset.
Method 4: There is another method: the method of pre-charging, coupled with the pull-up and pull-down resistors to stabilize the DC voltage of the capacitor, the effect may be better. Of course, you must first confirm how high the DC bias 1/2VDD is (some can be set, some are fixed), and then the size of the pull-up and pull-down resistors can be designed. After adjustment, the effect is OK, and the pop noise is almost invisible .
Method 5: Now some CODECs have a register in the software to set the rise time of this DC level, so that it jumps to 1/2VDD in a certain period of time, instead of a very steep rising edge, which can improve this to a certain extent POP sound.

5. The POP sound problem of switching on and off is currently the bottleneck problem of the entire audio amplifier. The best solution is method two. For our demo, for example, when switching songs, you can first press EN to give him a low signal, and then release it when the music switching ends.

6. Supplement: If the left and right channels are output in a fully differential mode, then no DC blocking capacitor is needed, but the standard four-wire headphone jack cannot be used for headphones. This fully differential method is generally used for headphones Dedicated output plug (shared with debugging interface).

7. Pay special attention to the common ground during DEMO to reduce the possibility of POP sound generation. There will also be standards for detection.

Guess you like

Origin blog.csdn.net/weixin_44991625/article/details/109379876