Skip to content

Commit 2e782ba

Browse files
committed
[Linux] Fix noise control mode cycling
1 parent 3023c70 commit 2e782ba

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

linux/deviceinfo.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ class DeviceInfo : public QObject
226226
private:
227227
QString m_batteryStatus;
228228
QString m_earDetectionStatus;
229-
NoiseControlMode m_noiseControlMode = NoiseControlMode::Off;
229+
NoiseControlMode m_noiseControlMode = NoiseControlMode::Transparency;
230230
bool m_conversationalAwareness = false;
231231
int m_adaptiveNoiseLevel = 50;
232232
QString m_deviceName;

linux/main.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,11 @@ public slots:
167167

168168
void setNoiseControlMode(NoiseControlMode mode)
169169
{
170+
if (m_deviceInfo->noiseControlMode() == mode)
171+
{
172+
LOG_INFO("Noise control mode is already set to: " << static_cast<int>(mode));
173+
return;
174+
}
170175
LOG_INFO("Setting noise control mode to: " << mode);
171176
QByteArray packet = AirPodsPackets::NoiseControl::getPacketForMode(mode);
172177
writePacketToSocket(packet, "Noise control mode packet written: ");
@@ -578,7 +583,6 @@ private slots:
578583
{
579584
if (auto value = AirPodsPackets::NoiseControl::parseMode(data))
580585
{
581-
LOG_INFO("Received noise control mode: " << value.value());
582586
m_deviceInfo->setNoiseControlMode(value.value());
583587
LOG_INFO("Noise control mode received: " << m_deviceInfo->noiseControlMode());
584588
}

0 commit comments

Comments
 (0)