Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package pulseaudio-qt for openSUSE:Factory checked in at 2024-10-27 11:24:19 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/pulseaudio-qt (Old) and /work/SRC/openSUSE:Factory/.pulseaudio-qt.new.2020 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "pulseaudio-qt" Sun Oct 27 11:24:19 2024 rev:8 rq:1218488 version:1.6.1 Changes: -------- --- /work/SRC/openSUSE:Factory/pulseaudio-qt/pulseaudio-qt.changes 2024-09-15 12:33:54.950308426 +0200 +++ /work/SRC/openSUSE:Factory/.pulseaudio-qt.new.2020/pulseaudio-qt.changes 2024-10-27 11:24:28.368409346 +0100 @@ -1,0 +2,14 @@ +Fri Oct 25 20:18:21 UTC 2024 - Fabian Vogt <fabian@ritter-vogt.de> + +- Update to 1.6.1: + * context: put event role string into a constexpr + * context: fix the event streamrestore index + * context: always synthesize an event streamrestore + * debug volume setting + * add extreme verbosity category for object management + * context: correctly initialize try count + * context: init all pointers + * Disconnect items' signals on context destructor + * Bump version to 1.6.1 + +------------------------------------------------------------------- Old: ---- pulseaudio-qt-1.6.0.tar.xz pulseaudio-qt-1.6.0.tar.xz.sig New: ---- pulseaudio-qt-1.6.1.tar.xz pulseaudio-qt-1.6.1.tar.xz.sig ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ pulseaudio-qt.spec ++++++ --- /var/tmp/diff_new_pack.8bhbsJ/_old 2024-10-27 11:24:28.836428745 +0100 +++ /var/tmp/diff_new_pack.8bhbsJ/_new 2024-10-27 11:24:28.840428911 +0100 @@ -32,7 +32,7 @@ %define rname pulseaudio-qt %bcond_without released Name: pulseaudio-qt%{?pkg_suffix} -Version: 1.6.0 +Version: 1.6.1 Release: 0 Summary: Qt bindings for PulseAudio License: LGPL-2.1-or-later ++++++ pulseaudio-qt-1.6.0.tar.xz -> pulseaudio-qt-1.6.1.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pulseaudio-qt-1.6.0/CMakeLists.txt new/pulseaudio-qt-1.6.1/CMakeLists.txt --- old/pulseaudio-qt-1.6.0/CMakeLists.txt 2024-09-12 17:15:02.000000000 +0200 +++ new/pulseaudio-qt-1.6.1/CMakeLists.txt 2024-10-25 13:50:48.000000000 +0200 @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.16) -set(PROJECT_VERSION 1.6.0) +set(PROJECT_VERSION 1.6.1) project(PulseAudioQt VERSION ${PROJECT_VERSION}) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pulseaudio-qt-1.6.0/autotests/CMakeLists.txt new/pulseaudio-qt-1.6.1/autotests/CMakeLists.txt --- old/pulseaudio-qt-1.6.0/autotests/CMakeLists.txt 2024-09-12 17:15:02.000000000 +0200 +++ new/pulseaudio-qt-1.6.1/autotests/CMakeLists.txt 2024-10-25 13:50:48.000000000 +0200 @@ -1,5 +1,6 @@ include(ECMAddTests) +add_definitions(-DUNDER_TEST) ecm_add_test( ${CMAKE_SOURCE_DIR}/src/maps.h ${CMAKE_SOURCE_DIR}/src/module.cpp diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pulseaudio-qt-1.6.0/src/CMakeLists.txt new/pulseaudio-qt-1.6.1/src/CMakeLists.txt --- old/pulseaudio-qt-1.6.0/src/CMakeLists.txt 2024-09-12 17:15:02.000000000 +0200 +++ new/pulseaudio-qt-1.6.1/src/CMakeLists.txt 2024-10-25 13:50:48.000000000 +0200 @@ -30,6 +30,12 @@ CATEGORY_NAME org.kde.pulseaudio ) +ecm_qt_declare_logging_category(KF${QT_MAJOR_VERSION}PulseAudioQt + HEADER debug_object.h + IDENTIFIER PAOBJECT + CATEGORY_NAME org.kde.pulseaudio.object +) + target_link_libraries(KF${QT_MAJOR_VERSION}PulseAudioQt PUBLIC Qt${QT_MAJOR_VERSION}::Core diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pulseaudio-qt-1.6.0/src/context.cpp new/pulseaudio-qt-1.6.1/src/context.cpp --- old/pulseaudio-qt-1.6.0/src/context.cpp 2024-09-12 17:15:02.000000000 +0200 +++ new/pulseaudio-qt-1.6.1/src/context.cpp 2024-10-25 13:50:48.000000000 +0200 @@ -56,6 +56,11 @@ #ifndef K_DOXYGEN +namespace +{ +constexpr auto EVENT_ROLE = "sink-input-by-media-role:event"; +} // namespace + static bool isGoodState(int eol) { if (eol < 0) { @@ -91,7 +96,7 @@ return; } if (const char *id = pa_proplist_gets(info->proplist, "module-stream-restore.id")) { - if (qstrcmp(id, "sink-input-by-media-role:event") == 0) { + if (qstrcmp(id, EVENT_ROLE) == 0) { qCDebug(PULSEAUDIOQT) << "Ignoring event role sink input."; return; } @@ -350,6 +355,7 @@ m_mainloop = nullptr; } + disconnectSignals(); reset(); } @@ -538,10 +544,15 @@ return; } + // Always synthesize an event stream. Neither PA nor PW have one until the first event sound is played. + // This stream will eventually get updated by either the read_cb or the subscription. + // https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/4186 + synthesizeEventStream(); if (PAOperation(pa_ext_stream_restore_read(c, ext_stream_restore_read_cb, this))) { pa_ext_stream_restore_set_subscribe_cb(c, ext_stream_restore_subscribe_cb, this); PAOperation(pa_ext_stream_restore_subscribe(c, 1, nullptr, this)); } else { + m_streamRestores.reset(); qCWarning(PULSEAUDIOQT) << "Failed to initialize stream_restore extension"; } } else if (!PA_CONTEXT_IS_GOOD(state)) { @@ -597,11 +608,11 @@ void ContextPrivate::streamRestoreCallback(const pa_ext_stream_restore_info *info) { - if (qstrcmp(info->name, "sink-input-by-media-role:event") != 0) { + if (qstrcmp(info->name, EVENT_ROLE) != 0) { return; } - const int eventRoleIndex = 1; + const int eventRoleIndex = 0; StreamRestore *obj = qobject_cast<StreamRestore *>(m_streamRestores.data().value(eventRoleIndex)); if (!obj) { @@ -737,6 +748,23 @@ } } +void ContextPrivate::disconnectSignals() +{ + m_sinks.disconnectSignals(); + m_sinkInputs.disconnectSignals(); + m_sources.disconnectSignals(); + m_sourceOutputs.disconnectSignals(); + m_clients.disconnectSignals(); + m_cards.disconnectSignals(); + m_modules.disconnectSignals(); + m_streamRestores.disconnectSignals(); + + m_server->disconnectSignals(); + + QObject::disconnect(q, &Context::stateChanged, nullptr, nullptr); + QObject::disconnect(q, &Context::autoConnectingChanged, nullptr, nullptr); +} + void ContextPrivate::reset() { m_sinks.reset(); @@ -945,4 +973,16 @@ return m_connectTries < maxTries; } +void ContextPrivate::synthesizeEventStream() +{ + const pa_ext_stream_restore_info info{ + .name = EVENT_ROLE, // + .channel_map = {.channels = 1, .map = {PA_CHANNEL_POSITION_MONO}}, // + .volume = {.channels = 1, .values = {PA_VOLUME_NORM}}, // + .device = nullptr, + .mute = false, + }; + streamRestoreCallback(&info); +} + } // PulseAudioQt diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pulseaudio-qt-1.6.0/src/context_p.h new/pulseaudio-qt-1.6.1/src/context_p.h --- old/pulseaudio-qt-1.6.0/src/context_p.h 2024-09-12 17:15:02.000000000 +0200 +++ new/pulseaudio-qt-1.6.1/src/context_p.h 2024-10-25 13:50:48.000000000 +0200 @@ -36,16 +36,16 @@ CardMap m_cards; ModuleMap m_modules; StreamRestoreMap m_streamRestores; - Server *m_server; + Server *m_server = nullptr; - pa_context *m_context; - pa_glib_mainloop *m_mainloop; + pa_context *m_context = nullptr; + pa_glib_mainloop *m_mainloop = nullptr; QString m_newDefaultSink; QString m_newDefaultSource; QTimer m_connectTimer; - int m_connectTries; + int m_connectTries = 0; Context::State m_state = Context::State::Unconnected; static QString s_applicationId; @@ -79,11 +79,13 @@ pa_cvolume cVolume, const std::function<pa_operation *(pa_context *, uint32_t, const pa_cvolume *, pa_context_success_cb_t, void *)> &); + void disconnectSignals(); void reset(); void connectToDaemon(); void checkConnectTries(); void forceDisconnect(); [[nodiscard]] bool hasConnectionTriesLeft() const; + void synthesizeEventStream(); Context *q; }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pulseaudio-qt-1.6.0/src/maps.h new/pulseaudio-qt-1.6.1/src/maps.h --- old/pulseaudio-qt-1.6.0/src/maps.h 2024-09-12 17:15:02.000000000 +0200 +++ new/pulseaudio-qt-1.6.1/src/maps.h 2024-10-25 13:50:48.000000000 +0200 @@ -17,7 +17,9 @@ #include "card_p.h" #include "client_p.h" +#include "debug_object.h" #include "module_p.h" +#include "pulseobject_p.h" #include "sink_p.h" #include "sinkinput_p.h" #include "source_p.h" @@ -50,6 +52,14 @@ virtual QObject *objectAt(int index) const = 0; virtual int indexOfObject(QObject *object) const = 0; + void disconnectSignals() + { + disconnect(this, &MapBaseQObject::aboutToBeAdded, nullptr, nullptr); + disconnect(this, &MapBaseQObject::added, nullptr, nullptr); + disconnect(this, &MapBaseQObject::aboutToBeRemoved, nullptr, nullptr); + disconnect(this, &MapBaseQObject::removed, nullptr, nullptr); + }; + Q_SIGNALS: void aboutToBeAdded(int index); void added(int index, QObject *object); @@ -122,13 +132,19 @@ } auto *obj = m_hash.value(info->index); + auto type = QLatin1String("create"); if (!obj) { obj = new Type(parent); obj->d->update(info); insert(obj); } else { + type = QLatin1String("create"); obj->d->update(info); } + +#if !defined(UNDER_TEST) + qCDebug(PAOBJECT).noquote() << type << qobject_cast<PulseObject *>(obj)->d; +#endif } void removeEntry(quint32 index) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pulseaudio-qt-1.6.0/src/pulseobject.cpp new/pulseaudio-qt-1.6.1/src/pulseobject.cpp --- old/pulseaudio-qt-1.6.0/src/pulseobject.cpp 2024-09-12 17:15:02.000000000 +0200 +++ new/pulseaudio-qt-1.6.1/src/pulseobject.cpp 2024-10-25 13:50:48.000000000 +0200 @@ -10,6 +10,7 @@ #include "context.h" #include <QIcon> +#include <QMetaProperty> namespace PulseAudioQt { @@ -89,3 +90,41 @@ } } // PulseAudioQt + +QDebug operator<<(QDebug dbg, PulseAudioQt::PulseObjectPrivate const *d) +{ + QDebugStateSaver saver(dbg); + + auto mo = d->q->metaObject(); + + QStringList superClasses; + auto superClass = mo; + while ((superClass = superClass->superClass())) { + superClasses.append(superClass->className()); + } + + dbg.nospace().noquote() << '\n' << mo->className() << '{' << superClasses.join(", ") << '}'; + dbg.nospace() << "(\n"; + + auto indent = QLatin1String(" "); + + for (int i = 0; i < mo->propertyCount(); i++) { + auto property = mo->property(i); + auto propertyValue = property.read(d->q); + if (propertyValue.canConvert<QVariantMap>()) { + dbg.nospace() << indent << property.name() << ":\n"; + const auto properties = propertyValue.value<QVariantMap>(); + for (auto it = properties.cbegin(); it != properties.cend(); ++it) { + auto &key = it.key(); + auto &value = it.value(); + dbg.nospace() << indent << indent << key << ": " << value << '\n'; + } + } else { + dbg.nospace() << indent << property.name() << ": " << propertyValue << '\n'; + } + } + + dbg.nospace() << ')'; + + return dbg; +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pulseaudio-qt-1.6.0/src/pulseobject.h new/pulseaudio-qt-1.6.1/src/pulseobject.h --- old/pulseaudio-qt-1.6.0/src/pulseobject.h 2024-09-12 17:15:02.000000000 +0200 +++ new/pulseaudio-qt-1.6.1/src/pulseobject.h 2024-10-25 13:50:48.000000000 +0200 @@ -69,6 +69,8 @@ friend class VolumeObjectPrivate; friend class ProfilePrivate; friend class StreamRestorePrivate; + template<typename Type, typename PAInfo> + friend class MapBase; }; } // PulseAudioQt diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pulseaudio-qt-1.6.0/src/pulseobject_p.h new/pulseaudio-qt-1.6.1/src/pulseobject_p.h --- old/pulseaudio-qt-1.6.0/src/pulseobject_p.h 2024-09-12 17:15:02.000000000 +0200 +++ new/pulseaudio-qt-1.6.1/src/pulseobject_p.h 2024-10-25 13:50:48.000000000 +0200 @@ -13,6 +13,7 @@ #include <pulse/introspect.h> #include "context.h" +#include "pulseobject.h" namespace PulseAudioQt { @@ -54,4 +55,7 @@ } }; } + +QDebug operator<<(QDebug dbg, PulseAudioQt::PulseObjectPrivate const *d); + #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pulseaudio-qt-1.6.0/src/server.cpp new/pulseaudio-qt-1.6.1/src/server.cpp --- old/pulseaudio-qt-1.6.0/src/server.cpp 2024-09-12 17:15:02.000000000 +0200 +++ new/pulseaudio-qt-1.6.1/src/server.cpp 2024-10-25 13:50:48.000000000 +0200 @@ -91,6 +91,15 @@ } } +void Server::disconnectSignals() +{ + disconnect(this, &Server::defaultSinkChanged, nullptr, nullptr); + disconnect(this, &Server::defaultSourceChanged, nullptr, nullptr); + disconnect(this, &Server::isPipeWireChanged, nullptr, nullptr); + disconnect(this, &Server::updated, nullptr, nullptr); + disconnect(this, &Server::hasWirePlumberChanged, nullptr, nullptr); +} + void ServerPrivate::update(const pa_server_info *info) { m_defaultSinkName = QString::fromUtf8(info->default_sink_name); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pulseaudio-qt-1.6.0/src/server.h new/pulseaudio-qt-1.6.1/src/server.h --- old/pulseaudio-qt-1.6.0/src/server.h 2024-09-12 17:15:02.000000000 +0200 +++ new/pulseaudio-qt-1.6.1/src/server.h 2024-10-25 13:50:48.000000000 +0200 @@ -60,6 +60,7 @@ explicit Server(Context *context); void reset(); + void disconnectSignals(); void updateDefaultDevices(); class ServerPrivate *const d; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pulseaudio-qt-1.6.0/src/sink.cpp new/pulseaudio-qt-1.6.1/src/sink.cpp --- old/pulseaudio-qt-1.6.0/src/sink.cpp 2024-09-12 17:15:02.000000000 +0200 +++ new/pulseaudio-qt-1.6.1/src/sink.cpp 2024-10-25 13:50:48.000000000 +0200 @@ -46,6 +46,7 @@ void Sink::setVolume(qint64 volume) { + qCDebug(PULSEAUDIOQT) << "Changing volume of Sink" << name() << " to " << volume; Context::instance()->d->setGenericVolume(index(), -1, volume, VolumeObject::d->cvolume(), &pa_context_set_sink_volume_by_index); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pulseaudio-qt-1.6.0/src/sink.h new/pulseaudio-qt-1.6.1/src/sink.h --- old/pulseaudio-qt-1.6.0/src/sink.h 2024-09-12 17:15:02.000000000 +0200 +++ new/pulseaudio-qt-1.6.1/src/sink.h 2024-10-25 13:50:48.000000000 +0200 @@ -38,7 +38,7 @@ void setChannelVolumes(const QList<qint64> &channelVolumes) override; void switchStreams() override; - + /** * Index of the monitor source for this sink. */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pulseaudio-qt-1.6.0/src/sinkinput.cpp new/pulseaudio-qt-1.6.1/src/sinkinput.cpp --- old/pulseaudio-qt-1.6.0/src/sinkinput.cpp 2024-09-12 17:15:02.000000000 +0200 +++ new/pulseaudio-qt-1.6.1/src/sinkinput.cpp 2024-10-25 13:50:48.000000000 +0200 @@ -45,6 +45,7 @@ void SinkInput::setVolume(qint64 volume) { + qCDebug(PULSEAUDIOQT) << "Changing volume of SinkInput" << name() << " to " << volume; Context::instance()->d->setGenericVolume(index(), -1, volume, VolumeObject::d->cvolume(), &pa_context_set_sink_input_volume); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pulseaudio-qt-1.6.0/src/source.cpp new/pulseaudio-qt-1.6.1/src/source.cpp --- old/pulseaudio-qt-1.6.0/src/source.cpp 2024-09-12 17:15:02.000000000 +0200 +++ new/pulseaudio-qt-1.6.1/src/source.cpp 2024-10-25 13:50:48.000000000 +0200 @@ -34,6 +34,7 @@ void Source::setVolume(qint64 volume) { + qCDebug(PULSEAUDIOQT) << "Changing volume of Source" << name() << " to " << volume; Context::instance()->d->setGenericVolume(index(), -1, volume, VolumeObject::d->cvolume(), &pa_context_set_source_volume_by_index); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pulseaudio-qt-1.6.0/src/sourceoutput.cpp new/pulseaudio-qt-1.6.1/src/sourceoutput.cpp --- old/pulseaudio-qt-1.6.0/src/sourceoutput.cpp 2024-09-12 17:15:02.000000000 +0200 +++ new/pulseaudio-qt-1.6.1/src/sourceoutput.cpp 2024-10-25 13:50:48.000000000 +0200 @@ -45,6 +45,7 @@ void SourceOutput::setVolume(qint64 volume) { + qCDebug(PULSEAUDIOQT) << "Changing volume of SourceOutput" << name() << " to " << volume; Context::instance()->d->setGenericVolume(index(), -1, volume, VolumeObject::d->cvolume(), &pa_context_set_source_output_volume); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pulseaudio-qt-1.6.0/src/streamrestore.cpp new/pulseaudio-qt-1.6.1/src/streamrestore.cpp --- old/pulseaudio-qt-1.6.0/src/streamrestore.cpp 2024-09-12 17:15:02.000000000 +0200 +++ new/pulseaudio-qt-1.6.1/src/streamrestore.cpp 2024-10-25 13:50:48.000000000 +0200 @@ -114,8 +114,10 @@ } if (d->m_cache.valid) { + qCDebug(PULSEAUDIOQT) << "Changing cached volume of StreamRestore" << name() << " to " << volume; d->writeChanges(vol, d->m_cache.muted, d->m_cache.device); } else { + qCDebug(PULSEAUDIOQT) << "Changing uncached volume of StreamRestore" << name() << " to " << volume; d->writeChanges(vol, d->m_muted, d->m_device); } }