Playing DSD files via gst-libav from a UPnP server does not work

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Playing DSD files via gst-libav from a UPnP server does not work

GStreamer-devel mailing list
Hi all,

I have trouble playing DSD files (.dsf) through gst-libav from a UPnP
server (with GStreamer and plugins all built from current master
branches, but same results with GStreamer 1.18.4 on Arch Linux). In
general, decoding and playing from files works fine, but as soon as
souphttpsrc gets involved, it stops working.

This pipeline works:

$ gst-launch-1.0\
     filesrc location='/tmp/TestAudio/Gloryland_DSD64.dsf' !\
     avdemux_dsf ! avdec_dsd_lsbf_planar !\
     audioconvert ! audioresample ! pulsesink

This very similar pipeline, however, does not work:

$ gst-launch-1.0\
     souphttpsrc location='http://192.168.69.2:9021/MediaItems/32.dsd' !\
     avdemux_dsf ! avdec_dsd_lsbf_planar !\
     audioconvert ! audioresample ! pulsesink

The URL points to the exact same file referred to in the first
pipeline, only it is served by minidlna. Downloading the file works,
so it's not a networking issue. Replacing the pipeline with playbin3
doesn't work either. Playing a FLAC file from the server with
avdemux_dsf and avdec_dsd_lsbf_planar replaced by flacparse and
flacdec for comparison, however, works as expected.

Output of the failing pipeline:
     Setting pipeline to PAUSED ...
     Pipeline is PREROLLING ...
     Got context from element 'souphttpsrc0': gst.soup.session=context,
session=(SoupSession)NULL, force=(boolean)false;
     ERROR: from element
/GstPipeline:pipeline0/avdemux_dsf:avdemux_dsf0: Internal data stream error.
     Additional debug info:

../../../../../../../opt/source/GStreamer/gst-libav/ext/libav/gstavdemux.c(1636):
gst_ffmpegdemux_loop (): /GstPipeline:pipeline0/avdemux_dsf:avdemux_dsf0:
     streaming stopped, reason error (-5)
     ERROR: pipeline doesn't want to preroll.
     Setting pipeline to NULL ...
     ERROR: from element /GstPipeline:pipeline0/GstPulseSink:pulsesink0:
The stream is in the wrong format.
     Additional debug info:

../../../../../../../opt/source/GStreamer/gst-plugins-base/gst-libs/gst/audio/gstaudiobasesink.c(1115):
gst_audio_base_sink_wait_event ():
/GstPipeline:pipeline0/GstPulseSink:pulsesink0:
     Sink not negotiated before eos event.
     ERROR: pipeline doesn't want to preroll.
     Freeing pipeline ...

I tried to find out what's going on by generating .dot files for the
pipelines (GST_DEBUG_DUMP_DOT_DIR). For the failing pipeline, I can
see that the pads from souphttpsrc down to avdec_dsd_lsbf_planar seem
to be OK, but the pads from avdec_dsd_lsbf_planar to audioconvert and
further down are left unconfigured. I guess this is what the message
"Sink not negotiated before eos event." wanted to tell me.

I have also cranked up the debug levels via GST_DEBUG to further
investigate what exactly is happening. I have compared the logs for
the two pipelines with file source vs network source, and when playing
from filesrc, the pads in the pipeline are set to pull mode; when
playing from souphttpsrc, they are set to push mode. So that's one
obvious difference which might be relevant.

Both pipelines eventually hit gst_ffmpegdemux_loop() in
gst-libav/ext/libav/gstavdemux.c. When playing from filesrc, the line

     ret = stream_last_flow = gst_pad_push (srcpad, outbuf);

succeeds and the stream starts playing, but when playing from
souphttpsrc, gst_pad_push() returns GST_FLOW_ERROR (-5). Digging a bit
deeper, this is because the first call of check_sticky() in
gst_pad_push_data() in gstreamer/gst/gstpad.c fails.

Now I am stuck and don't know how to proceed. I think there might be
some piece of code missing which should configure the pads between
avdec_dsd_lsbf_planar and audioconvert, but I have no clue where this
code should be.

Can someone please help me with this? Thank you in advance!

Best regards,
Robert
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Playing DSD files via gst-libav from a UPnP server does not work

GStreamer-devel mailing list
On 6/9/21 12:23 AM, Robert Tiemann via gstreamer-devel wrote:
> Hi all,
>
> I have trouble playing DSD files (.dsf) through gst-libav from a UPnP
> server (with GStreamer and plugins all built from current master
> branches, but same results with GStreamer 1.18.4 on Arch Linux). In
> general, decoding and playing from files works fine, but as soon as
> souphttpsrc gets involved, it stops working.

Hi again,

I think there is a bug in gst-libav which prevents it to operate in push
mode under circumstances, and I still cannot fix this bug due to my lack
of knowledge on GStreamer internals.

Could someone with more experience please take a look at this? I can try
to work out a patch on my own (and contribute it back, of course), but I
simply do not know where to start.

Best regards,
Robert
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel