Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Feature request: try to reconnect while HTTP streaming (Read 2851 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Feature request: try to reconnect while HTTP streaming

I'm using foobar2k with UPnP plugin to stream files over HTTP, and I can't use pause, because HTTP connection times out and foobar shows an error message and switches to the next playlist item. So instead I have to remember current time, stop, play, and seek to that time. It's very annoying.

It would be awesome if foobar tried to reconnect if HTTP connection was dropped.

Thank you in advance.

Feature request: try to reconnect while HTTP streaming

Reply #1
That won't work for all formats, since some are intentionally programmed to disable seeking over HTTP, since they may require fully parsing the file from the start to seek accurately.

Which I just realized would be unnecessary. The HTTP reader could be redesigned to support reconnecting and seeking to the last accessed offset within the file. Of course, this requires a server and remote file type that supports seeking. I'm not sure how the UPnP server handles seeking when transcoding the remote file to WAV or MP3.

Feature request: try to reconnect while HTTP streaming

Reply #2
foo_upnp closes the connection after 60 second of inactivity. So, you can pause during 60 secs .
I tried with a random netradio stream  and it does the same, althougt the timeout might be longer.
There's probably a technical reason for foobar not to reconnect although I do not know it.
My Linn DS player reconnects automatically on closed connection. Sometimes it is useful.

@kode54: Range requests are supported for all files streamed as is, also supported for PCM streaming but seeking time is linear since file must be redecoded from the start. mp3 transcode are not seekable at all. And there's probably a few other corner case I can't remember

EDIT: maybe I can workaround this in the plugin, with an option to disable the timeout (or a very long timeout) for specific clients. I'll think about it.

 

Feature request: try to reconnect while HTTP streaming

Reply #3
@kode54: Seeking is not an issue here. Seeking works perfectly, and is very quick after foobar2k already played that portion of mp3 file.

UPnP plugin is just an example. The same applies when listening for hour-long podcasts directly from the web, you can't pause them. You have to remember the time and re-start and seek, or to search for that place if you forgot that it's a web stream.

If seeking over HTTP works fine using Range:bytes, why can't it just do the same when connection was dropped? Or even break the connection on pause and re-establish it on resume.

Even on non-static streams it would be useful. When I pause an internet radio, I expect the player to continue playing this station after I unpause it, and not switching to another station in the list only because it was paused for too long. It's like if you radio receiver would tune to another station only because it was turned off longer than specific time.

If the stream becomes unavailable, foobar2k should still show an error message, but only after it made sure the stream IS unavailable, after a single retry.