Skip to content

Commit

Permalink
rockchip: fix ASUS Tinkerboard pulseaudio config
Browse files Browse the repository at this point in the history
  • Loading branch information
paolosabatino committed Feb 7, 2025
1 parent 955de26 commit da577fe
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 19 deletions.
15 changes: 5 additions & 10 deletions config/sources/families/rockchip.conf
Original file line number Diff line number Diff line change
Expand Up @@ -201,15 +201,6 @@ fi

family_tweaks() {

if [[ $BOARD == tinkerboard ]]; then
chroot_sdcard_apt_get_install rfkill bluetooth bluez bluez-tools
if [[ -f "$SDCARD/etc/pulse/default.pa" ]]; then
sed -i -e "/#load-module module-alsa-sink/r $SRC/packages/bsp/rockchip/pulseaudio.txt" "$SDCARD/etc/pulse/default.pa" 2>&1
else
display_alert "Can't find pulseaudio config" "${BOARD} - family_tweaks" "warn"
fi
fi

# Create gpio and i2c groups on the build rootfs; they are matched against
# udev rules to allow non-root user access to these resources
chroot_sdcard addgroup --system --quiet --gid 900 gpio
Expand Down Expand Up @@ -240,7 +231,11 @@ family_tweaks_bsp() {

# Sound
cp $SRC/packages/bsp/rockchip/asound.conf $destination/etc/
cp $SRC/packages/bsp/rockchip/89-pulseaudio-usb.rules $destination/etc/udev/rules.d
if [[ "$BOARD" == "tinkerboard" ]]; then
mkdir -p $destination/etc/pulse/default.pa.d
cp $SRC/packages/bsp/rockchip/89-pulseaudio-usb.rules $destination/etc/udev/rules.d
cp $SRC/packages/bsp/rockchip/tinkerboard-usb-audio.pa $destination/etc/pulse/default.pa.d
fi

# AP6330 (BCM4330) firmware initramfs hook for in-kernel btbcm driver
mkdir -p $destination/etc/initramfs-tools/hooks
Expand Down
5 changes: 4 additions & 1 deletion packages/bsp/rockchip/89-pulseaudio-usb.rules
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
ATTRS{idVendor}=="0bda", ATTRS{idProduct}=="481a", ENV{PULSE_IGNORE}="1"
# Specific rule for ASUS Tinkerboard/S to avoid Pulseaudio autodetect
# the card because it will behave faulty
ATTRS{idVendor}=="0bda", ATTRS{idProduct}=="481a", ENV{PULSE_IGNORE}="1"

8 changes: 0 additions & 8 deletions packages/bsp/rockchip/pulseaudio.txt

This file was deleted.

9 changes: 9 additions & 0 deletions packages/bsp/rockchip/tinkerboard-usb-audio.pa
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# ALC4040 Output sinks
load-module module-alsa-sink device=hw:OnBoard,2 sink_properties=device.description="ALC4040-Analog"
load-module module-alsa-sink device=hw:OnBoard,0 sink_properties=device.description="ALC4040-BT-VOIP"
load-module module-alsa-sink device=hw:OnBoard,1 sink_properties=device.description="ALC4040-SPDIF"

# ALC4040 Input sources
load-module module-alsa-source device=hw:OnBoard,1 source_properties=device.description="ALC4040-Analog"
load-module module-alsa-source device=hw:OnBoard,0 source_properties=device.description="ALC4040-BT-VOIP"

0 comments on commit da577fe

Please sign in to comment.