This article was reproduced from: Http://blog.csdn.net/kris_fei/article/details/72783843?locationNum=9&fps=1
Platform:rockchip
Os:android 6.0
kernel:3.10.92
Phenomenon :
The recording uses a 1K sine wave as the data source to test, then compares the HAL and the app layer dump out of the PCM data, found that the app layer is relatively small volume of the HAL layer.
reason :
It was later discovered that there was a noise reduction algorithm called Speex on the HAL layer, which would have a fixed signal decay, so the volume became smaller. The RK documentation has actually also been explained:
Using the Speex open-source algorithm library, the recording default on the noise reduction algorithm, you can filter some of the noise, but also the background sound will be filtered part. At the same time if the input signal is a fixed signal such as 1K sine wave signal, because the algorithm is for the voice signal, the fixed signal has the effect of attenuation, so 1K sine wave This is much smaller than the actual gain.
Close Method :
Diff--git A/tinyalsa_hal/audio_hw.h B/tinyalsa_hal/audio_hw.h
Index b7f1f6e: b43e400 100755
---a/tinyalsa_hal/audio_hw.h
+ + B/tinyalsa_hal/audio_hw.h
@@ -106,7 +106,7 @@ -106,7 pcm_card_spdif = 2;
#define MAX_SUPPORTED_CHANNEL_MASKS 2
#ifndef RK3368
-#define Speex_denoise_enable
+//#define Speex_denoise_enable^m
#endif
[RK3288] [Android6.0] Debug Notes---Recording volume from Hal to app layer will become smaller problem "turn"