Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Drake <dsd@laptop.org>2010-04-29 14:08:37 (GMT)
committer Daniel Drake <dan@reactivated.net>2010-04-29 14:52:03 (GMT)
commit1b297e262385720a40ea7426017fffeae31f63d1 (patch)
tree8a1219903d0b8c075901c0125eee04d1c4366a6b
parent157adbc0cac15e60676d1733c49dfa163f8f8838 (diff)
Attempt to record audio from plughw:0,0
Improves A/V sync, for reasons not entirely known.
-rw-r--r--glive.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/glive.py b/glive.py
index 525fb62..43ee413 100644
--- a/glive.py
+++ b/glive.py
@@ -119,6 +119,15 @@ class Glive:
def createAudioBin ( self ):
src = gst.element_factory_make("alsasrc", "absrc")
+
+ # attempt to use direct access to the 0,0 device, solving some A/V
+ # sync issues
+ src.set_property("device", "plughw:0,0")
+ hwdev_available = src.set_state(gst.STATE_PAUSED) != gst.STATE_CHANGE_FAILURE
+ src.set_state(gst.STATE_NULL)
+ if not hwdev_available:
+ src.set_property("device", "default")
+
srccaps = gst.Caps("audio/x-raw-int,rate=16000,channels=1,depth=16")
# without a buffer here, gstreamer struggles at the start of the