![PulseAudio:第一次 pacat 调用后声音正常](https://linux22.com/image/54786/PulseAudio%EF%BC%9A%E7%AC%AC%E4%B8%80%E6%AC%A1%20pacat%20%E8%B0%83%E7%94%A8%E5%90%8E%E5%A3%B0%E9%9F%B3%E6%AD%A3%E5%B8%B8.png)
我在 PulseAudio 和 gstreamer python 脚本(pygst)方面遇到了一个奇怪的问题。下面的脚本仅在我执行时才有效
cat /dev/urandom | pacat
前。
我完全不知道是什么原因造成的。还有谁?
脚本片段:
self.pipeline = gst.Pipeline("RadioPipe")
self.player = gst.element_factory_make("playbin", "player")
self.pipeline.add(self.player)
pulse = gst.element_factory_make("pulsesink", "cardname0")
self.player.set_property("audio-sink", pulse)
self.player.set_property('uri', self.mp3stream)
self.pipeline.set_state(gst.STATE_PLAYING)
系统:
pi@raspberrypi ~ $ uname -a
Linux raspberrypi 3.6.11+ #538 PREEMPT Fri Aug 30 20:42:08 BST 2013 armv6l GNU/Linux
pi@raspberrypi ~ $ dpkg -l | egrep "pulse|alsa" | awk '{ print $2 " - " $3}'
alsa-base - 1.0.25+3~deb7u1
alsa-utils - 1.0.25-4
gstreamer0.10-alsa:armhf - 0.10.36-1.1
gstreamer0.10-pulseaudio:armhf - 0.10.31-3+nmu1
libpulse0:armhf - 2.0-6.1
pulseaudio - 2.0-6.1
pulseaudio-module-x11 - 2.0-6.1
pulseaudio-utils - 2.0-6.1