From fa41aa9f7ee287402908fa9b23c31f3fea97d214 Mon Sep 17 00:00:00 2001 From: Felix Gerking <felix.gerking@garz-fricke.com> Date: Tue, 28 Jun 2022 14:56:22 +0200 Subject: [PATCH] alsa:imx6: Switch to sgtl5000 as default audio card Replaced absolute card number by the ID of the sgtl5000 audio card. Added additional alsa configuration files for imx6ull as it does not have the sgtl5000 codec. BCS 746-000548 (cherry picked from commit b3c8ca1b65107f78289fa8d97875b802276a6565) --- recipes-bsp/alsa-state/alsa-state.bbappend | 5 + .../alsa-state/mx6-nxp-bsp/asound.conf | 11 +- .../alsa-state/alsa-state/mx6ull/asound.conf | 39 ++ .../alsa-state/alsa-state/mx6ull/asound.state | 351 ++++++++++++++++++ 4 files changed, 402 insertions(+), 4 deletions(-) create mode 100644 recipes-bsp/alsa-state/alsa-state/mx6ull/asound.conf create mode 100755 recipes-bsp/alsa-state/alsa-state/mx6ull/asound.state diff --git a/recipes-bsp/alsa-state/alsa-state.bbappend b/recipes-bsp/alsa-state/alsa-state.bbappend index 0596d520..4b68b907 100644 --- a/recipes-bsp/alsa-state/alsa-state.bbappend +++ b/recipes-bsp/alsa-state/alsa-state.bbappend @@ -9,6 +9,11 @@ SRC_URI:append:mx6-generic-bsp = " \ file://asound.conf \ " +SRC_URI:append:mx6ull-generic-bsp = " \ + file://asound.state \ + file://asound.conf \ +" + SRC_URI:append:mx8-generic-bsp = " \ file://asound.state \ file://asound.conf \ diff --git a/recipes-bsp/alsa-state/alsa-state/mx6-nxp-bsp/asound.conf b/recipes-bsp/alsa-state/alsa-state/mx6-nxp-bsp/asound.conf index 262178be..3036c73c 100644 --- a/recipes-bsp/alsa-state/alsa-state/mx6-nxp-bsp/asound.conf +++ b/recipes-bsp/alsa-state/alsa-state/mx6-nxp-bsp/asound.conf @@ -1,16 +1,18 @@ pcm.card0 { type hw - card 0 + card imx6sgtl5000aud + } ctl.card0 { type hw - card 0 + card imx6sgtl5000aud + } ctl.mixer0{ type hw - card 0 + card imx6sgtl5000aud } # Downmix everything to mono @@ -30,7 +32,8 @@ pcm.monocard { ctl.monocard { type hw - card 0 + card imx6sgtl5000aud } pcm.!default monocard +ctl.!default monocard diff --git a/recipes-bsp/alsa-state/alsa-state/mx6ull/asound.conf b/recipes-bsp/alsa-state/alsa-state/mx6ull/asound.conf new file mode 100644 index 00000000..a54d0b19 --- /dev/null +++ b/recipes-bsp/alsa-state/alsa-state/mx6ull/asound.conf @@ -0,0 +1,39 @@ +pcm.card0 { + type hw + card 0 + +} + +ctl.card0 { + type hw + card 0 + +} + +ctl.mixer0{ + type hw + card 0 +} + +# Downmix everything to mono +pcm.monocard { + slave.pcm card0 + slave.channels 2 + type route + ttable { + # Copy both input channels to output channel 0 (Left). + 0.0 1 + 1.0 1 + # Send nothing to output channel 1 (Right). + 0.1 0 + 1.1 0 + } +} + +ctl.monocard { + type hw + card 0 +} + +pcm.!default monocard +ctl.!default monocard diff --git a/recipes-bsp/alsa-state/alsa-state/mx6ull/asound.state b/recipes-bsp/alsa-state/alsa-state/mx6ull/asound.state new file mode 100755 index 00000000..dcdba4ec --- /dev/null +++ b/recipes-bsp/alsa-state/alsa-state/mx6ull/asound.state @@ -0,0 +1,351 @@ +state.imx6sgtl5000aud { + control.1 { + iface MIXER + name 'PCM Playback Volume' + value.0 192 + value.1 192 + comment { + access 'read write' + type INTEGER + count 2 + range '0 - 192' + } + } + control.2 { + iface MIXER + name 'Capture Volume' + value.0 12 + value.1 12 + comment { + access 'read write' + type INTEGER + count 2 + range '0 - 15' + } + } + control.3 { + iface MIXER + name 'Capture Attenuate Switch (-6dB)' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.4 { + iface MIXER + name 'Capture ZC Switch' + value true + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.5 { + iface MIXER + name 'Capture Switch' + value true + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.6 { + iface MIXER + name 'Headphone Playback Volume' + value.0 115 + value.1 115 + comment { + access 'read write' + type INTEGER + count 2 + range '0 - 127' + dbmin -5150 + dbmax 1200 + dbvalue.0 600 + dbvalue.1 600 + } + } + control.7 { + iface MIXER + name 'Headphone Playback Switch' + value true + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.8 { + iface MIXER + name 'Headphone Playback ZC Switch' + value true + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.9 { + iface MIXER + name 'Mic Volume' + value 2 + comment { + access 'read write' + type INTEGER + count 1 + range '0 - 3' + dbmin 0 + dbmax 4000 + dbvalue.0 3000 + } + } + control.10 { + iface MIXER + name 'Lineout Playback Volume' + value.0 28 + value.1 28 + comment { + access 'read write' + type INTEGER + count 2 + range '0 - 31' + dbmin -1550 + dbmax 0 + dbvalue.0 -150 + dbvalue.1 -150 + } + } + control.11 { + iface MIXER + name 'Lineout Playback Switch' + value true + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.12 { + iface MIXER + name 'DAP Main channel' + value 32768 + comment { + access 'read write' + type INTEGER + count 1 + range '0 - 65535' + dbmin 0 + dbmax 65535 + dbvalue.0 32768 + } + } + control.13 { + iface MIXER + name 'DAP Mix channel' + value 0 + comment { + access 'read write' + type INTEGER + count 1 + range '0 - 65535' + dbmin 0 + dbmax 65535 + dbvalue.0 0 + } + } + control.14 { + iface MIXER + name 'AVC Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.15 { + iface MIXER + name 'AVC Hard Limiter Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.16 { + iface MIXER + name 'AVC Max Gain Volume' + value 0 + comment { + access 'read write' + type INTEGER + count 1 + range '0 - 2' + dbmin 0 + dbmax 1200 + dbvalue.0 0 + } + } + control.17 { + iface MIXER + name 'AVC Integrator Response' + value 1 + comment { + access 'read write' + type INTEGER + count 1 + range '0 - 3' + } + } + control.18 { + iface MIXER + name 'AVC Threshold Volume' + value 12 + comment { + access 'read write' + type INTEGER + count 1 + range '0 - 96' + dbmin 0 + dbmax 9600 + dbvalue.0 1200 + } + } + control.19 { + iface MIXER + name 'BASS 0' + value 47 + comment { + access 'read write' + type INTEGER + count 1 + range '0 - 95' + dbmin -1175 + dbmax 1200 + dbvalue.0 0 + } + } + control.20 { + iface MIXER + name 'BASS 1' + value 47 + comment { + access 'read write' + type INTEGER + count 1 + range '0 - 95' + dbmin -1175 + dbmax 1200 + dbvalue.0 0 + } + } + control.21 { + iface MIXER + name 'BASS 2' + value 47 + comment { + access 'read write' + type INTEGER + count 1 + range '0 - 95' + dbmin -1175 + dbmax 1200 + dbvalue.0 0 + } + } + control.22 { + iface MIXER + name 'BASS 3' + value 47 + comment { + access 'read write' + type INTEGER + count 1 + range '0 - 95' + dbmin -1175 + dbmax 1200 + dbvalue.0 0 + } + } + control.23 { + iface MIXER + name 'BASS 4' + value 47 + comment { + access 'read write' + type INTEGER + count 1 + range '0 - 95' + dbmin -1175 + dbmax 1200 + dbvalue.0 0 + } + } + control.24 { + iface MIXER + name 'Capture Mux' + value MIC_IN + comment { + access 'read write' + type ENUMERATED + count 1 + item.0 MIC_IN + item.1 LINE_IN + } + } + control.25 { + iface MIXER + name 'Headphone Mux' + value DAC + comment { + access 'read write' + type ENUMERATED + count 1 + item.0 DAC + item.1 LINE_IN + } + } + control.26 { + iface MIXER + name 'Digital Input Mux' + value I2S + comment { + access 'read write' + type ENUMERATED + count 1 + item.0 ADC + item.1 I2S + item.2 Rsvrd + item.3 DAP + } + } + control.27 { + iface MIXER + name 'DAP Mux' + value ADC + comment { + access 'read write' + type ENUMERATED + count 1 + item.0 ADC + item.1 I2S + } + } + control.28 { + iface MIXER + name 'DAP MIX Mux' + value ADC + comment { + access 'read write' + type ENUMERATED + count 1 + item.0 ADC + item.1 I2S + } + } +} -- GitLab