Allow Play/Pause (MPRIS/Media Key/...) to properly work with live (unseekable) streams
-
I like to have a key configured that pauses my music when I take a call etc.
Currently, I have MPRIS Play/Pause configured to a convenient key, and for the most part that works very well.
But, I also listen to Web Radio streams some of the time, e.g. http://radio-paralax.de:8000/;
With such live streams, Play/Pause seems to work as intended to 'pause' the stream / turn off the music when a call comes in or such.
However, when having paused for more than a few seconds, a little while (buffering time, I suppose) after resuming, playback will stop with an error message:
Server does not support seeking. ../gst-plugins-good-1.22.11/ext/soup/gstsouphttpsrc.c(1952): gst_soup_http_src_do_request (): /GstPlayBin:pipeline-10-pipeline/GstURIDecodeBin:uridecodebin12/GstSoupHTTPSrc:source: Server does not accept Range HTTP header, URL: http://radio-paralax.de:8000/;, Redirect to: (NULL)
(that is only displayed until any keystroke, so better not be typing while it steals focus, as I'm trying to capture this message while writing up this text...)
I have found out that I then can use Play/Pause to resume playing the same stream, as a workaround - but only within some window of time, after that, Strawberry won't react to it any more (I guess that's possibly an MPRIS 'feature', that the events are only given to 'recent' players...? That's the internal model I have about this, but maybe I'm only justifying another bug.)
I think a better solution would be for Strawberry to transparently resume playing the same stream from its current 'live' position, when(ever) that error occurs. Possibly with a bit of (cross-)fading to avoid nasty clicks.
Alternatively/possibly even better, pausing a live stream could simply 'stop' playing it altogether/drain its buffer, but hold it in a paused state - and resuming from that pause starts playing the stream again, just like the start of regular playback. I.e. no buffering during pause, no (stale) buffer contents would be played after resuming such a stream.Configuring my "music off" key to "mute" is not a solution - for one, it does not appear to be available in MPRIS, and I do also use other music players. More importantly, it would not pause, but keep playing non-live content, where I would very much like to resume exactly from where I left off earlier.
-
However, when having paused for more than a few seconds, a little while (buffering time, I suppose) after resuming, playback will stop with an error message:
Server does not support seeking. ../gst-plugins-good-1.22.11/ext/soup/gstsouphttpsrc.c(1952): gst_soup_http_src_do_request (): /GstPlayBin:pipeline-10-pipeline/GstURIDecodeBin:uridecodebin12/GstSoupHTTPSrc:source: Server does not accept Range HTTP header, URL: http://radio-paralax.de:8000/;, Redirect to: (NULL)
How many secs, approx? Been trying now and worked fine (AAC source).
Haven’t tried MPRIS yet, but I do use global shortcuts (X11) for controlling Strawberry in the background (Settings > User Interface > Global Shortcuts). You can stop, mute, etc. from there.
Knowing that the buffer may get overflown and the server won’t let you go back in the stream (I have had the same problem with video streams on mpv for instance), I’d just press the stop shortcut, then play/pause to restart the stream.
But maybe there’s better solutions. Maybe SB’s buffer can be resized?
-
@tagomago Oh OK, I forced it pausing the stream for a long time and yes, the alert you describe appeared and the stream got disconnected.
I guess it’s just a buffer overflow, so then the app tries to get to some point in the stream that the server won’t serve, and the error is raised. The buffer size (Settings > Backend > Buffer > Buffer duration) is limited to 9999 ms, so that won’t solve it (probably it’s not even related to streams?).
I guess there’s room for improvement in the way the app handles this. Trying to reconnect could be nice, probably?
-
It's not possible to seek a live stream