<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Mon, 7 May 2018 at 23:21, Tony Houghton <<a href="mailto:h@realh.co.uk">h@realh.co.uk</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I'm writing a program which uses uridecodebin to decode music files and mix them (using audiomixer) with other generated sounds from audiotestsrc etc. I want to be able to pass an arbitrary number of URIs to the uridecodebin and have it loop, ie start again with the first URI when it's played the last one, and switch tracks without interrupting the other sounds in the pipeline. It doesn't matter whether the transitions are gapless. How can I do that?</div></blockquote><div><br></div><div>The situation is worse than I thought. It seems like there's a race condition. At first mixing a music file with a test signal worked on my laptop but not on my Raspberry Pi. When I started experimenting to try to debug it I started getting similar problems on my laptop. The symptoms vary. Sometimes linking the uridecodebin's dynamic src pad to the next stage in the pipeline (audioconvert) fails. Sometimes that succeeds, but then I get a not-negotiated error from an element within uridecodebin as a bus message. Or the same audioconvert element I mentioned above might raise either of those errors. Or it works, but I get not-negotiated warnings (as opposed to errors) from the other branch of the pipeline containing the audiotestsrc.</div><div><br></div><div>Just doing things like printing the warnings or not, or generating a dot file, without changing the way I build and link the pipeline, causes enough disruption somehow to affect whether it works or not. My first approach (which worked on the laptop but not on the RPi) was to add everything to the pipeline to start with and link everything except the uridecodebin and its downstream audioconvert, then set the pipeline's state to PLAYING. The first thing I tried was to set the state to PAUSED first instead, then change it to PLAYING at the end of the pad-added handler, but that was the first thing that broke it on my laptop.</div><div><br></div><div>The attached dot file shows the state of the pipeline in the pad-added handler when attempting to link it has failed. If it had succeeded the src_0 pad in the UriDecodeBin should be linked to the sink pad in the AudioConvert element named "music_conv".</div></div></div>