我正在尝试播放 2 个通道,其中一个通道中的音频和另一个通道中的静音正在播放。
$ gst-launch \
interleave name=i ! alsasink
filesrc location=/home/test1.mp3 \
! decodebin ! audioconvert \
! audio/x-raw-int,channels=1 ! i. \
audiotestsrc wave=silence \
! decodebin ! audioconvert \
! audio/x-raw-int,channels=1 ! volume volume=1.0 ! i.
10 秒后,我想在第一个频道播放静音,在第二个频道播放一些音频。
$ gst-launch \
interleave name=i ! alsasink \
audiotestsrc wave=silence \
! decodebin ! audioconvert \
! audio/x-raw-int,channels=1 ! i. \
filesrc location=/home/test2.mp3 \
! decodebin ! audioconvert \
! audio/x-raw-int,channels=1 ! volume volume=1.0 ! i.
这可以在 PC 端完成,同时在两个不同的终端中播放这些管道或让其中一个在后台运行。但是当我在 am335x 板上播放一个管道并尝试播放另一个时,它是这样的:
Setting pipeline to PAUSED ...
ERROR: Pipeline doesn't want to pause.
ERROR: from element /GstPipeline:pipeline0/GstAlsaSink:alsasink0: Could not open audio device for playback.
Device is being used by another application.
Additional debug info:
gstalsasink.c(697): gst_alsasink_open (): /GstPipeline:pipeline0/GstAlsaSink:alsasink0:
Device 'default' is busy
Setting pipeline to NULL ...
Freeing pipeline ...
当我们签入 gstalsasink.c 时,它以非阻塞模式调用 snd_pcm_open 。
CHECK (snd_pcm_open (&alsa->handle, alsa->device, SND_PCM_STREAM_PLAYBACK,
SND_PCM_NONBLOCK), open_error);
那为什么它会阻止其他事件来使用音频设备呢?
任何人都可以建议我为目标端做什么,因为 PC 端 alsasink 是完美的。