From 1fe37e6d4bd5b2d183244538b250dae82ea27d47 Mon Sep 17 00:00:00 2001 From: Tanu Kaskinen Date: Tue, 26 May 2020 15:04:59 +0300 Subject: stream-restore: Forget pre-14.0 stream routing Prior to commits f899d5f4669dcd536cc142cee99fe359dd8af3d6 and f62a49b8cf109c011a9818d2358beb6834e6ec25, GNOME's sound settings overwrote the routing for all entries in the stream-restore database when selecting a device. Now we prevent that from happening (see the aforementioned commits), but the old overwritten settings can still be in the database after updating to PulseAudio 14.0, and they can cause problems, as documented here: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/issues/832 We can't distinguish between devices set by GNOME's sound settings and devices set by the user, so this patch discards all old device settings, even though that is going to cause PulseAudio to forget routing settings for many users. This is less bad than keeping the incorrect routing settings in the database, because it's difficult for users to figure out how to fix the situation when e.g. speaker test tones go to the internal speakers no matter what device is selected as the default, whereas old manual configuration can be restored restored by doing the manual configuration again. Also, it's probably more common to have at some point changed the default device in GNOME's sound settings than it is to have any manual per-stream routing settings. This is disabled by default, because this causes data loss, but distributions that use GNOME are recommended to enable this with the --enable-stream-restore-clear-old-devices (Autotools) or -Dstream-restore-clear-old-devices=true (Meson) build option. Fixes: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/issues/832 --- configure.ac | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index fa93172b7..11142cdd6 100644 --- a/configure.ac +++ b/configure.ac @@ -1477,6 +1477,12 @@ if test "x$enable_legacy_database_entry_format" != "xno" ; then AC_DEFINE(ENABLE_LEGACY_DATABASE_ENTRY_FORMAT, [1], [Legacy database entry format]) fi +AC_ARG_ENABLE([stream-restore-clear-old-devices], + AS_HELP_STRING([--enable-stream-restore-clear-old-devices], [Forget per-stream routing settings that have been set before version 14.0. Recommended when using GNOME. See https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/issues/832])) +if test "x$enable_stream_restore_clear_old_devices" == "xyes" ; then + AC_DEFINE(STREAM_RESTORE_CLEAR_OLD_DEVICES, [1], [module-stream-restore: Clear old devices]) +fi + AC_ARG_ENABLE([static-bins], AS_HELP_STRING([--enable-static-bins],[Statically link executables.])) AM_CONDITIONAL([STATIC_BINS], [test "x$enable_static_bins" = "xyes"]) @@ -1639,6 +1645,7 @@ AS_IF([test "x$HAVE_ESOUND" = "x1" -a "x$USE_PER_USER_ESOUND_SOCKET" = "x1"], EN AS_IF([test "x$HAVE_GCOV" = "x1"], ENABLE_GCOV=yes, ENABLE_GCOV=no) AS_IF([test "x$HAVE_LIBCHECK" = "x1"], ENABLE_TESTS=yes, ENABLE_TESTS=no) AS_IF([test "x$enable_legacy_database_entry_format" != "xno"], ENABLE_LEGACY_DATABASE_ENTRY_FORMAT=yes, ENABLE_LEGACY_DATABASE_ENTRY_FORMAT=no) +AS_IF([test "x$enable_stream_restore_clear_old_devices" == "xyes"], ENABLE_STREAM_RESTORE_CLEAR_OLD_DEVICES=yes, ENABLE_STREAM_RESTORE_CLEAR_OLD_DEVICES=no) echo " ---{ $PACKAGE_NAME $VERSION }--- @@ -1710,6 +1717,8 @@ echo " Preopened modules: ${PREOPEN_MODS} Legacy Database Entry Support: ${ENABLE_LEGACY_DATABASE_ENTRY_FORMAT} + module-stream-restore: + Clear old devices: ${ENABLE_STREAM_RESTORE_CLEAR_OLD_DEVICES} " if test "${ENABLE_SPEEX}" = "no" && test "${ENABLE_WEBRTC}" = "no" && test "${ENABLE_ADRIAN_EC}" = "no" ; then -- cgit v1.2.3