Fix WAV call recording/playback, ALSA call audio routing, and tracker ringtones

This commit is contained in:
Luxferre
2026-10-25 18:15:36 +02:00
parent b706865ee8
commit f4fe5ce8e9
21 changed files with 339 additions and 33 deletions
+9 -4
View File
@@ -333,12 +333,12 @@ class PhoneController {
"Sound", false, 0, 1, 1, spkOn ? 1 : 0});
// 7. Microphone on/off (toggle)
unsigned int dec1 = alsa_.getEnum("DEC1 MUX", 2);
unsigned int dec1 = alsa_.getEnum("DEC1 MUX", 1);
if (dec1 > 0) {
savedMicMux_ = dec1;
writeIntFile("/tmp/xdrawer_mic_mux", static_cast<int>(savedMicMux_));
} else {
savedMicMux_ = static_cast<unsigned int>(std::max(1, readIntFile("/tmp/xdrawer_mic_mux", 2)));
savedMicMux_ = static_cast<unsigned int>(std::max(1, readIntFile("/tmp/xdrawer_mic_mux", 1)));
}
items_.push_back({ControlId::MicMute, kIconMicOn, kIconMicOff,
"Microphone", false, 0, 1, 1, (dec1 > 0) ? 1 : 0});
@@ -470,6 +470,7 @@ class PhoneController {
long hw = (it.value <= 0) ? 0 : (60 + std::lround((it.value * 32.0) / 100.0));
if (it.value > 0) {
alsa_.setBoolean("SPK DAC Switch", true);
alsa_.setEnum("RX3 MIX1 INP1", 3);
}
alsa_.setInteger("RX3 Digital Volume", hw);
char cmd[160];
@@ -501,6 +502,9 @@ class PhoneController {
}
case ControlId::SoundMute: {
alsa_.setBoolean("SPK DAC Switch", it.value != 0);
if (it.value != 0) {
alsa_.setEnum("RX3 MIX1 INP1", 3);
}
runAsyncCmd(it.value
? "wpctl set-mute @DEFAULT_AUDIO_SINK@ 0 >/dev/null 2>&1; "
"sxmo_hook_statusbar.sh audio >/dev/null 2>&1"
@@ -509,8 +513,9 @@ class PhoneController {
break;
}
case ControlId::MicMute: {
alsa_.setEnum("DEC1 MUX", it.value ? savedMicMux_ : 0);
alsa_.setInteger("ADC3 Volume", it.value ? 8 : 0);
alsa_.setEnum("DEC1 MUX", it.value ? (savedMicMux_ > 0 ? savedMicMux_ : 1) : 0);
alsa_.setInteger("ADC1 Volume", it.value ? 6 : 0);
alsa_.setInteger("ADC3 Volume", it.value ? 6 : 0);
runAsyncCmd(it.value
? "wpctl set-mute @DEFAULT_AUDIO_SOURCE@ 0 >/dev/null 2>&1"
: "wpctl set-mute @DEFAULT_AUDIO_SOURCE@ 1 >/dev/null 2>&1");