How do I keep an audio source from falling back to stereo?

Christian Leichsenring cleichsenring at techfak.uni-bielefeld.de
Thu Jul 24 10:20:01 PDT 2014


Hi,

I'm sure this is explained somewhere on the net but I just couldn't
find so sorry in advance.

Anyway, I'm trying to get 28 channels out of a jackaudiosrc but as soon
as I connect say a deinterleave element, the source will fall back to
the 2-channel setup that works without any channel mask. My attempts at
setting a channel mask have been futile though.

Here's what happens (the second line is shortened because 28 times
GST_AUDIO_CHANNEL_POSITION_NONE makes the thing somewhat illegible and
breaks SMTP):

potential caps: audio/x-raw-float, endianness=(int)1234, width=(int)32, rate=(int)48000, channels=(int)[ 1, 28 ]
filter caps: audio/x-raw-float, channels=(int)28, channel-positions=(GstAudioChannelPosition)< GST_AUDIO_CHANNEL_POSITION_NONE, GST_AUDIO_CHANNEL_POSITION_NONE, ... , GST_AUDIO_CHANNEL_POSITION_NONE >
actual caps: audio/x-raw-float, endianness=(int)1234, width=(int)32, rate=(int)48000, channels=(int)2, channel-positions=(GstAudioChannelPosition)< GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT, GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT >

And here's the Python code that produces that output:

#!/usr/bin/env python
import pygst
pygst.require("0.10")
import gst
import gobject
import gst.audio

gobject.threads_init()
pipeline = gst.Pipeline("mypipeline")
src = gst.element_factory_make("jackaudiosrc", "jacksrc")
pipeline.add(src)
srcpad = src.get_pad("src")
pipeline.set_state(gst.STATE_PLAYING)
print 'potential caps:',srcpad.get_caps()
sink = gst.element_factory_make("fakesink", "sink")
pipeline.add(sink)
filtercaps = gst.caps_from_string("audio/x-raw-float,channels=28")
filtercaps[0].set_value("channel-positions", tuple([gst.audio.AUDIO_CHANNEL_POSITION_NONE]*28))
print "filter caps:",filtercaps
src.link_filtered(sink, filtercaps)
pipeline.set_state(gst.STATE_PLAYING)
print 'actual caps:',srcpad.get_negotiated_caps()
#gst.DEBUG_BIN_TO_DOT_FILE_WITH_TS(pipeline, gst.DEBUG_GRAPH_SHOW_ALL, 'caps')

I also tried to set the caps of the output directly instead of using a
filter but that didn't do anything either.

I'll attach the output of that last bin-to-dot-file line.

Thanks in advance for any explanation how to properly set channel
positions/a channel mask,

	Christian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: broken_caps.pdf
Type: application/pdf
Size: 28571 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20140724/fbce57f4/attachment-0001.pdf>


More information about the gstreamer-devel mailing list