pyradio icon indicating copy to clipboard operation
pyradio copied to clipboard

For my Raspberry Zero, playback timeout is too short → increased by factor of 10

Open Wikinaut opened this issue 2 years ago • 5 comments

As an ad-hoc solution I increased the timeout in pyradio.py by 10.

    def playbackTimeoutCounter(self, *args):
    timeout = 10*args[0]
2023-02-14 22:08:36,782 - pyradio.player:updateStatus():607 - DEBUG: User input: 
2023-02-14 22:08:36,784 - pyradio.player:updateStatus():607 - DEBUG: User input: Playing http://ice6.somafm.com/sonicuniverse-128-mp3.
2023-02-14 22:08:36,786 - pyradio.player:updateStatus():607 - DEBUG: User input: Resolving ice6.somafm.com for AF_INET6...
2023-02-14 22:08:41,484 - pyradio.player:_sendCommand():1440 - DEBUG: Sending Command: q
2023-02-14 22:08:41,607 - pyradio.player:_kill_process_tree():1501 - DEBUG: PID 1965 (and its children)  killed...
2023-02-14 22:08:41,618 - pyradio.player:updateStatus():779 - INFO: updateStatus thread stopped.
2023-02-14 22:08:41,650 - pyradio.radio:connectionFailed():1771 - INFO: *** Start of playback NOT detected!!! ***

Wikinaut avatar Feb 14 '23 22:02 Wikinaut

Hi @Wikinaut

I think there's no need to change the code for this one; just adjust the timeout at the config window

You can either set it to 0, which will disable it, or to max (60 sec). Can you please check it out with 60? If this value is still too small for you (your patch would set it to 10x10sec), do report back; we can change the max value.

https://user-images.githubusercontent.com/5807638/218957543-059c5cce-57d7-4ce0-b835-d4f5497b4b8b.mp4

s-n-g avatar Feb 15 '23 07:02 s-n-g

For unknown reason my patch appears to connect much quicker than yours (setting to zero) and a station is played quicker.

Wikinaut avatar Feb 15 '23 09:02 Wikinaut

I got a quicker response from the server (Opening connection flashing briefly with my patch. WIth your "0" setting, "Opening connection" is shown a long time).

Wikinaut avatar Feb 15 '23 09:02 Wikinaut

lol

What about setting it to 60?

s-n-g avatar Feb 15 '23 09:02 s-n-g

Here's a patch to modify the maximum value from 60 to 120 (change 120 to whatever works):

diff --git a/pyradio/config.py b/pyradio/config.py
index 22dfbdf..55c7d82 100644
--- a/pyradio/config.py
+++ b/pyradio/config.py
@@ -1550,7 +1550,7 @@ class PyRadioConfig(PyRadioStations):
         try:
             ret = int(self.opts['connection_timeout'][1])
             if ret != 0:
-                if not 5 <= ret <= 60:
+                if not 5 <= ret <= 120:
                     ret = 10
         except ValueError:
             ret = 10

s-n-g avatar Feb 15 '23 09:02 s-n-g

Haven't had anything about this one in months... Closing...

Please do not hesitate to re-open if anything is still wrong

s-n-g avatar Apr 05 '24 13:04 s-n-g