Error when using fdsink and wavenc to write on stdout

Tiago Katcipis katcipis at inf.ufsc.br
Thu May 15 07:19:27 PDT 2014


I've been thinking about my problem and it can be described as this:

1 - I have to decode audio, and send to the client.
2 - From the source audio that will be decoded i know the size and duration
of the PCM wav file that will be generated.
3 - The length of the generated audio file is sent to the client.
3 - I want the client to be able to start playback as soon as possible, so
i start sending the decoded audio ASAP (IPC is done using fdsink).
4 - On the end of the stream wavenc tries to write the duration of the
wavfile on the header, but it has already been sent and the file
descriptor is
not seekable.


It seems to me that what i really want is a way to tell the wavenc
pluginthe duration of the
wav file on the start of the streaming, disabling this behaviour of seeking
back and writing the duration on the EOS.

The client that i am providing the audio is the HTML5 audio tag (HTTP
Streaming), and even with the wrong duration on the wav header it is
working perfectly (i assume it uses the content-length provided on the
response and ignores the duration information on the wav header), but
making some changes on wavenc would make possible to send correct header
information (in the future i may have problems with that) and would prevent
the errors on fdsink.

Any of this makes sense ?

Best regards,
Tiago Katcipis


On Wed, May 14, 2014 at 3:04 PM, Tiago Katcipis <katcipis at inf.ufsc.br>wrote:

> I have the following pipeline:
>
> giosrc location=my_remote_location ! wavparse ! adpcmdec ! audioconvert !
> audioresample ! audio/x-raw,rate=8000,channels=1,format=S16LE ! wavenc !
> fdsink
>
> I use the stdout of the process that runs this pipeline to stream the PCMaudio to the client. But on the end of the streaming i always get the error:
>
> ERROR: element fdsink0: detail: Could not perform seek on resource.
> Debugging info: gstfdsink.c(602): gst_fd_sink_event (): /GstPipeline
> :pipeline0/GstFdSink:fdsink0:
> Error while seeking on file descriptor 1: Illegal seek
>
> Taking a look at debug info:
>
> 0:00:18.295838530  2112  0x9ee1fb0 DEBUG                 wavenc gstwavenc
> .c:230:gst_wavenc_push_header:<wavenc0> writing header with datasize
> =2017980
> 0:00:18.295857946  2112  0x9ee1fb0 DEBUG                 fdsink gstfdsink
> .c:552:gst_fd_sink_do_seek:<fdsink0> File descriptor 1 failed to seek to
> position 0
> 0:00:18.295883299  2112  0x9ee1fb0 WARN                  fdsink gstfdsink
> .c:602:gst_fd_sink_event:<fdsink0> error: Error while seeking on file
> descriptor 1: Illegal seek
> ERROR: element fdsink0: detail: Could not perform seek on resource.
> 0:00:18.295918848  2112  0x9ee1fb0 WARN                  wavenc gstwavenc
> .c:239:gst_wavenc_push_header:<wavenc0> push header failed: flow
>
> It seems to me that wavenc is trying to seek to the beginning of the file
> to write the wav header, but the stdout file descriptor is not seekable,
> the data has already been sent (and the wrong header is not a problem to me
> on this case).
>
> Shouldn't fdsink handle non seekable file descriptors gracefully ?
> Something like refusing to handle the seek event if it is not seekable ?
> It seems quite drastic to give an error on the pipeline.
>
> Best regards,
> Tiago Katcipis
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20140515/52b8fadd/attachment.html>


More information about the gstreamer-devel mailing list