Commit 0608769e 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
parent dc65805c
Pipeline #169460 passed with stage
in 54 seconds
......@@ -420,8 +420,7 @@ ScrollViewKCM {
onClicked: {
testError.visible = false;
// there is no subwoofer sound in the freedesktop theme https://gitlab.freedesktop.org/xdg/xdg-sound-theme/-/issues/7
tester.testChannel(modelData === "lfe" ? "rear-center" : modelData);
tester.testChannel(modelData);
}
}
}
......
......@@ -62,7 +62,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-%1").arg(name);
void *cb_data = new CallbackData{this, name};
ca_proplist *proplist;
......@@ -73,6 +72,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);
int error_code = CA_SUCCESS;
for (const QString &soundName : {sound_name,
QStringLiteral("audio-test-signal"), // Fallback sounds
......
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