Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to remap from stereo to mono within the Audio block #653

Open
jacksmi1961 opened this issue Jan 24, 2024 · 1 comment
Open

Unable to remap from stereo to mono within the Audio block #653

jacksmi1961 opened this issue Jan 24, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@jacksmi1961
Copy link

Describe the problem
Attempted to remap the stereo output to a dual mono output by following the suggestion in issue #187. The result was no audio. The suggestion was from 2021. The suggestion does not appear to work anymore. NOTE: the last comment from another user seems to back this up. I am opening up a new issue as #187 is closed.

To Reproduce
Steps to reproduce the behavior:

  1. Go to Issue Configuring Mono output with a hifiberry DAC+ #187
  2. Scroll to the bottom and follow the suggestion from Dec 20, 2021 (the last suggestion given)
  3. Load the change into the device with Balena CLI
  4. Note that audio no longer works
  5. Restore to the unmodified 3.9.6 and the audio works again.

Expected behavior
Mono Audio should be produce at both the left and right output channel

Device information

  • Raspberry Pi 3B+
  • Raspberry Pi 3 (using 64bit OS)
  • balenaOS v5.0.8
  • balenaSound 3.9.6

Additional context
Tried the #187 suggestion with a Pi that was using the Pi 3.5 mm output and with a Pi using a Hifiberry DAC+. Results were the same - no output.

On a whim I changed the default sink to:
set-default-sink balena-sound.mono
And I got dual mono on the device, BUT multi-room no longer worked from that device. I assumed that is because multi-room uses balena-sound.input as its source and that was being bypassed by my "whim". Just a guess on my part.

@jacksmi1961 jacksmi1961 added the bug Something isn't working label Jan 24, 2024
@jacksmi1961
Copy link
Author

jacksmi1961 commented Jan 25, 2024

This appears to be a PulseAudio issue and nothing to do with BalenaSound. I suspect a PulseAudio update introduced the failure we are seeing now. The only way I could find to get module-remap-sink to work, even outside of BalenaSound, is to set-default-sink to the module-remap-sink (as shown in the PulseAudio examples). This of course bypasses the BalenaSound requirement to have balena-sound.input as an abstraction for all input changes. To address this I looked at module-remap-source. This in fact worked.

If this does not work on your setup all I can tell you is dig into the PulseAudio docs and expect a lot of trial and error testing.
Here is the balena-sound.pa that I ended up with.

# See https://github.com/balena-labs-projects/balena-sound/blob/master/ARCHITECTURE.md for details

# Create balena-sound sinks
load-module module-null-sink sink_name=balena-sound.input
load-module module-null-sink sink_name=balena-sound.output
load-module module-null-sink sink_name=snapcast

load-module module-remap-source source_name=balena-sound.mono.source master=balena-sound.input.monitor master_channel_map=front-left,front-right channel_map=mono,mono remix=no

# Route all plugin input to the default sink
set-default-sink balena-sound.input

# Route audio internally, loopback sinks depend on configuration. See start.sh for details:
# balena-sound.input: For multiroom it's routed to snapcast sink, for standalone directly wired to balena-sound.output
# balena-sound.output: Set to audio sink specified by audio block
load-module module-loopback latency_msec=%INPUT_LATENCY% source=balena-sound.mono.source %INPUT_SINK%
load-module module-loopback latency_msec=%OUTPUT_LATENCY% source=balena-sound.output.monitor %OUTPUT_SINK%

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant