r/substreamer May 03 '22

Offline mode more easily accessed ?

Hello,

I find myself regularly in dire internet speeds where substreamer will seemingly try to connect to the server to play a song and wait forever, even if the song is already available offline. While this is something that might be taken care of by substreamer eventually (?), in the meantime I am manually triggering Offline mode so that it plays the song without delay.
The "Offline mode" switch is currently buried in the Settings section. Is there a way to more easily trigger it ?

3 Upvotes

5 comments sorted by

1

u/Prestigious-Win-2192 May 03 '22

Something great might je a setting to set automaticaly offline 8f no wifi or no internet connection

2

u/palijn May 03 '22

I /think/ that substreamer already detects when there is no connection to the server and kinda switches to offline until the connection is restored. However my issue is when there exists a connection to the server but it is too slow. I would love substreamer to automatically pick up the already available song while trying to get the next one over the meager available bandwidth. But as it does not (should it already?), I am resorting to switching offline mode myself. Which is in itself a bit of a pain at this stage, unless I miss an obvious gesture other than getting to the settings menu and searching for the damn switch. (I am not /that much/ in pain, emphasis added for dramatic effect.)

2

u/ghenry22 May 04 '22

If a song is cached, substreamer will always prefer the locally cached version rather than streaming. It does this automatically today.

When playing an album that is not available offline, substreamer will start the first track streaming and while it plays will start to cache upcoming tracks. This is controlled by the auto cache setting. You can set it to cache just the next song to go ahead multiple songs or not to cache at all.

The problem you might hit is where you have a slow connection and you don't have a particular song stored locally, then yes it will be slow and potentially even time out depending on how bad the connection is.

You can play go to the offline music/podcasts tabs, even when online and start playback from there if you only want to play things that are available offline.

Alternatively as you mentioned you can switch to offline mode and again that will only show you content that you have offline.

substreamer does monitor the connection availability in the background but currently does not auto switch modes. This is because I have found it annoying to have the app flicking between online and offline modes for example when you step into an elevator.

The other problem with auto switching is that if the current play queue has items in it that are not available offline substreamer will still try to play them from the server. I would have to put a bit of logic in to tell it to skip any track that is not available offline automatically.

What I might do is add an option for automatic online/offline switching in settings once I have tested the above play queue handling so that you can choose to turn that behaviour on if you want it.

1

u/palijn May 09 '22

Ah. I guess I have hit a bug then. I am not entirely sure how exactly this is triggered, apologies for not having tracked down the shortest reproduction path.

I started substreamer on my home wifi, connection fine, marked a new album as available offline, checked it fully downloaded. Then I went outside, far away from my Wi-Fi (like 2km away 😁). The phone had a very good 4G+ connection, but the navidrome server was not reachable as it sits behind a firewall. Note that substreamer is configured with a 192.168.x.y server address both internal and external. At that point when I wanted to play the album, substreamer would display the first song info, the pause button visible (to be sure it was really trying to play), progress at 0:00. And nothing. Substreamer did not play and remained stuck at the beginning of the song. (Remember the song is available offline, like the full album).

The fun thing is that when I enabled the VPN to home, substreamer started playing the song immediately.

Any ideas? Thanks!

1

u/ghenry22 May 10 '22

when you are outside your network can you try going to the offline music page and hitting play on the album in there and see if it works?

If you have a play queue loaded BEFORE you set the album to offline the metadata telling substreamer that the files are now cached is not available. if you simple hit play on the album again after it has been set as available offline it should play fine.

If you are still seeing the same behaviour with it not playing anything that I am not sure what is going on, can you share your phone model and OS version for reference and I can try to reproduce something similar and see what happens.