Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reconnect when network connection shifts #128

Open
ilippert opened this issue Apr 27, 2019 · 6 comments
Open

Reconnect when network connection shifts #128

ilippert opened this issue Apr 27, 2019 · 6 comments

Comments

@ilippert
Copy link

In my experience, the playback stops when I shift the system's connection, e.g. from ethernet to wifi.

@hslbck
Copy link
Owner

hslbck commented May 12, 2019

Currently I can't check this behaviour as I don't do network connection shifts.

Does this issue appear with other media players, e.g. lollypop and radio streams as well? Maybe it's not extension related

@ilippert
Copy link
Author

thanks for the hint - yes, the playback stops also in Rhythmbox - do you know where to communicate this issue?

@zapashcanon
Copy link
Contributor

It could be possible to fix it in the extension directly.

We just need to remember if the radio was playing. Then, when we have a network error and if the radio was playing, we could retry after a few seconds ?

@hslbck
Copy link
Owner

hslbck commented May 13, 2019

Should be possible to do it in the extension, but the gstreamer api has to be checked for the proper messages.

@marekmosiewicz
Copy link
Contributor

Not sure, but maybe there is way to subscribe for dbus message for network reconnection.

Maybe this is helpful:
https://stackoverflow.com/questions/59258931/how-to-use-dbus-and-networkmanager-to-activate-a-connection
(this wan is to open connection, but maybe there is message which informs that connection was established

@simeonfelis
Copy link

As of gstreamer supporting network stream errors, here is some previous art:

https://coaxion.net/blog/2020/07/automatic-retry-on-error-and-fallback-stream-handling-for-gstreamer-sources/

A very common problem in GStreamer, especially when working with live network streams, is that the source might just fail at some point. Your own network might have problems, the source of the stream might have problems, …

Without any special handling of such situations, the default behaviour in GStreamer is to simply report an error and let the application worry about handling it. The application might for example want to restart the stream, or it might simply want to show an error to the user, or it might want to show a fallback stream instead, telling the user that the stream is currently not available and then seamlessly switch back to the stream once it comes back.

Implementing all of the aforementioned is quite some effort, especially to do it in a robust way.
[...]

Since most radio stations probably use icecast, souphttpsrc is assembled with the playbin. This has a retry property:

https://gstreamer.freedesktop.org/documentation/soup/souphttpsrc.html?gi-language=python#souphttpsrc:retries

So when setting this to infinite (-1), the stream should restart until the user presses stop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants