alsa-ucm-pinephone-pmos: prefer the earpiece over the "internal speaker"
This commit is contained in:
@@ -37,7 +37,9 @@ in
|
|||||||
# - headphones work
|
# - headphones work
|
||||||
# - "internal earpiece" works
|
# - "internal earpiece" works
|
||||||
# - "internal speaker" is silent (maybe hardware issue)
|
# - "internal speaker" is silent (maybe hardware issue)
|
||||||
packageUnwrapped = pkgs.alsa-ucm-pinephone-pmos; #< TODO: plumb `preferEarpiece`
|
packageUnwrapped = pkgs.alsa-ucm-pinephone-pmos.override {
|
||||||
|
inherit (cfg.config) preferEarpiece;
|
||||||
|
};
|
||||||
|
|
||||||
sandbox.enable = false; #< only provides $out/share/alsa
|
sandbox.enable = false; #< only provides $out/share/alsa
|
||||||
|
|
||||||
|
@@ -1,7 +1,9 @@
|
|||||||
# see: https://gitlab.com/postmarketOS/pmaports/-/tree/master/device/main/device-pine64-pinephone/
|
# see: https://gitlab.com/postmarketOS/pmaports/-/tree/master/device/main/device-pine64-pinephone/
|
||||||
# - APKBUILD and ucm/ files
|
# - APKBUILD and ucm/ files
|
||||||
{ alsa-ucm-conf
|
{ alsa-ucm-conf
|
||||||
|
, lib
|
||||||
, fetchFromGitLab
|
, fetchFromGitLab
|
||||||
|
, preferEarpiece ? false
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
pmaports = fetchFromGitLab {
|
pmaports = fetchFromGitLab {
|
||||||
@@ -20,5 +22,11 @@ in alsa-ucm-conf.overrideAttrs (upstream: {
|
|||||||
mkdir -p $out/share/alsa/ucm2/conf.d/simple-card
|
mkdir -p $out/share/alsa/ucm2/conf.d/simple-card
|
||||||
ln -sf $out/share/alsa/ucm2/PinePhone/PinePhone.conf \
|
ln -sf $out/share/alsa/ucm2/PinePhone/PinePhone.conf \
|
||||||
$out/share/alsa/ucm2/conf.d/simple-card/PinePhone.conf
|
$out/share/alsa/ucm2/conf.d/simple-card/PinePhone.conf
|
||||||
|
'' + lib.optionalString preferEarpiece ''
|
||||||
|
# decrease the priority of the internal speaker so that sounds are routed
|
||||||
|
# to the earpiece by default.
|
||||||
|
# this is just personal preference.
|
||||||
|
substituteInPlace $out/share/alsa/ucm2/PinePhone/{HiFi.conf,VoiceCall.conf} \
|
||||||
|
--replace-fail 'PlaybackPriority 300' 'PlaybackPriority 100'
|
||||||
'';
|
'';
|
||||||
})
|
})
|
||||||
|
Reference in New Issue
Block a user