moby: ship alsa UCM2 files for pinephone
hopefully this will fix audio problems?
This commit is contained in:
@@ -72,5 +72,10 @@
|
|||||||
# enable rotation sensor
|
# enable rotation sensor
|
||||||
hardware.sensor.iio.enable = true;
|
hardware.sensor.iio.enable = true;
|
||||||
|
|
||||||
|
# from https://gitlab.manjaro.org/manjaro-arm/packages/community/phosh/alsa-ucm-pinephone
|
||||||
|
# mobile-nixos does this same thing
|
||||||
|
environment.variables.ALSA_CONFIG_UCM2 = "${./ucm2}";
|
||||||
|
systemd.services.pulseaudio.environment.ALSA_CONFIG_UCM2 = "${./ucm2}";
|
||||||
|
|
||||||
users.groups.feedbackd.gid = config.sane.allocations.feedbackd-gid;
|
users.groups.feedbackd.gid = config.sane.allocations.feedbackd-gid;
|
||||||
}
|
}
|
||||||
|
142
machines/moby/ucm2/PinePhone/HiFi.conf
Normal file
142
machines/moby/ucm2/PinePhone/HiFi.conf
Normal file
@@ -0,0 +1,142 @@
|
|||||||
|
SectionVerb {
|
||||||
|
EnableSequence [
|
||||||
|
cset "name='Headphone Playback Switch' off"
|
||||||
|
cset "name='Headphone Source Playback Route' DAC"
|
||||||
|
cset "name='Line In Playback Switch' off"
|
||||||
|
cset "name='Line Out Playback Switch' off"
|
||||||
|
cset "name='Line Out Source Playback Route' Mono Differential"
|
||||||
|
cset "name='Mic1 Playback Switch' off"
|
||||||
|
cset "name='Mic2 Playback Switch' off"
|
||||||
|
cset "name='AIF1 DA0 Playback Volume' 160"
|
||||||
|
cset "name='AIF3 ADC Source Capture Route' None"
|
||||||
|
cset "name='AIF2 DAC Source Playback Route' AIF2"
|
||||||
|
cset "name='DAC Playback Switch' on"
|
||||||
|
cset "name='DAC Playback Volume' 160"
|
||||||
|
cset "name='ADC Digital DAC Playback Switch' off"
|
||||||
|
cset "name='AIF1 Slot 0 Digital DAC Playback Switch' on"
|
||||||
|
cset "name='AIF2 Digital DAC Playback Switch' off"
|
||||||
|
cset "name='DAC Reversed Playback Switch' off"
|
||||||
|
cset "name='Earpiece Playback Switch' off"
|
||||||
|
cset "name='Earpiece Source Playback Route' DACL"
|
||||||
|
|
||||||
|
cset "name='Line In Capture Switch' off"
|
||||||
|
cset "name='Mic1 Capture Switch' off"
|
||||||
|
cset "name='Mic1 Boost Volume' 0"
|
||||||
|
cset "name='Mic1 Playback Volume' 7"
|
||||||
|
cset "name='Mic2 Capture Switch' off"
|
||||||
|
cset "name='Mic2 Boost Volume' 0"
|
||||||
|
cset "name='Mic2 Playback Volume' 7"
|
||||||
|
cset "name='Mixer Capture Switch' off"
|
||||||
|
cset "name='Mixer Reversed Capture Switch' off"
|
||||||
|
cset "name='ADC Capture Volume' 160"
|
||||||
|
cset "name='ADC Gain Capture Volume' 7"
|
||||||
|
cset "name='AIF1 AD0 Capture Volume' 160"
|
||||||
|
cset "name='AIF1 Data Digital ADC Capture Switch' on"
|
||||||
|
cset "name='AIF2 ADC Mixer ADC Capture Switch' off"
|
||||||
|
cset "name='AIF2 ADC Mixer AIF1 DA0 Capture Switch' off"
|
||||||
|
cset "name='AIF2 ADC Mixer AIF2 DAC Rev Capture Switch' off"
|
||||||
|
cset "name='AIF2 ADC Mixer AIF1 DA0 Capture Switch' off"
|
||||||
|
cset "name='AIF2 ADC Mixer AIF1 DA0 Capture Switch' off"
|
||||||
|
]
|
||||||
|
DisableSequence [
|
||||||
|
]
|
||||||
|
Value {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SectionDevice."Speaker" {
|
||||||
|
Comment "Internal speaker"
|
||||||
|
EnableSequence [
|
||||||
|
cset "name='AIF1 DA0 Stereo Playback Route' Mix Mono"
|
||||||
|
cset "name='Line Out Playback Switch' on"
|
||||||
|
cset "name='Line Out Playback Volume' 100%"
|
||||||
|
]
|
||||||
|
|
||||||
|
DisableSequence [
|
||||||
|
cset "name='Line Out Playback Switch' off"
|
||||||
|
]
|
||||||
|
|
||||||
|
Value {
|
||||||
|
PlaybackVolume "Line Out Playback Volume"
|
||||||
|
PlaybackSwitch "Line Out Playback Switch"
|
||||||
|
PlaybackChannels "2"
|
||||||
|
PlaybackPriority 300
|
||||||
|
PlaybackPCM "hw:${CardId},0"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
SectionDevice."Earpiece" {
|
||||||
|
Comment "Internal Earpiece"
|
||||||
|
EnableSequence [
|
||||||
|
cset "name='AIF1 DA0 Stereo Playback Route' Mix Mono"
|
||||||
|
cset "name='Earpiece Playback Switch' on"
|
||||||
|
cset "name='Earpiece Playback Volume' 100%"
|
||||||
|
]
|
||||||
|
|
||||||
|
DisableSequence [
|
||||||
|
cset "name='Earpiece Playback Switch' off"
|
||||||
|
]
|
||||||
|
|
||||||
|
Value {
|
||||||
|
PlaybackVolume "Earpiece Playback Volume"
|
||||||
|
PlaybackSwitch "Earpiece Playback Switch"
|
||||||
|
PlaybackChannels "2"
|
||||||
|
PlaybackPriority 100
|
||||||
|
PlaybackPCM "hw:${CardId},0"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
SectionDevice."DigitalMic" {
|
||||||
|
Comment "Internal Microphone"
|
||||||
|
ConflictingDevice [
|
||||||
|
"HeadsetMic"
|
||||||
|
]
|
||||||
|
EnableSequence [
|
||||||
|
cset "name='Mic1 Capture Switch' on"
|
||||||
|
]
|
||||||
|
DisableSequence [
|
||||||
|
cset "name='Mic1 Capture Switch' off"
|
||||||
|
]
|
||||||
|
Value {
|
||||||
|
CapturePriority 100
|
||||||
|
CapturePCM "hw:${CardId},0"
|
||||||
|
CaptureChannels "2"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
SectionDevice."HeadsetMic" {
|
||||||
|
Comment "Headset Microphone"
|
||||||
|
ConflictingDevice [
|
||||||
|
"DigitalMic"
|
||||||
|
]
|
||||||
|
EnableSequence [
|
||||||
|
cset "name='Mic2 Capture Switch' on"
|
||||||
|
]
|
||||||
|
DisableSequence [
|
||||||
|
cset "name='Mic2 Capture Switch' off"
|
||||||
|
]
|
||||||
|
Value {
|
||||||
|
CapturePriority 200
|
||||||
|
CapturePCM "hw:${CardId},0"
|
||||||
|
CaptureChannels "2"
|
||||||
|
JackControl "Headset Microphone Jack"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
SectionDevice."Headphone" {
|
||||||
|
Comment "Headphones"
|
||||||
|
EnableSequence [
|
||||||
|
cset "name='AIF1 DA0 Stereo Playback Route' Stereo"
|
||||||
|
cset "name='Headphone Playback Switch' on"
|
||||||
|
cset "name='Headphone Playback Volume' 100%"
|
||||||
|
]
|
||||||
|
|
||||||
|
DisableSequence [
|
||||||
|
cset "name='Headphone Playback Switch' off"
|
||||||
|
]
|
||||||
|
|
||||||
|
Value {
|
||||||
|
PlaybackVolume "Headphone Playback Volume"
|
||||||
|
PlaybackSwitch "Headphone Playback Switch"
|
||||||
|
PlaybackChannels "2"
|
||||||
|
PlaybackPriority 500
|
||||||
|
PlaybackPCM "hw:${CardId},0"
|
||||||
|
JackControl "Headphone Jack"
|
||||||
|
}
|
||||||
|
}
|
11
machines/moby/ucm2/PinePhone/PinePhone.conf
Normal file
11
machines/moby/ucm2/PinePhone/PinePhone.conf
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
Syntax 2
|
||||||
|
|
||||||
|
SectionUseCase."HiFi" {
|
||||||
|
File "HiFi.conf"
|
||||||
|
Comment "Default"
|
||||||
|
}
|
||||||
|
|
||||||
|
SectionUseCase."Voice Call" {
|
||||||
|
File "VoiceCall.conf"
|
||||||
|
Comment "Phone call"
|
||||||
|
}
|
146
machines/moby/ucm2/PinePhone/VoiceCall.conf
Normal file
146
machines/moby/ucm2/PinePhone/VoiceCall.conf
Normal file
@@ -0,0 +1,146 @@
|
|||||||
|
SectionVerb {
|
||||||
|
EnableSequence [
|
||||||
|
cset "name='Headphone Playback Switch' off"
|
||||||
|
cset "name='Headphone Source Playback Route' DAC"
|
||||||
|
cset "name='Line In Playback Switch' off"
|
||||||
|
cset "name='Line Out Playback Switch' off"
|
||||||
|
cset "name='Line Out Source Playback Route' Mono Differential"
|
||||||
|
cset "name='Mic1 Playback Switch' off"
|
||||||
|
cset "name='Mic2 Playback Switch' off"
|
||||||
|
cset "name='AIF1 DA0 Playback Volume' 160"
|
||||||
|
cset "name='AIF2 DAC Playback Volume' 160"
|
||||||
|
cset "name='AIF2 DAC Stereo Playback Route' Mix Mono"
|
||||||
|
cset "name='AIF3 ADC Source Capture Route' None"
|
||||||
|
cset "name='AIF2 DAC Source Playback Route' AIF2"
|
||||||
|
cset "name='DAC Playback Switch' on"
|
||||||
|
cset "name='DAC Playback Volume' 160"
|
||||||
|
cset "name='ADC Digital DAC Playback Switch' off"
|
||||||
|
cset "name='AIF1 Slot 0 Digital DAC Playback Switch' on"
|
||||||
|
cset "name='AIF2 Digital DAC Playback Switch' on"
|
||||||
|
cset "name='DAC Reversed Playback Switch' off"
|
||||||
|
cset "name='Earpiece Playback Switch' off"
|
||||||
|
cset "name='Earpiece Source Playback Route' DACL"
|
||||||
|
|
||||||
|
cset "name='Line In Capture Switch' off"
|
||||||
|
cset "name='Mic1 Capture Switch' off"
|
||||||
|
cset "name='Mic1 Boost Volume' 0"
|
||||||
|
cset "name='Mic1 Playback Volume' 7"
|
||||||
|
cset "name='Mic2 Capture Switch' off"
|
||||||
|
cset "name='Mic2 Boost Volume' 0"
|
||||||
|
cset "name='Mic2 Playback Volume' 7"
|
||||||
|
cset "name='Mixer Capture Switch' off"
|
||||||
|
cset "name='Mixer Reversed Capture Switch' off"
|
||||||
|
cset "name='ADC Capture Volume' 160"
|
||||||
|
cset "name='ADC Gain Capture Volume' 7"
|
||||||
|
cset "name='AIF1 AD0 Capture Volume' 160"
|
||||||
|
cset "name='AIF1 Data Digital ADC Capture Switch' on"
|
||||||
|
cset "name='AIF2 ADC Capture Volume' 160"
|
||||||
|
cset "name='AIF2 ADC Mixer ADC Capture Switch' on"
|
||||||
|
cset "name='AIF2 ADC Mixer AIF1 DA0 Capture Switch' off"
|
||||||
|
cset "name='AIF2 ADC Mixer AIF2 DAC Rev Capture Switch' off"
|
||||||
|
cset "name='AIF2 ADC Mixer AIF1 DA0 Capture Switch' off"
|
||||||
|
cset "name='AIF2 ADC Mixer AIF1 DA0 Capture Switch' off"
|
||||||
|
]
|
||||||
|
DisableSequence [
|
||||||
|
]
|
||||||
|
Value {
|
||||||
|
PlaybackRate 8000
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SectionDevice."Speaker" {
|
||||||
|
Comment "Internal speaker"
|
||||||
|
EnableSequence [
|
||||||
|
cset "name='AIF1 DA0 Stereo Playback Route' Mix Mono"
|
||||||
|
cset "name='Line Out Playback Switch' on"
|
||||||
|
cset "name='Line Out Playback Volume' 80%"
|
||||||
|
]
|
||||||
|
|
||||||
|
DisableSequence [
|
||||||
|
cset "name='Line Out Playback Switch' off"
|
||||||
|
]
|
||||||
|
|
||||||
|
Value {
|
||||||
|
PlaybackVolume "Line Out Playback Volume"
|
||||||
|
PlaybackSwitch "Line Out Playback Switch"
|
||||||
|
PlaybackChannels "2"
|
||||||
|
PlaybackPriority 100
|
||||||
|
PlaybackPCM "hw:${CardId},0"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
SectionDevice."Earpiece" {
|
||||||
|
Comment "Internal Earpiece"
|
||||||
|
EnableSequence [
|
||||||
|
cset "name='AIF1 DA0 Stereo Playback Route' Mix Mono"
|
||||||
|
cset "name='Earpiece Playback Switch' on"
|
||||||
|
cset "name='Earpiece Playback Volume' 100%"
|
||||||
|
]
|
||||||
|
|
||||||
|
DisableSequence [
|
||||||
|
cset "name='Earpiece Playback Switch' off"
|
||||||
|
]
|
||||||
|
|
||||||
|
Value {
|
||||||
|
PlaybackVolume "Earpiece Playback Volume"
|
||||||
|
PlaybackSwitch "Earpiece Playback Switch"
|
||||||
|
PlaybackChannels "2"
|
||||||
|
PlaybackPriority 300
|
||||||
|
PlaybackPCM "hw:${CardId},0"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
SectionDevice."DigitalMic" {
|
||||||
|
Comment "Internal Microphone"
|
||||||
|
ConflictingDevice [
|
||||||
|
"HeadsetMic"
|
||||||
|
]
|
||||||
|
EnableSequence [
|
||||||
|
cset "name='Mic1 Capture Switch' on"
|
||||||
|
]
|
||||||
|
DisableSequence [
|
||||||
|
cset "name='Mic1 Capture Switch' off"
|
||||||
|
]
|
||||||
|
Value {
|
||||||
|
CapturePriority 100
|
||||||
|
CapturePCM "hw:${CardId},0"
|
||||||
|
CaptureChannels "2"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
SectionDevice."HeadsetMic" {
|
||||||
|
Comment "Headset Microphone"
|
||||||
|
ConflictingDevice [
|
||||||
|
"DigitalMic"
|
||||||
|
]
|
||||||
|
EnableSequence [
|
||||||
|
cset "name='Mic2 Capture Switch' on"
|
||||||
|
]
|
||||||
|
DisableSequence [
|
||||||
|
cset "name='Mic2 Capture Switch' off"
|
||||||
|
]
|
||||||
|
Value {
|
||||||
|
CapturePriority 200
|
||||||
|
CapturePCM "hw:${CardId},0"
|
||||||
|
CaptureChannels "2"
|
||||||
|
JackControl "Headset Microphone Jack"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
SectionDevice."Headphone" {
|
||||||
|
Comment "Headset"
|
||||||
|
EnableSequence [
|
||||||
|
cset "name='AIF1 DA0 Stereo Playback Route' Stereo"
|
||||||
|
cset "name='Headphone Playback Switch' on"
|
||||||
|
cset "name='Headphone Playback Volume' 70%"
|
||||||
|
]
|
||||||
|
|
||||||
|
DisableSequence [
|
||||||
|
cset "name='Headphone Playback Switch' off"
|
||||||
|
]
|
||||||
|
|
||||||
|
Value {
|
||||||
|
PlaybackVolume "Headphone Playback Volume"
|
||||||
|
PlaybackSwitch "Headphone Playback Switch"
|
||||||
|
PlaybackChannels "2"
|
||||||
|
PlaybackPriority 500
|
||||||
|
PlaybackPCM "hw:${CardId},0"
|
||||||
|
JackControl "Headphone Jack"
|
||||||
|
}
|
||||||
|
}
|
8
machines/moby/ucm2/ucm.conf
Normal file
8
machines/moby/ucm2/ucm.conf
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
Syntax 3
|
||||||
|
|
||||||
|
UseCasePath {
|
||||||
|
legacy {
|
||||||
|
Directory "PinePhone"
|
||||||
|
File "PinePhone.conf"
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user