From ad2588ede266e83065b0ebcf9305b4a43342632b Mon Sep 17 00:00:00 2001 From: Thomas McKahan Date: Sun, 9 Jun 2019 00:18:49 -0400 Subject: [PATCH] [ rockchip next ] improve ALSA config https://github.com/armbian/build/issues/1367 --- packages/bsp/rockchip/asound.conf | 69 +++++++++++++++++-- ...general-adjust-tinker-dts-hdmi-sound.patch | 13 ++++ 2 files changed, 78 insertions(+), 4 deletions(-) create mode 100644 patch/kernel/rockchip-next/general-adjust-tinker-dts-hdmi-sound.patch diff --git a/packages/bsp/rockchip/asound.conf b/packages/bsp/rockchip/asound.conf index ca5e545b84..6559665239 100644 --- a/packages/bsp/rockchip/asound.conf +++ b/packages/bsp/rockchip/asound.conf @@ -6,8 +6,6 @@ pcm.OnBoard_D0 { } - - pcm.OnBoard_D1 { type hw @@ -16,8 +14,6 @@ pcm.OnBoard_D1 { } - - pcm.OnBoard_D2 { type hw @@ -25,3 +21,68 @@ pcm.OnBoard_D2 { device 2 } + +# Configuration to expose the SPDIF device of RK3288 to ALSA. +# The device tree must describe a simple-audio-card device named "SPDIF" +# for this to work properly +# This percolates to PulseAudio, which will eventually show the proper +# labels to the audio device + + + +cards.SPDIF.pcm.iec958.0 { + @args [ CARD AES0 AES1 AES2 AES3 ] + @args.CARD { + type string + } + @args.AES0 { + type integer + } + @args.AES1 { + type integer + } + @args.AES2 { + type integer + } + @args.AES3 { + type integer + } + type hw + card $CARD + +} + +# Configuration to expose the HDMI device of RK3288 to ALSA. +# The device tree must describe a simple-audio-card device named "DW-I2S-HDMI" +# for this to work properly +# This percolates to PulseAudio, which will eventually show the proper +# labels to the audio device + + + +cards.DW-I2S-HDMI.pcm.hdmi.0 { + @args [ CARD DEVICE CTLINDEX AES0 AES1 AES2 AES3 ] + @args.CARD { + type string + } + @args.DEVICE { + type integer + } + @args.CTLINDEX { + type integer + } + @args.AES0 { + type integer + } + @args.AES1 { + type integer + } + @args.AES2 { + type integer + } + @args.AES3 { + type integer + } + type hw + card $CARD +} diff --git a/patch/kernel/rockchip-next/general-adjust-tinker-dts-hdmi-sound.patch b/patch/kernel/rockchip-next/general-adjust-tinker-dts-hdmi-sound.patch new file mode 100644 index 0000000000..befe282f82 --- /dev/null +++ b/patch/kernel/rockchip-next/general-adjust-tinker-dts-hdmi-sound.patch @@ -0,0 +1,13 @@ +diff --git a/arch/arm/boot/dts/rk3288-tinker.dts b/arch/arm/boot/dts/rk3288-tinker.dts +index 958c0f3bf..59b8d8eac 100644 +--- a/arch/arm/boot/dts/rk3288-tinker.dts ++++ b/arch/arm/boot/dts/rk3288-tinker.dts +@@ -70,7 +70,7 @@ + sound { + compatible = "simple-audio-card"; + simple-audio-card,format = "i2s"; +- simple-audio-card,name = "rockchip,tinker-codec"; ++ simple-audio-card,name = "DW-I2S-HDMI"; + simple-audio-card,mclk-fs = <512>; + + simple-audio-card,codec {