Changeset 2784

Show
Ignore:
Timestamp:
05/12/20 01:12:28 (5 months ago)
Author:
jwoithe
Message:

ffado-mixer: prevent ffado-dbus-server holding the ffado-mixer lock socket.

If ffado-dbus-server is not running when ffado-mixer is started, ffado-mixer
will start it. On some systems, ffado-mixer could not be run a second time
after exiting if it needed to start ffado-dbus-server during its first run.
This has been reported by a small number of users over time, but it has been
difficult to debug because it did not happen on systems used by FFADO
developers.

Testing by Claudia Krelm indicates that on affected systems, the
subprocess.Popen() call passes file descriptors to the child process. If
this is done, ffado-dbus-server obtains a file descriptor to the unix socket
used as the ffado-mixer lock file. When ffado-mixer is stopped,
ffado-dbus-server still holds the lock's file descriptor open and therefore
the socket is not closed. In this scenario, the ffado-mixer lock file
(socket) would only be closed if ffado-dbus-server were shut down.

This was demonstrated on Claudia's system by explicitly requesting the
closure of file descriptors in the subprocess.Popen() call. Without this
change, ffado-mixer could not be restarted due to the continued presence of
the lock file even after ffado-mixer had been shut down. If file descriptor
closure was requested, ffado-mixer could be restarted whenever the previous
invocation had been exitted. On this basis, the bug can be fixed by
explicitly requesting file descriptors be closed when subprocess.Popen() is
used to spawn ffado-dbus-server. While many systems evidently do this by
default, there are clearly some which do not.

Thanks to Claudia Krelm for running the tests needed to identify the
problem.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/libffado/support/mixer-qt4/ffado/ffadowindow.py

    r2735 r2784  
    161161            if hasattr(self, "retry"): 
    162162                self.retry.setEnabled(False) 
    163             subprocess.Popen(['ffado-dbus-server', '-v3']).pid 
     163            subprocess.Popen(['ffado-dbus-server', '-v3'], close_fds=True).pid 
    164164            QTimer.singleShot(5000, self.connectToDBUS) 
    165165