Set Up JustBoom Amp HAT And Zero For Mono Output

This guide will show you how to configure ALSA on a Raspbian based OS to merge both stereo signals on one channel.

Remember that the JustBoom Amps’ channels have not been designed to be be bridged. This guide can also be used for the JustBoom DACs.

How To Configure DTS 5.1 on JustBoom Digi

Create a MONO ALSA configuration file.

When driving a single speaker the only possibility offered with the JustBoom Amps is to use one of the channels and configure ALSA so that both signals are merged into one.

This guide shows you how to create an ALSA file to direct the output to either the right or the left channel.

This guide has been tested with Raspbian.

Section 1 – Configuration file

Step 1 – Create a file called .asoundrc in your home folder by running:

nano ~/.asoundrc

and copy the following configuration in it:

ctl.!default {
 type hw card sndrpijustboomd

pcm.mmap0 {
 type mmap_emul;
 slave {
 pcm "hw:CARD=sndrpijustboomd,DEV=0"

pcm.swap {
 type plug
 slave {
 pcm mmap0;
 ttable.0.1 1
 ttable.1.0 1

pcm.mono_left {
 type plug;
 slave {
 pcm mmap0;
 ttable.0.0 0.5
 ttable.1.0 0.5

pcm.mono_right {
 type plug;
 slave {
 pcm mmap0;
 ttable.0.1 0.5
 ttable.1.1 0.5

pcm.!default mono_left
#pcm.!default mono_right
#pcm.!default swap

save the file and exit nano. (CTRL^O then CTRL^X)

Step 2 – At this point you should already see three new PCM devices. Run:

aplay -L

and you should see something similar to the following:

 Discard all samples (playback) or generate zero samples (capture)
 PulseAudio Sound Server
 Default Audio Device
 Direct sample mixing device
 Direct sample snooping device
 Direct hardware device without any conversions
 Hardware device with all software conversions

we have added a swap device which invert the channels so that left goes to right and right to left.

Section 2 – Test the configuration

To test the configuration we can use either aplay or omxplayer. Run the following command for aplay and remember that it will only be able to play WAV files.

aplay -D mono_left <filename.wav>

This should play through the left speaker.

Similarly for omxplayer run:

omxplayer -o alsa:mono_left <filename.wav>

Appendix – Tips and gotchas.

If you want the configuration to apply system wide you will need to create a file under /etc instead of the  .asoundrc mentioned above. As the folder is not writable by the user Pi you will need to run the command as root.

sudo nano /etc/asound.conf