QNX有如下两种方法dump pcm数据,可以录声卡之前的数据
1,
QNX自带的pcm_logger工具
工具位置:
qnx\qnx-sdp\target\qnx7\aarch64le\usr\bin\pcm_logger
//打开pcm dump
pcm_logger -l1
//关闭 pcm dump
pcm_logger -l0
数据保存到/dev/shmem
2,
This is how it has been tested:
-- To enable logging use the PLAYBACK_LOGGING and CAPTURE_LOGGING environment variables.
-- To log PCM data before it runs through the libasound conversion plugins assign a value of 'unprocessed' to the environment variable.
-- To log PCM data after it has run through the libasound conversion plugins assign a value of 'processed' to the environment variables.
Examples:
PLAYBACK_LOGGING=processed wave /myfile.wav
PLAYBACK_LOGGING=unprocessed wave /myfile.wav
CAPTURE_LOGGING=processed waverec -t5 /tmp/myfile.wav
CAPTURE_LOGGING=unprocessed waverec -t5 /tmp/myfile.wav
-- Logged PCM data files will be created under /dev/shmem with the following filename convention: direction_pid_processed/unprocessed_YYYYMMDD-HHmmssUTC.wav
Example: /dev/shmem/playback_1928374_processed_20120613-093433UTC.wav
Note that the length fields in the wave header are filled in when the client calls snd_pcm_close(), so if the client terminates without calling close those lengths will not be filled in and the logged file may not be playable by some media applications. In other words, please wait for the playback/capture to complete and do not terminate in between. Otherwise the PCM data captured file may not be playable on some media players.