summaryrefslogtreecommitdiff
path: root/Meta
diff options
context:
space:
mode:
authorJelle Raaijmakers <jelle@gmta.nl>2023-03-10 20:13:27 +0100
committerJelle Raaijmakers <jelle@gmta.nl>2023-03-25 21:27:03 +0100
commite18c87c60c8db89f37dc3987dc6ba5d9592f36e9 (patch)
treec57048c14a41ab40c2d5b43a2f7b542fe2f604d0 /Meta
parentdd0a25de4d7aca407a4118e0d9f6fad3f94da177 (diff)
downloadserenity-e18c87c60c8db89f37dc3987dc6ba5d9592f36e9.zip
Meta: Make audio hardware configurable through environment variable
The new environment variable `SERENITY_AUDIO_HARDWARE` accepts the values `ac97` and `intelhda` (default).
Diffstat (limited to 'Meta')
-rwxr-xr-xMeta/run.sh13
1 files changed, 12 insertions, 1 deletions
diff --git a/Meta/run.sh b/Meta/run.sh
index cd873ecd73..1a4d9b9667 100755
--- a/Meta/run.sh
+++ b/Meta/run.sh
@@ -171,6 +171,17 @@ else
SERENITY_AUDIO_BACKEND="-audiodev pa,timer-period=2000,id=snd0"
fi
+SERENITY_AUDIO_HARDWARE="${SERENITY_AUDIO_HARDWARE:-intelhda}"
+if [ "${SERENITY_AUDIO_HARDWARE}" = 'ac97' ]; then
+ SERENITY_AUDIO_DEVICE='-device ac97,audiodev=snd0'
+elif [ "${SERENITY_AUDIO_HARDWARE}" = 'intelhda' ]; then
+ SERENITY_AUDIO_DEVICE='-device ich9-intel-hda -device hda-output,audiodev=snd0'
+else
+ echo "Unknown audio hardware: ${SERENITY_AUDIO_HARDWARE}"
+ echo 'Supported values: ac97, intelhda'
+ exit 1
+fi
+
if [ "$installed_major_version" -eq 5 ] && [ "$installed_minor_version" -eq 0 ]; then
SERENITY_AUDIO_PC_SPEAKER="-soundhw pcspk"
else
@@ -296,7 +307,7 @@ if [ -z "$SERENITY_MACHINE" ]; then
-device virtio-rng-pci
$SERENITY_AUDIO_BACKEND
$SERENITY_AUDIO_PC_SPEAKER
- -device ac97,audiodev=snd0
+ $SERENITY_AUDIO_DEVICE
-device pci-bridge,chassis_nr=1,id=bridge1 -device $SERENITY_ETHERNET_DEVICE_TYPE,bus=bridge1
-device i82801b11-bridge,bus=bridge1,id=bridge2 -device sdhci-pci,bus=bridge2
-device i82801b11-bridge,id=bridge3 -device sdhci-pci,bus=bridge3