Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/glive.py
diff options
context:
space:
mode:
Diffstat (limited to 'glive.py')
-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