Repository: miczflor/rpi-jukebox-rfid
Issue: Probleme mit mdp.timer_status on future3

### Describe your problem 
Wenn eine Playlist oder Ordner nur einen Song  hat und dieser endet, kommt unten genannte Fehlermeldung. Danach ist der mpd nicht mehr nutzbar -> keine Musik mehr abspielbar, Playlists leer, etc...


src/jukebox/components/playermpd/__init__.py
Line: 193
  self.status_thread = multitimer.GenericEndlessTimerClass('mpd.timer_status',
                                                        self.mpd_status_poll_interval, self._mpd_status_poll)
       self.status_thread.start()


#### What's your hardware set up? 

Version: 3.1.0, Raspi B+, debian bulleseye

ERROR LOG:

`21.12.2021 10:32:32 -  692:plugs.py           - jb.plugin.call       - MainThread      - DEBUG    - Calling: player.ctrl.seek(args=(), kwargs={'new_time': '181.977'})
21.12.2021 10:32:32 -  154:server.py          - jb.rpc.server        - MainThread      - DEBUG    - Sending response: {'result': None, 'id': 'eaf599ab-cdc2-4f0a-9a9d-bb9ce33a42bf'}
21.12.2021 10:32:41 -  236:__init__.py        - jb.PlayerMPD         - mpd.timer_status - ERROR    - timeout: timed out
21.12.2021 10:32:45 -  146:__init__.py        - jb.rfid(read_00)     - read_00Thread   - INFO     - Received card id = '0001889390'
21.12.2021 10:32:45 -  692:plugs.py           - jb.plugin.call       - read_00Thread   - DEBUG    - Calling: player.ctrl.play_single(args=['file .mp3
21.12.2021 10:32:45 -  782:plugs.py           - jb.plugin            - read_00Thread   - ERROR    - Ignoring failed call: 'player.ctrl.play_single(args=['file .mp3
21.12.2021 10:32:45 -  783:plugs.py           - jb.plugin            - read_00Thread   - ERROR    - Reason: OSError: cannot read from timed out object
21.12.2021 10:32:45 -  784:plugs.py           - jb.plugin            - read_00Thread   - ERROR    - Detailed reason:
Traceback (most recent call last):
  File "/home/pi/RPi-Jukebox-RFID/src/jukebox/jukebox/plugs.py", line 776, in call_ignore_errors
    result = _call(package, plugin, method, args=args, kwargs=kwargs, as_thread=as_thread, thread_name=thread_name)
  File "/home/pi/RPi-Jukebox-RFID/src/jukebox/jukebox/plugs.py", line 724, in _call
    return func(*args, **kwargs)
  File "/home/pi/RPi-Jukebox-RFID/src/jukebox/components/playermpd/__init__.py", line 404, in play_single
    self.mpd_client.clear()
  File "/home/pi/.local/lib/python3.9/site-packages/mpd/base.py", line 469, in mpd_command
    return wrapper(self, name, args, callback)
  File "/home/pi/.local/lib/python3.9/site-packages/mpd/base.py", line 532, in _execute
    return retval()
  File "/home/pi/.local/lib/python3.9/site-packages/mpd/base.py", line 454, in command_callback
    res = function(self, self._read_lines())
  File "/home/pi/.local/lib/python3.9/site-packages/mpd/base.py", line 387, in _parse_nothing
    for line in lines:
  File "/home/pi/.local/lib/python3.9/site-packages/mpd/base.py", line 586, in _read_lines
    line = self._read_line()
  File "/home/pi/.local/lib/python3.9/site-packages/mpd/base.py", line 568, in _read_line
    line = self._rbfile.readline().decode("utf-8")
  File "/usr/lib/python3.9/socket.py", line 701, in readinto
    raise OSError("cannot read from timed out object")
OSError: cannot read from timed out object

21.12.2021 10:32:49 -  146:__init__.py        - jb.rfid(read_00)     - read_00Thread   - INFO     - Received card id = '0001889390'
21.12.2021 10:32:49 -  692:plugs.py           - jb.plugin.call       - read_00Thread   - DEBUG    - Calling: player.ctrl.play_single(args=['file .mp3
21.12.2021 10:32:49 -  782:plugs.py           - jb.plugin            - read_00Thread   - ERROR    - Ignoring failed call: 'player.ctrl.play_single(args=['file.mp3
21.12.2021 10:32:49 -  783:plugs.py           - jb.plugin            - read_00Thread   - ERROR    - Reason: OSError: cannot read from timed out object
21.12.2021 10:32:49 -  784:plugs.py           - jb.plugin            - read_00Thread   - ERROR    - Detailed reason:
Traceback (most recent call last):`

Changed files:
src/jukebox/components/playermpd/__init__.py

diff --git a/src/jukebox/components/playermpd/__init__.py b/src/jukebox/components/playermpd/__init__.py
index ad4b84a1..04f0643c 100644
--- a/src/jukebox/components/playermpd/__init__.py
+++ b/src/jukebox/components/playermpd/__init__.py
@@ -153,8 +153,12 @@ class PlayerMPD:
         self.decode_2nd_swipe_option()
 
         self.mpd_client = mpd.MPDClient()
-        self.mpd_client.timeout = 0.5               # network timeout in seconds (floats allowed), default: None
-        self.mpd_client.idletimeout = 0.5           # timeout for fetching the result of the idle command
+        # The timeout refer to the low-level socket time-out
+        # If these are too short and the response is not fast enough (due to the PI being busy),
+        # the current MPC command times out. Leave these at blocking calls, since we do not react on a timed out socket
+        # in any relevant matter anyway
+        self.mpd_client.timeout = None               # network timeout in seconds (floats allowed), default: None
+        self.mpd_client.idletimeout = None           # timeout for fetching the result of the idle command
         self.connect()
         logger.info(f"Connected to MPD Version: {self.mpd_client.mpd_version}")