From 4f39cf6b4a09d1c6272dc807f290ef0167b29c25 Mon Sep 17 00:00:00 2001 From: erebion Date: Sun, 25 Aug 2024 17:19:11 +0200 Subject: [PATCH] add workaround: wireplumber config, makes the speaker (louder one) work --- README.md | 1 - ansible/audio.yml | 20 ++++++++++++++++++++ ansible/files/51-qcom-sdm845.conf | 26 ++++++++++++++++++++++++++ 3 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 ansible/files/51-qcom-sdm845.conf diff --git a/README.md b/README.md index 270a1cd..fa9dd09 100644 --- a/README.md +++ b/README.md @@ -114,7 +114,6 @@ For those I will remove the workarounds once the changes are in the Mobian repo ### This Does Not Work Yet (Soon™) - GPS -- Speaker (the loud one, the other one for calls works... this means that you cannot annoy others with loud music yet, sorry :p) - USB host mode (no Kernel support yet, but apparently this is being worked on) - Verified Boot (first need to do research) diff --git a/ansible/audio.yml b/ansible/audio.yml index 14a1526..539fd9f 100644 --- a/ansible/audio.yml +++ b/ansible/audio.yml @@ -33,6 +33,26 @@ args: chdir: /usr/share/alsa + ### Wireplumber Config ### + + - name: "Copy Wireplumber Config" + ansible.builtin.copy: + src: 51-qcom-sdm845.conf + dest: "/usr/share/wireplumber/wireplumber.conf.d/51-qcom-sdm845.conf" + owner: root + group: root + mode: u+rw + force: true + register: wireplumber_config + + - name: "Restart Wireplumber on config change" + ansible.builtin.systemd_service: + name: wireplumber.service + state: restarted + scope: user + become_user: "{{ ansible_env.SUDO_USER }}" + when: wireplumber_config.changed + ### Remove Remnants Of Previous Playbook Versions ### - name: "Deactivate systemd unit if it exists, ignore errors if it does not" diff --git a/ansible/files/51-qcom-sdm845.conf b/ansible/files/51-qcom-sdm845.conf new file mode 100644 index 0000000..e92726f --- /dev/null +++ b/ansible/files/51-qcom-sdm845.conf @@ -0,0 +1,26 @@ +monitor.alsa.rules = [ + { + matches = [ + { + # Matches all sources + node.name = "~alsa_input.*" + }, + { + # Matches all sinks + node.name = "~alsa_output.*" + } + ] + actions = { + update-props = { + audio.format = "S16LE" + audio.rate = 48000 + api.alsa.period-size = 4096 + api.alsa.period-num = 6 + api.alsa.headroom = 512, + # session.suspend-timeout-seconds = 0 + # dither.method = "wannamaker3", # add dither of desired shape + # dither.noise = 2, # add additional bits of noise + } + } + } +]