[wip] nx: use mainline audio hal
This commit is contained in:
1 parent
1449832eb1
commit
91d1e94240
5 files changed
+199
-2
No files matched your search
@@ -17,9 +17,11 @@
|
||||
TARGET_TEGRA_VARIANT ?= common
|
||||
|
||||
TARGET_KERNEL_VERSION ?= mainline
|
||||
TARGET_AUDIO_HAL ?= mainline
|
||||
TARGET_LIGHT_HAL ?= tegra
|
||||
|
||||
TARGET_ATV_FORCE_1080_SCALING := false
|
||||
TARGET_AUDIO_MAINLINE_UCM_PROFILES := nx tegra-hda
|
||||
|
||||
PRODUCT_COPY_FILES += \
|
||||
device/nintendo/nx/initfiles/ack.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/ack.rc
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
//
|
||||
// Copyright (C) 2026 The LineageOS Project
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
prebuilt_etc {
|
||||
name: "alsa-ucm-conf-files-Nintendo_Switch",
|
||||
vendor: true,
|
||||
relative_install_path: "alsa/ucm2/Nintendo/Switch",
|
||||
srcs: [
|
||||
"HiFi.conf",
|
||||
"Nintendo-Switch.conf",
|
||||
],
|
||||
}
|
||||
|
||||
install_symlink {
|
||||
name: "alsa-ucm-conf-link-conf.d_tegra-ape_switch-ape-rt5640.conf",
|
||||
vendor: true,
|
||||
installed_location: "etc/alsa/ucm2/conf.d/tegra-ape/switch-ape-rt5640.conf",
|
||||
symlink_target: "../../Nintendo/Switch/Nintendo-Switch.conf",
|
||||
}
|
||||
|
||||
phony {
|
||||
name: "alsa-ucm-conf-card-nx",
|
||||
required: [
|
||||
"alsa-ucm-conf-base",
|
||||
"alsa-ucm-conf-files-Nintendo_Switch",
|
||||
"alsa-ucm-conf-files-codecs_hda",
|
||||
"alsa-ucm-conf-files-codecs_rt5640",
|
||||
"alsa-ucm-conf-files-lib",
|
||||
"alsa-ucm-conf-link-conf.d_tegra-ape_switch-ape-rt5640.conf",
|
||||
],
|
||||
}
|
||||
+141
@@ -0,0 +1,141 @@
|
||||
# Use case Configuration for Nintendo Switch
|
||||
|
||||
SectionVerb {
|
||||
EnableSequence [
|
||||
cset "name='ADMAIF1 Mux' I2S1"
|
||||
cset "name='I2S1 Mux' ADMAIF1"
|
||||
]
|
||||
|
||||
DisableSequence [
|
||||
cset "name='x OUT MIXL DAC L1 Switch' off"
|
||||
cset "name='x OUT MIXR DAC R1 Switch' off"
|
||||
]
|
||||
|
||||
# ALSA PCM
|
||||
Value {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
SectionDevice."Headphones" {
|
||||
Comment "Headphones playback"
|
||||
|
||||
ConflictingDevice [
|
||||
"Speaker"
|
||||
]
|
||||
|
||||
EnableSequence [
|
||||
cset "name='x HPO MIX HPVOL Switch' on"
|
||||
cset "name='x HP L Playback Switch' on"
|
||||
cset "name='x HP R Playback Switch' on"
|
||||
cset "name='x OUT MIXL DAC L1 Switch' on"
|
||||
cset "name='x OUT MIXR DAC R1 Switch' on"
|
||||
cset "name='x Stereo DAC MIXL DAC L1 Switch' on"
|
||||
cset "name='x Stereo DAC MIXR DAC R1 Switch' on"
|
||||
cset "name='x DAC1 Playback Volume' 170,170"
|
||||
cset "name='x HP Playback Volume' 31,31"
|
||||
cset "name='x HP Channel Switch' on,on"
|
||||
]
|
||||
|
||||
DisableSequence [
|
||||
cset "name='x HP Playback Volume' 0,0"
|
||||
cset "name='x HP Channel Switch' off,off"
|
||||
cset "name='x DAC1 Playback Volume' 0,0"
|
||||
cset "name='x OUT MIXL DAC L1 Switch' off"
|
||||
cset "name='x OUT MIXR DAC R1 Switch' off"
|
||||
cset "name='x HPO MIX HPVOL Switch' off"
|
||||
cset "name='x HP L Playback Switch' off"
|
||||
cset "name='x HP R Playback Switch' off"
|
||||
cset "name='x Stereo DAC MIXL DAC L1 Switch' off"
|
||||
cset "name='x Stereo DAC MIXR DAC R1 Switch' off"
|
||||
|
||||
#cset "name='x Mic Jack' off"
|
||||
]
|
||||
|
||||
Value {
|
||||
PlaybackPCM "hw:${CardId}"
|
||||
|
||||
PlaybackChannels "2"
|
||||
PlaybackRate "48000"
|
||||
PlaybackVolume "x DAC1 Playback Volume"
|
||||
PlaybackSwitch "x HP Channel Switch"
|
||||
JackControl "x Headphone Jack"
|
||||
}
|
||||
}
|
||||
|
||||
SectionDevice."Speaker" {
|
||||
Comment "Speaker playback"
|
||||
|
||||
ConflictingDevice [
|
||||
"Headphones"
|
||||
]
|
||||
|
||||
EnableSequence [
|
||||
cset "name='x SPK MIXL DAC L1 Switch' on"
|
||||
cset "name='x SPK MIXR DAC R1 Switch' on"
|
||||
cset "name='x Speaker Channel Switch' on,on"
|
||||
cset "name='x SPOL MIX SPKVOL L Switch' on"
|
||||
cset "name='x SPOR MIX SPKVOL R Switch' on"
|
||||
cset "name='x Stereo DAC MIXL DAC L1 Switch' on"
|
||||
cset "name='x Stereo DAC MIXR DAC R1 Switch' on"
|
||||
cset "name='x DAC1 Playback Volume' 148,148"
|
||||
cset "name='x Speaker Playback Volume' 35,35"
|
||||
cset "name='x Speaker L Playback Switch' on"
|
||||
cset "name='x Speaker R Playback Switch' on"
|
||||
]
|
||||
|
||||
DisableSequence [
|
||||
cset "name='x Speaker L Playback Switch' off"
|
||||
cset "name='x Speaker R Playback Switch' off"
|
||||
cset "name='x Speaker Channel Switch' off,off"
|
||||
cset "name='x Speaker Playback Volume' 35,35"
|
||||
cset "name='x DAC1 Playback Volume' 0,0"
|
||||
cset "name='x SPK MIXL DAC L1 Switch' off"
|
||||
cset "name='x SPK MIXR DAC R1 Switch' off"
|
||||
cset "name='x SPOL MIX SPKVOL L Switch' off"
|
||||
cset "name='x SPOR MIX SPKVOL R Switch' off"
|
||||
cset "name='x Stereo DAC MIXL DAC L1 Switch' off"
|
||||
cset "name='x Stereo DAC MIXR DAC R1 Switch' off"
|
||||
]
|
||||
|
||||
Value {
|
||||
PlaybackPCM "hw:${CardId}"
|
||||
|
||||
PlaybackChannels "2"
|
||||
PlaybackRate "48000"
|
||||
PlaybackVolume "x DAC1 Playback Volume"
|
||||
PlaybackSwitch "x Speaker Channel Switch"
|
||||
}
|
||||
}
|
||||
|
||||
SectionDevice."HeadsetMic" {
|
||||
Comment "Headset Microphone"
|
||||
|
||||
EnableSequence [
|
||||
cset "name='x IN1 Boost' 5"
|
||||
cset "name='x Stereo ADC MIXL ADC1 Switch' on"
|
||||
cset "name='x ADC IF1 Data Switch' 2"
|
||||
cset "name='x ADC Capture Volume' 47,0"
|
||||
cset "name='x ADC Capture Switch' on,off"
|
||||
cset "name='x RECMIXL BST1 Switch' on"
|
||||
]
|
||||
|
||||
DisableSequence [
|
||||
cset "name='x RECMIXL BST1 Switch' off"
|
||||
cset "name='x Stereo ADC MIXL ADC1 Switch' off"
|
||||
cset "name='x ADC Capture Volume' 0,0"
|
||||
cset "name='x ADC Capture Switch' off"
|
||||
cset "name='x ADC IF1 Data Switch' 0"
|
||||
]
|
||||
|
||||
Value {
|
||||
CapturePCM "hw:${CardId}"
|
||||
|
||||
CapturePriority "100"
|
||||
CaptureChannels "2"
|
||||
CaptureRate "48000"
|
||||
CaptureVolume "x ADC Capture Volume"
|
||||
CaptureSwitch "x ADC Capture Switch"
|
||||
JackControl "x Mic Jack"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
Syntax 4
|
||||
|
||||
SectionUseCase."HiFi" {
|
||||
File "/Nintendo/Switch/HiFi.conf"
|
||||
Comment "Play HiFi quality Music"
|
||||
}
|
||||
+6
-2
@@ -2,8 +2,12 @@
|
||||
PRODUCT_PROPERTY_OVERRIDES += \
|
||||
persist.sys.media.avsync=true
|
||||
|
||||
# Baylibre audio
|
||||
ifeq ($(TARGET_AUDIO_HAL),baylibre)
|
||||
# Audio
|
||||
ifeq ($(TARGET_AUDIO_HAL),mainline)
|
||||
PRODUCT_PROPERTY_OVERRIDES += \
|
||||
vendor.audio.mainline.card.0.rates=48000 \
|
||||
vendor.audio.mainline.card.0.bits=16
|
||||
else ifeq ($(TARGET_AUDIO_HAL),baylibre)
|
||||
PRODUCT_PROPERTY_OVERRIDES += \
|
||||
ro.vendor.audio.primary.device=3
|
||||
endif
|
||||
|
||||
Reference in new issue
Block a user