dakboard / Hardware-OS

DAKboard Wall Display, CPU, and Raspberry Pi
25 stars 4 forks source link

Dual Audio out (HDMI-3.5mm jack) #102

Closed cocarrig closed 7 months ago

cocarrig commented 1 year ago

Description: Creating this case to investigate and deploy multiple audio out capability for both supported devices (RPi devices and Orange Pi 3LTS).

Potential solution detailed in the following article: https://askubuntu.com/questions/78174/play-sound-through-two-or-more-outputs-devices

cocarrig commented 8 months ago

Since enhancements for volume control completed prior to the bookworm release are no longer functional in bookworm, it makes sense to fix them and address this case as well.

This will need a startup script to pull the sinks, and combine and activate them into one sink. Audio control commands will need to call the combined sink. Permissions need to be migrated from amixer for volume changes to pactl.

Script needs to run the following, and pull the name fields. They will always show as 'name: 'name': pactl list sinks

Then build a command like the following: pactl load-module module-combine-sink sink_name=combined slaves='sinkname1', 'sinkname2', 'sinkname3'

Then set the new "combined" sink as the default sink to play audio through: pactl set-default-sink combined

Update volume controls to the following commands pactl set-sink-volume combined 50%

Remove /etc/pulse/default.pa conf updates from the repo readme.

cocarrig commented 7 months ago

Completed and released in version 4.01 for RPi models, OPi may receive the update in a future release if new kernel becomes available: https://github.com/dakboard/Hardware-OS/releases/tag/4.01