Interleave with Alsasink Pipeline Problem
Tim Müller
tim at centricular.com
Mon Jul 7 14:54:51 PDT 2014
On Mon, 2014-07-07 at 11:04 -0700, adweldon wrote:
Hi David,
> I'm trying to create a fairly simple pipeline using test sources, the
> interleave element and my alsasink. I'm essentially trying to have
> different test sources interleaved into a multichannel stream, and played
> out on the alsasink. We are starting with basic two channel stereo right
> now, so nothing too complicated.
>
> The following pipeline using pulsesink, works:
> gst-launch-1.0 -v interleave name=i ! pulsesink audiotestsrc name=t1
> volume=0.2 freq=133 ! queue ! i. audiotestsrc name=t2 volume=0.1 freq=200 !
> queue ! i.
>
> Replacing pulsesink with alsasink results in:
>
> WARN basesrc gstbasesrc.c:2933:gst_base_src_loop:<t1> error: Internal data
> flow error.
> WARN basesrc gstbasesrc.c:2933:gst_base_src_loop:<t1> error: streaming task
> paused, reason not-negotiated (-4)
> INFO GST_ERROR_SYSTEM gstelement.c:1834:gst_element_message_full:<t1>
> posting message: Internal data flow error.
> GST_ERROR_SYSTEM gstelement.c:1857:gst_element_message_full:<t1> posted
> error message: Internal data flow error.
>
> Also:
> WARN alsa conf.c:4694:snd_config_expand: alsalib error: Unknown parameters
> {AES0 0x02 AES1 0x82 AES2 0x00 AES3 0x02}
> WARN alsa pcm.c:2239:snd_pcm_open_noupdate: alsalib error: Unknown PCM
> default:{AES0 0x02 AES1 0x82 AES2 0x00 AES3 0x02}
I don't think this warning has anything to do with it.
> Removing a source, the audio will play... I have created a custom app that
> does basically the same thing as the launch pipeline, but it results in the
> same errors. I have also tried playing with channel masks and what not in
> the app to no avail...
>
> Any help is appreciated,
The debug log should tell you what the problem is:
$ GST_DEBUG=*:6 gst-launch-1.0 -v interleave name=i ! alsasink \
audiotestsrc name=t1 volume=0.2 freq=133 ! queue ! i. \
audiotestsrc name=t2 volume=0.1 freq=200 ! queue ! i. \
2>&1 | grep --max-count=1 -B25 not-negotiated
Problem appears to be that interleave output audio with 2 unpositioned
channels (channels=2,channel-mask=0), whereas alsa wants left/right for
channels=2 (i.e. channels=2,channel-mask=3). pulsesink doesn't seem to
care that's why it works.
This makes it work (i.e. forcing a left/right layout on the caps):
gst-launch-1.0 -v interleave name=i ! capssetter
caps='audio/x-raw,channel-mask=(bitmask)0x03' ! alsasink audiotestsrc
name=t1 volume=0.2 freq=133 ! queue ! i. audiotestsrc name=t2
volume=0.1 freq=200 ! queue ! i.
In code one would do that via interleave's properties I suppose, but
with gst-launch this is the only way.
Cheers
-Tim
--
Tim Müller, Centricular Ltd - http://www.centricular.com
More information about the gstreamer-devel
mailing list