Skip to content

Commit

Permalink
Increase alsa headroom when using pipewire
Browse files Browse the repository at this point in the history
Pipewire sets the period_size very low by default, which causes
instability with the drivers locking up. Increase the headroom to work
around this. Pulseaudio sets it higher by default so it is not needed
there. Also re-word the status print for avs_dmic.
  • Loading branch information
WeirdTreeThing committed Aug 16, 2023
1 parent f61eca7 commit 7ae9b66
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
12 changes: 12 additions & 0 deletions conf/common/51-increase-headroom.lua
@@ -0,0 +1,12 @@
rule = {
matches = {
{
{ "node.name", "matches", "alsa_output.*" },
},
},
apply_properties = {
["api.alsa.headroom"] = 4096,
},
}

table.insert(alsa_monitor.rules,rule)
9 changes: 8 additions & 1 deletion setup-audio
Expand Up @@ -70,7 +70,7 @@ def avs_audio(board, username):

# Install wireplumber config for dmic if wireplumber is installed on the system
if path_exists("/usr/bin/wireplumber"):
print_status("Installing wireplumber config (fixes internal mic)")
print_status("Forcing avs_dmic to use S16LE format")
mkdir("/etc/wireplumber/main.lua.d/", create_parents=True)
cpfile("conf/avs/51-avs-dmic.lua", "/etc/wireplumber/main.lua.d/51-avs-dmic.lua")

Expand Down Expand Up @@ -290,4 +290,11 @@ if __name__ == "__main__":
print_error(f"Unknown/Unsupported chromebook model: {device_board}")
exit(1)

# Install wireplumber config to increase headroom
# fixes instability and crashes on various devices
if path_exists("/usr/bin/wireplumber"):
print_status("Increasing alsa headroom (fixes instability)")
mkdir("/etc/wireplumber/main.lua.d/", create_parents=True)
cpfile("conf/common/51-increase-headroom.lua", "/etc/wireplumber/main.lua.d/51-increase-headroom.lua")

print_header("Audio installed successfully! Reboot to finish setup.")

0 comments on commit 7ae9b66

Please sign in to comment.