Skip to content

Commit

Permalink
rocknix: add startup script support for the new virtual audio devices
Browse files Browse the repository at this point in the history
enable virtual audio driver for RK3326 and RK3566 platforms

RK3566-X55: fix low volume issue after adding virtual devices

Quirks: fix audio volume for X55

Signed-off-by: Paul Reioux <[email protected]>

S922x quirks: adjust master volume to 100% for virtual audio

virtual audio devices will have their normal volume set by system to 60%
default but the master volume needs to be at 100%

RK3326/3566/X55 quirks: move volume script from 050 to 051

as 050 is overloaded with other scripts

RK3399 Quirk: adjust master volume to 100% for virtual audio

virtual audio devices will have their normal volume set by system to 60%
default but the master volume needs to be at 100%

RK3588 Quirk: adjust master volume to 100% for virtual audio

virtual audio devices will have their normal volume set by system to 60%
default but the master volume needs to be at 100%

Quirks: remove old files

quirks: ensure helper functions are available

quirks: the initializations to after all pipewire inits are done

quirks: common: set virtual audio settings

Quirks: consolidate functions to reduce copy and paste
  • Loading branch information
faux123 authored and sydarn committed Jun 12, 2024
1 parent 21e3eaf commit 58d69c7
Show file tree
Hide file tree
Showing 7 changed files with 71 additions and 8 deletions.
16 changes: 16 additions & 0 deletions packages/hardware/quirks/autostart/051-volume
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/sh
# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2023 JELOS (https://github.com/JustEnoughLinuxOS)

. /storage/.config/profile.d/001-device_config

# start virtual audio driver

VAUDIODRV=$(get_setting audio.v-driver)

if [ -z "${VAUDIODRV}" ]
then
/usr/bin/audio_vdriver.sh --start
else
/usr/bin/audio_vdriver.sh ${VAUDIODRV}
fi
9 changes: 9 additions & 0 deletions packages/hardware/quirks/platforms/RK3326/051-volume
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh

# ensure built-in helper functions are available
. /etc/profile.d/001-functions

# after virtual device added, we need to set the real device volume to maximum, so grab the real device id
number=$(wpctl status | grep -m 1 "Built-in Audio Headphones" | grep -Eo '[0-9]+' | awk 'NR==1{print; exit}')

sel_audio_sink "$number"
9 changes: 9 additions & 0 deletions packages/hardware/quirks/platforms/RK3399/051-volume
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh

# ensure built-in helper functions are available
. /etc/profile.d/001-functions

# after virtual device added, we need to set the real device volume to maximum, so grab the real device id
number=$(wpctl status | grep -m 1 "Built-in Audio Headphones" | grep -Eo '[0-9]+' | awk 'NR==1{print; exit}')

sel_audio_sink "$number"
8 changes: 0 additions & 8 deletions packages/hardware/quirks/platforms/RK3566/050-volume

This file was deleted.

19 changes: 19 additions & 0 deletions packages/hardware/quirks/platforms/RK3566/051-volume
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/sh
# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2023 JELOS (https://github.com/JustEnoughLinuxOS)

. /storage/.config/profile.d/001-device_config
. /etc/profile.d/001-functions

# RK3566 devices have a master volume attached to card 0 that needs to be set to 100% on startup.
amixer -c 1 set "Master" "100%"

# after virtual device added, we need to set the real device volume to maximum, so grab the real device id
number=$(wpctl status | grep -m 1 "Built-in Audio Headphones" | grep -Eo '[0-9]+' | awk 'NR==1{print; exit}')

# RK3566-X55 case
if ! [[ $number =~ ^[0-9]+$ ]]; then
number=$(wpctl status | grep -m 1 "Built-in Audio Internal" | grep -Eo '[0-9]+' | awk 'NR==1{print; exit}')
fi

sel_audio_sink "$number"
9 changes: 9 additions & 0 deletions packages/hardware/quirks/platforms/RK3588/051-volume
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh

# ensure built-in helper functions are available
. /etc/profile.d/001-functions

# after virtual device added, we need to set the real device volume to maximum, so grab the real device id
number=$(wpctl status | grep -m 1 "Built-in Audio Stereo" | grep -Eo '[0-9]+' | awk 'NR==1{print; exit}')

sel_audio_sink "$number"
9 changes: 9 additions & 0 deletions packages/hardware/quirks/platforms/S922X/051-volume
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh

# ensure built-in helper functions are available
. /etc/profile.d/001-functions

# after virtual device added, we need to set the real device volume to maximum, so grab the real device id
number=$(wpctl status | grep -m 1 "Built-in Audio Pro" | grep -Eo '[0-9]+' | awk 'NR==1{print; exit}')

sel_audio_sink "$number"

0 comments on commit 58d69c7

Please sign in to comment.