config(qemu): pcspeaker should only exist if CoreAUdio backend is used

This commit is contained in:
osy
2025-04-07 08:22:20 -07:00
parent 83f63e3c49
commit a09fd8be67
@@ -432,7 +432,7 @@ import Virtualization // for getting network interfaces
properties = properties.appendingDefaultPropertyName("i8042", value: "off")
}
#if os(macOS)
if sound.contains(where: { $0.hardware.rawValue == "pcspk" }) {
if useCoreAudioBackend && sound.contains(where: { $0.hardware.rawValue == "pcspk" }) {
properties = properties.appendingDefaultPropertyName("pcspk-audiodev", value: "audio1")
}
#endif
@@ -570,7 +570,7 @@ import Virtualization // for getting network interfaces
if _sound.hardware.rawValue.contains("hda") {
f()
f("-device")
if soundBackend == .qemuSoundBackendCoreAudio {
if soundBackend == .qemuSoundBackendCoreAudio && useCoreAudioBackend {
"hda-output"
"audiodev=audio1"
} else {
@@ -579,7 +579,7 @@ import Virtualization // for getting network interfaces
}
f()
} else {
if soundBackend == .qemuSoundBackendCoreAudio {
if soundBackend == .qemuSoundBackendCoreAudio && useCoreAudioBackend {
f("audiodev=audio1")
} else {
f("audiodev=audio0")