alsa-ucm-conf-sane: route audio to the internal speaker by default
This commit is contained in:
parent
b9f31c6f4b
commit
4a8d7ca1c3
|
@ -1,4 +1,7 @@
|
||||||
{ alsa-ucm-conf }:
|
{ alsa-ucm-conf
|
||||||
|
, lib
|
||||||
|
, preferEarpiece ? false
|
||||||
|
}:
|
||||||
alsa-ucm-conf.overrideAttrs (upstream: {
|
alsa-ucm-conf.overrideAttrs (upstream: {
|
||||||
# upstream alsa ships with PinePhone audio configs, but they don't actually produce sound.
|
# upstream alsa ships with PinePhone audio configs, but they don't actually produce sound.
|
||||||
# see: <https://github.com/alsa-project/alsa-ucm-conf/pull/134>
|
# see: <https://github.com/alsa-project/alsa-ucm-conf/pull/134>
|
||||||
|
@ -15,19 +18,18 @@ alsa-ucm-conf.overrideAttrs (upstream: {
|
||||||
# - "internal earpiece" works.
|
# - "internal earpiece" works.
|
||||||
# - "internal speaker" doesn't work (but that's probably because i broke the ribbon cable)
|
# - "internal speaker" doesn't work (but that's probably because i broke the ribbon cable)
|
||||||
# - "analog output" doesn't work.
|
# - "analog output" doesn't work.
|
||||||
postPatch = upstream.postPatch or "" + ''
|
postPatch = (upstream.postPatch or "") + ''
|
||||||
cp ${./ucm2/PinePhone}/* ucm2/Allwinner/A64/PinePhone/
|
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
|
# fix the self-contained ucm files i source from to have correct path within the alsa-ucm-conf source tree
|
||||||
substituteInPlace ucm2/Allwinner/A64/PinePhone/PinePhone.conf \
|
substituteInPlace ucm2/Allwinner/A64/PinePhone/PinePhone.conf \
|
||||||
--replace 'HiFi.conf' '/Allwinner/A64/PinePhone/HiFi.conf'
|
--replace 'HiFi.conf' '/Allwinner/A64/PinePhone/HiFi.conf'
|
||||||
substituteInPlace ucm2/Allwinner/A64/PinePhone/PinePhone.conf \
|
substituteInPlace ucm2/Allwinner/A64/PinePhone/PinePhone.conf \
|
||||||
--replace 'VoiceCall.conf' '/Allwinner/A64/PinePhone/VoiceCall.conf'
|
--replace 'VoiceCall.conf' '/Allwinner/A64/PinePhone/VoiceCall.conf'
|
||||||
|
'' + lib.optionalString preferEarpiece ''
|
||||||
# 2023/09/12: HARDWARE PATCH
|
# decrease the priority of the internal speaker so that sounds are routed
|
||||||
# - the internal speaker on my device is broken
|
# to the earpiece by default.
|
||||||
# - until i fix it, just make it a lower priority than the other devices
|
# this is just personal preference.
|
||||||
# so that it's never activated by default
|
|
||||||
substituteInPlace ucm2/Allwinner/A64/PinePhone/* \
|
substituteInPlace ucm2/Allwinner/A64/PinePhone/* \
|
||||||
--replace 'PlaybackPriority 300' 'PlaybackPriority 100'
|
--replace 'PlaybackPriority 300' 'PlaybackPriority 100'
|
||||||
'';
|
'';
|
||||||
|
|
Loading…
Reference in New Issue
Block a user