Commit 183a26d9 authored by Ismael Asensio's avatar Ismael Asensio
Browse files

SpeakerTest: Fix subwoofer test

Move the workaround to use a different sound for the subwoofer test
to C++, so we can still use the `lfe` channel and the `rear-center`
sound file.

Doing otherwise seems to be specially problematic on pipewire

BUG: 445523
FIXED-IN: 5.24.5

(cherry-picked from commit 0608769e)
parent 584240d6
Pipeline #169465 passed with stage
in 47 seconds
......@@ -405,8 +405,7 @@ ScrollViewKCM {
}
}
// there is no subwoofer sound in the freedesktop theme https://gitlab.freedesktop.org/xdg/xdg-sound-theme/-/issues/7
onClicked: tester.testChannel(modelData === "lfe" ? "rear-center" : modelData)
onClicked: tester.testChannel(modelData);
}
}
......
......@@ -63,7 +63,6 @@ void SpeakerTest::testChannel(const QString &name)
snprintf(dev, sizeof(dev), "%lu", (unsigned long)m_sink->index());
ca_context_change_device(context, dev);
QString sound_name = QStringLiteral("audio-channel-") + name;
void *cb_data = new CallbackData{this, name};
ca_proplist *proplist;
......@@ -74,6 +73,9 @@ void SpeakerTest::testChannel(const QString &name)
ca_proplist_sets(proplist, CA_PROP_CANBERRA_FORCE_CHANNEL, name.toLatin1().data());
ca_proplist_sets(proplist, CA_PROP_CANBERRA_ENABLE, "1");
// there is no subwoofer sound in the freedesktop theme https://gitlab.freedesktop.org/xdg/xdg-sound-theme/-/issues/7
const QString sound_name = (name == QLatin1String("lfe")) ? QStringLiteral("audio-channel-rear-center") : QStringLiteral("audio-channel-%1").arg(name);
ca_proplist_sets(proplist, CA_PROP_EVENT_ID, sound_name.toLatin1().data());
if (ca_context_play_full(context, 0, proplist, finish_callback, cb_data) != CA_SUCCESS) {
// Try a different sound name.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment