From 4cff9f99cb3321fbe4f80420ace3852e53007104 Mon Sep 17 00:00:00 2001 From: Colin Date: Wed, 13 Sep 2023 09:35:01 +0000 Subject: [PATCH] alsa-ucm-conf-sane: reduce Internal Speaker playback priority --- pkgs/additional/alsa-ucm-conf-sane/default.nix | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/pkgs/additional/alsa-ucm-conf-sane/default.nix b/pkgs/additional/alsa-ucm-conf-sane/default.nix index b7ea4efd..bd2800d8 100644 --- a/pkgs/additional/alsa-ucm-conf-sane/default.nix +++ b/pkgs/additional/alsa-ucm-conf-sane/default.nix @@ -13,12 +13,22 @@ alsa-ucm-conf.overrideAttrs (upstream: { # note that with these files, the following audio device support: # - headphones work. # - "internal earpiece" works. - # - "internal speaker" doesn't work. + # - "internal speaker" doesn't work (but that's probably because i broke the ribbon cable) # - "analog output" doesn't work. postPatch = upstream.postPatch or "" + '' cp ${./ucm2/PinePhone}/* ucm2/Allwinner/A64/PinePhone/ + # fix the self-contained ucm files i source from to have correct path within the alsa-ucm-conf source tree - sed -i 's:"HiFi.conf":"/Allwinner/A64/PinePhone/HiFi.conf":' ucm2/Allwinner/A64/PinePhone/PinePhone.conf - sed -i 's:"VoiceCall.conf":"/Allwinner/A64/PinePhone/VoiceCall.conf":' ucm2/Allwinner/A64/PinePhone/PinePhone.conf + substituteInPlace ucm2/Allwinner/A64/PinePhone/PinePhone.conf \ + --replace 'HiFi.conf' '/Allwinner/A64/PinePhone/HiFi.conf' + substituteInPlace ucm2/Allwinner/A64/PinePhone/PinePhone.conf \ + --replace 'VoiceCall.conf' '/Allwinner/A64/PinePhone/VoiceCall.conf' + + # 2023/09/12: HARDWARE PATCH + # - the internal speaker on my device is broken + # - until i fix it, just make it a lower priority than the other devices + # so that it's never activated by default + substituteInPlace ucm2/Allwinner/A64/PinePhone/* \ + --replace 'PlaybackPriority 300' 'PlaybackPriority 100' ''; })