问题描述
I9505运行在APQ8064T以及如何HAL层建立的通话录音里的芯片组音频路径的方式相比,previous代MSM8960发生了变化。现在,除了设置在内核正确的混音控制,它也需要通过libcsd-client.so(高通专有的,靠近源)库发送某种魔力命令给基带调制解调器。
I9505 runs on APQ8064T and the way how the HAL layer set up the in-call voice recording audio path on the chipset has changed compared to the previous generation MSM8960. Now, in addition to set correct Mixer controls in Kernel, it also requires sending some sort of "magic" commands through libcsd-client.so (Qualcomm proprietary, close source) library to the baseband modem.
谷歌通过对dlsym的libcsd-client.so做这行了Nexus 4(运行APQ8064)在HAL层(请参阅 csd_start_record 功能)。但是,使用AudioRecord API与MediaRecorder.AudioSource.VOICE_DOWNLINK在应用层面将无法工作,因为 AudioPolicyManagerBase.cpp 已经很难codeD采取IOProfile与渠道面具AUDIO_CHANNEL_IN_MONO或AUDIO_CHANNEL_IN_STEREO而已,而在通话中录音用的情况下,通道蒙版在使用中,必须为AUDIO_CHANNEL_IN_VOICE_UPLINK或AUDIO_CHANNEL_IN_VOICE_DNLINK。看来谷歌和三星无意解决此问题。这是奇怪的,对于记录呼叫公众的Android API是从来没有保证工作正常。
Google does this for the Nexus 4 (runs APQ8064) at the HAL layer by dlsym the libcsd-client.so (see the csd_start_record function). However, using the AudioRecord API with MediaRecorder.AudioSource.VOICE_DOWNLINK at App level won't work because AudioPolicyManagerBase.cpp has been hardcoded to take in IOProfile with channel mask "AUDIO_CHANNEL_IN_MONO" or "AUDIO_CHANNEL_IN_STEREO" only, while in the in-call voice recording use case, the channel masks in use has to be either AUDIO_CHANNEL_IN_VOICE_UPLINK or AUDIO_CHANNEL_IN_VOICE_DNLINK. It seems both Google and Samsung has no intention to correct this problem. This is weird that public android API for recording call is never guaranteed to work properly.
所以,为了解决这个问题,我决定写一个NDK可执行文件来对dlsym的csd_start_recording / csd_stop_recording一样的方式,谷歌已经进行的Nexus 4进行,并使用AMIX / AREC工具做有根的设备上记录本身。但是,现在问题来了。
So, to overcome this issue, I decided to write a NDK executable to dlsym the csd_start_recording/csd_stop_recording just the same way as Google has done for Nexus 4 and use amix/arec utility to do recording natively on a rooted device. But now the question comes.
在我的可执行文件,我叫csd_client_init和csd_start_record,无论调用返回任何错误,但显示的logcat从libcsd-client.so一些QMI(高通MSM接口)的错误,并记录波形文件无关,但沉默。是否有任何身体尝试的事情与此类似?我现在完全失去了主意如何获得通话录音工作,而无需修改的ROM刷新到设备上。
In my executable, I called csd_client_init and csd_start_record, both invocations returned no errors, but logcat shows some QMI(Qualcomm MSM Interface) error from the libcsd-client.so and recorded wave file had nothing but silence. Does any body tried things similar to this? I'm now totally out of idea how to get call recording working without having to flash modified ROM to the device.
更新
我反复测试了,但似乎QMI错误都没有了。我想QMI错误,我遇到了最后一次是由于这样的事实,我已经搞砸机的状态在测试过程中。然而,记录仍然无法正常工作。结果还是只有沉默。下面是我用grep的惩教署的logcat的输出:
I repeated the test again, but it seems the QMI errors are gone. I guess QMI errors I met last time was due to the fact that I've messed up the state of machine during the test. However, recording still doesn't work. Result is still silence only. Below is the logcat output that I grep by "csd":
D/ ( 217): csd_client_disable_device: rx 7, tx 4, client_state=1
E/ ( 217): csd_client_disable_device: Disable received in invalid state:1
D/ ( 217): csd_client_enable_device: APQ rx 7, tx 34, ec 43, tty 0x10012 state 1
D/ ( 217): csd_client_enable_device: Remote rx -1, tx -1
E/ ( 217): csd_client_enable_device: Enable received in invalid state 1
D/ ( 217): csd_client_start_voice: State 1
D/ ( 217): csd_client_async_cb: msg_id 0x33 result 0 error 0
D/ ( 217): csd_client_async_cb: msg_id 0x34 result 0 error 0
D/ ( 217): csd_client_async_cb: msg_id 0x55 result 0 error 0
D/ ( 217): csd_client_async_cb: msg_id 0x5c result 0 error 0
D/ ( 217): csd_client_async_cb: msg_id 0x4c result 0 error 0
D/ ( 217): csd_client_async_cb: msg_id 0x4c result 0 error 0
D/ ( 217): csd_client_async_cb: msg_id 0x57 result 0 error 0
D/ ( 217): csd_client_async_cb: msg_id 0x36 result 0 error 0
D/ ( 217): csd_client_async_cb: msg_id 0x3e result 0 error 0
D/ ( 217): csd_client_async_cb: msg_id 0x36 result 0 error 0
D/ ( 217): csd_client_volume: volume 0, state 2, rc 0
D/ ( 217): csd_client_async_cb: msg_id 0x37 result 0 error 0
D/ ( 217): csd_client_set_rx_mute: mute 0, state 2, rc 0
D/ ( 217): csd_client_async_cb: msg_id 0x3e result 0 error 0
D/ ( 217): csd_client_mic_mute: mute 0, state 2, rc 0
D/ ( 217): csd_client_async_cb: msg_id 0x36 result 0 error 0
D/ ( 217): csd_client_volume: volume 4, state 2, rc 0
D/ ( 6801): csd_client_init
E/ ( 6801): csd_client_service_init: Invalid rx device 0, setting to handset
E/ ( 6801): csd_client_service_init: Invalid tx device 0, setting to handset
D/ ( 217): csd_client_stop_voice: State 2
D/ ( 217): csd_client_async_cb: msg_id 0x58 result 1 error 3
E/ ( 217): csd_client_stop_voice: Error -1 stopping voice manager
E/ALSADevice( 217): s_close: csd_client error -1
PID 217是对设备的原始csd_client,PID 6801是我的可执行文件。
PID 217 is the original csd_client on device, PID 6801 is my executable.
我的可执行文件做客户端初始化并呼吁libcsd-client.socsd_start_recording后一起建立呼叫。从日志看,很明显,真正的CSD客户端是干什么用的调制解调器通过注册一些回调时,设备将引导并从那时起调节音频设置双向通信。例如,csd_client_start_voice被称为由HAL当呼叫获得通过。我怀疑我的伪造CSD客户端是错过了所有的中间状态,结果,失败的目的。
My executable do the client initialisation and call "csd_start_recording" on libcsd-client.so together AFTER a call is established. Seen from the log, it's obvious that the "real" csd-client is doing two-way communication with the modem by registering some callbacks when the device boots and regulating audio settings from then on. For example, "csd_client_start_voice" is called by HAL when the call gets through. I suspect my faked csd-client is missing out all those intermediate states, as a result, failed the purpose.
总之,信息实在有限,在这个阶段,我感觉像在黑暗中拍摄。希望有人能帮助这里。
Anyway, info is really limited at this stage, and I'm feeling like shooting in the dark. Hope someone can help here.
推荐答案
我有解决方案。基本上,你必须调用medisaserver因为的没有的在libcsd的东西会工作,除非你是语音会话的所有者。 avs234.net/temp/csd_calls.c
I have the solution. Basically, you have to call medisaserver because nothing in libcsd stuff would work unless you are the owner of that voice session. avs234.net/temp/csd_calls.c
这篇关于是有可能的动态链接libcsd-client.so,使呼叫录音银河S4 I9505的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!