omxplayer icon indicating copy to clipboard operation
omxplayer copied to clipboard

incorect end of omxplayer and problem with dbus "Failed to connect to socket"

Open miklik72 opened this issue 6 years ago • 1 comments

Hi,

I'm creating simple video toy with RPI zero w. I use three buttons (GPIO) to control omxplayer (rew,ff,pause). I'm starting omxplayer via omxplayer-wraper from Python script as systemd service. When I'm killing filmstop.py script or omxplayer process as crash simulation, next time I cannot control omxplayer by dbus. This writing message "dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NoServer: Failed to connect to socket /tmp/dbus-jxwpK9IGAt: Connection refused". Then when I'm stopping py script by ctrl+c and starting it again I can control player via dbus again. Is any possibility to check or reinitialize dbus before start omxplayer?

Martin

pi@qq1:~ $ omxplayer -v
omxplayer - Commandline multimedia player for the Raspberry Pi
        Build date: Mon, 05 Nov 2018 15:45:07 +0000
        Version   : 061425a [master]
        Repository: https://github.com/popcornmix/omxplayer.git

pi@qq1:~ $ ./filmstop.0.2.2.py
Traceback (most recent call last):
  File "./filmstop.0.2.2.py", line 31, in <module>
    player = omxplayer.player.OMXPlayer(VIDEO_PATH,dbus_name='org.mpris.MediaPlayer2.omxplayer1',args='--loop')
  File "/home/pi/.local/lib/python3.5/site-packages/omxplayer/player.py", line 154, in __init__
    self.load(source, pause=pause)
  File "/home/pi/.local/lib/python3.5/site-packages/omxplayer/player.py", line 237, in load
    self._load_source(source)
  File "/home/pi/.local/lib/python3.5/site-packages/omxplayer/player.py", line 163, in _load_source
    self._connection = self._setup_dbus_connection(self._Connection, self._bus_address_finder)
  File "/home/pi/.local/lib/python3.5/site-packages/omxplayer/player.py", line 214, in _setup_dbus_connection
    connection = Connection(bus_address_finder.get_address(), self._dbus_name)
  File "/home/pi/.local/lib/python3.5/site-packages/omxplayer/dbus_connection.py", line 24, in __init__
    self._bus = dbus.bus.BusConnection(bus_address)
  File "/home/pi/.local/lib/python3.5/site-packages/dbus/bus.py", line 122, in __new__
    bus = cls._new_for_bus(address_or_type, mainloop=mainloop)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NoServer: Failed to connect to socket /tmp/dbus-jxwpK9IGAt: Connection refused
^CException ignored in: <module 'threading' from '/usr/lib/python3.5/threading.py'>
Traceback (most recent call last):
  File "/usr/lib/python3.5/threading.py", line 1288, in _shutdown
    t.join()
  File "/usr/lib/python3.5/threading.py", line 1054, in join
    self._wait_for_tstate_lock()
  File "/usr/lib/python3.5/threading.py", line 1070, in _wait_for_tstate_lock
    elif lock.acquire(block, timeout):
KeyboardInterrupt
pi@qq1:~ $ ^C
pi@qq1:~ $ ./filmstop.0.2.2.py

filmstop.0.2.2.py stopomx.sh filmstop.service

pi@qq1:~ $  lsb_release -da
No LSB modules are available.
Distributor ID: Raspbian
Description:    Raspbian GNU/Linux 9.6 (stretch)
Release:        9.6
Codename:       stretch

miklik72 avatar Dec 30 '18 22:12 miklik72

Same issue here. It doesn't seem to be very deterministic, sometimes after some media termination the DBus connection just gets broken and no further DBus requests are possible until it's restarted.

--EDIT--

Wow, I didn't notice that this issue was posted more than 2 years ago and yet got no answer.

blacklight avatar Feb 23 '21 19:02 blacklight