You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
tl;dr: is there a way of enabling mono output for single-speaker setups? Could this be added as a simple mono/stereo switch?
Hi,
I'm running a Raspberry Pi 3B+ with a Raspberry Pi DigiAMP+ connected to a single custom 3D-printed passive speaker.
I have tried almost all the popular audio OSes and software stacks like Volumio, moOde, and piCorePlayer but was never really satisfied with any of them. They often feel sluggish, the setups are overly complex, and achieving a mono output for a single speaker setup was sometimes terribly convoluted (looking at you, moOde and CamillaDSP...). With every option, there was always something that kept me searching for a better solution.
Then I stumbled upon odio, and I really, really like it so far. It just works exactly the way I want it to. Bluetooth worked immediately, Spotify connected right away, and everything I needed was effortless to set up.
The only missing piece to make it absolute perfection for my use case is an easy way to enable a mono downmix, as I am not running a stereo pair. Is this something that could be added, maybe as a simple mono/stereo toggle anywhere?
Also, outside of a potential future UI toggle, is there a workaround I could use to achieve mono output in the meantime?
Good news, it looks totally doable in the pulseaudio backend of odio-api, and before I add it, there's an easy workaround possible.
A simple command to test:
pactl load-module module-remap-sink master=@DEFAULT_SINK@ sink_name=mono channels=1 channel_map=mono sink_properties=device.description=Mono
pactl set-default-sink mono # This can also be done directly from the audio section of the dashboard
If that works, you can add a simple script and systemd user service to service to enable this on boot, as it's done with the pulse-tcp module. Assuming you're using odio user from the rpi image, adapt to your needs if you used the script and configured another user:
/home/odio/.local/bin/pulse-mono.sh
#!/bin/bash -e# Mono downmix for single-speaker setups: loads a mono remap sink on top of# the current default sink and makes it the default. stop restores stereo.
STATE_DIR="/run/user/$(id --user)/pulse"
MODULE_ID_FILE="${STATE_DIR}/mono-module-id"
MASTER_FILE="${STATE_DIR}/mono-master"
SINK_NAME="mono"
MODULE_ARGS="sink_name=${SINK_NAME} sink_properties=device.description=Mono channels=1 channel_map=mono"wait_for_pulseaudio() {
for_in {1..20};do
pactl info >/dev/null 2>&1&&return 0
sleep 0.5
done
logger "pulse-mono: pulseaudio not reachable, exiting"exit 1
}
loaded_module_id() {
while IFS=$'\t'read -r module_id name args;doif [[ "${name}"=="module-remap-sink"&&"${args}"=="${MODULE_ARGS}" ]];thenecho"${module_id}"return 0
fidone<<(pactl list modules short)return 1
}
start() {
wait_for_pulseaudio
local master
master=$(pactl get-default-sink)if [[ "${master}"=="${SINK_NAME}" ]];then
logger "pulse-mono: already default"return 0
fiecho"${master}">"${MASTER_FILE}"local module_id
if module_id=$(loaded_module_id);then
logger "pulse-mono: remap sink already loaded (${module_id})"else
logger "pulse-mono: loading remap sink on ${master}"
module_id=$(pactl load-module module-remap-sink master="${master}"${MODULE_ARGS})fiecho"${module_id}">"${MODULE_ID_FILE}"
pactl set-default-sink "${SINK_NAME}"
}
stop() {
if [[ -f"${MASTER_FILE}" ]];then
pactl set-default-sink "$(cat "${MASTER_FILE}")"||truefilocal module_id
if [[ -f"${MODULE_ID_FILE}" ]];then
module_id=$(cat "${MODULE_ID_FILE}")else
module_id=$(loaded_module_id)|| module_id=""fiif [[ -n"${module_id}" ]];then
logger "pulse-mono: unloading remap sink (${module_id})"
pactl unload-module "${module_id}"||truefi
rm --force "${MODULE_ID_FILE}""${MASTER_FILE}"
}
case"$1"in
start) start ;;
stop) stop ;;
*) echo"Usage: $0 {start|stop}";exit 1 ;;
esac
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Hi,
I'm running a Raspberry Pi 3B+ with a Raspberry Pi DigiAMP+ connected to a single custom 3D-printed passive speaker.
I have tried almost all the popular audio OSes and software stacks like Volumio, moOde, and piCorePlayer but was never really satisfied with any of them. They often feel sluggish, the setups are overly complex, and achieving a mono output for a single speaker setup was sometimes terribly convoluted (looking at you, moOde and CamillaDSP...). With every option, there was always something that kept me searching for a better solution.
Then I stumbled upon odio, and I really, really like it so far. It just works exactly the way I want it to. Bluetooth worked immediately, Spotify connected right away, and everything I needed was effortless to set up.
The only missing piece to make it absolute perfection for my use case is an easy way to enable a mono downmix, as I am not running a stereo pair. Is this something that could be added, maybe as a simple mono/stereo toggle anywhere?
Also, outside of a potential future UI toggle, is there a workaround I could use to achieve mono output in the meantime?
Thanks a lot for all your work on this project!
All reactions