From 1b297e262385720a40ea7426017fffeae31f63d1 Mon Sep 17 00:00:00 2001 From: Daniel Drake Date: Thu, 29 Apr 2010 14:08:37 +0000 Subject: Attempt to record audio from plughw:0,0 Improves A/V sync, for reasons not entirely known. --- 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 -- cgit v0.9.1