Mopidy output to bluetooth speakers and audio out

I want to output my audio to 2 alsa devices silmutaneously as well, but no bluetooth involved.

1st output to my raspberry’s headphone jack (device=plug:output)
2nd output to an additional alsa device named peppyalsa (device=peppyalsa), which is used to feed audio into a named pipe (fifo), on the other end of that pipe/fifo I’m running peppymeter (a vu meter on my SPI touchscreen).
peppyalsa is an alsa plugin created by the maker of peppymeter to work around the blocking behaviour of fifo.

When testing the peppyalsa device with aplay the vu meter (peppymeter) starts immediately:
aplay -D peppyalsa /usr/share/sounds/alsa/Front_Center.wav

Now I try to output my audio from mopidy to my 2 alsa devices.
This works somehow, BUT the output to peppyalsa starts exactly after 1:05 minutes, so my vu meter starts too late, once it’s running audio is in sync.

Here are 2 output configuration I tried that work like this:

output = audioresample ! tee name=t ! queue ! alsasink device=plug:output t. ! queue ! audioresample ! alsasink device=peppyalsa

output = tee name=t t. ! queue ! alsasink device=plug:output t. ! queue ! alsasink device=peppyalsa

Both have the same behaviour, I tried some other gstreamer configs but these didn’t work at all.
I don’t know where this start delay is coming from.

Can anybody point me in the right direction how to get audio output on both alsa devices silmutaneously ?

I hope someone gets the idea.

See here too: Output to 2 alsa devices silmutaneously?

Hello
I know this topic is quite old, but is someone still active in this forum to help me?
@fmarzocca ?

sound via HDMI is working.
RPi 3B+ buster

I can not see when doing aplay -l
the bluetooth device

**** Liste der Hardware-Geräte (PLAYBACK) ****
Karte 0: b1 [bcm2835 HDMI 1], Gerät 0: bcm2835 HDMI 1 [bcm2835 HDMI 1]
  Sub-Geräte: 4/4
  Sub-Gerät #0: subdevice #0
  Sub-Gerät #1: subdevice #1
  Sub-Gerät #2: subdevice #2
  Sub-Gerät #3: subdevice #3
Karte 1: Headphones [bcm2835 Headphones], Gerät 0: bcm2835 Headphones [bcm2835 Headphones]
  Sub-Geräte: 4/4
  Sub-Gerät #0: subdevice #0
  Sub-Gerät #1: subdevice #1
  Sub-Gerät #2: subdevice #2
  Sub-Gerät #3: subdevice #3

bluetooth speaker is connected vie bluetoothctl
And this is my /etc/asound.conf

pcm.!default {
  type asym
  playback.pcm {
    type plug
    slave.pcm "output"
  }
  capture.pcm {
    type plug
    slave.pcm "input"
  }
}

pcm.output {
  type hw
  card 0
}

ctl.!default {
  type hw
  card 0
}

pcm.JBL {
        type plug
        slave.pcm {
                type bluealsa
                device "C4:30:18:D3:43:BB"
                profile "a2dp"
        }
}

Any help is appreciated

I made it!!!

this little “t.” after your ! alsasink device=jack I missed and this solved the issue!

Is there a way to optimise synch of the both outputs?

No, I don’t think there’s a way to synchronise audio over Bluetooth.

1 Like