Use external pulseaudio sink for output is not working


I have a working multiroom audio setup running on a raspberry pi.
My picroft (another raspberry pi) is running great using matrix voice as input device and 3,5mm cable with external speakers as output device.

What i want to do is, that mycroft uses my external pulseaudio sink as output which does not work.

I verified that the following command gives output on my multiroom audio setup correctly (running as user pi)

paplay --server=<ip> --device=<sinkName> --volume=35536 start_listening.wav

When i change the following line in /home/pi/mycroft-core/mycroft/configuration/mycroft.conf:


"play_wav_cmdline": "paplay %1 --stream-name=mycroft-voice",


"play_wav_cmdline": "paplay --server=<ip> --device=<sinkName> --volume=65536 %1 --stream-name=mycroft-voice",


"play_wav_cmdline": "paplay --server=<ip> --device=<sinkName> --volume=65536 %1",

The audio output (activation sound or tts output) stills comes out of the external speakers connected by 3,5mm cable.

What did i miss?

As far as I understand Mycroft takes control over PulseAudio as soon as Mycroft-Audio services are started. This may be the reason why the test on the console works as desired but paplay issued from Mycroft does not.

Maybe you can try editing /etc/pulse/ and change the default-sink?

Thanks for your reply @Dominik.
I double checked what i did and the activation sound is send correctly through my multiroom setup.
To be sure i edited /etc/mycroft/mycroft.conf too (additional to /home/pi/mycroft/…/mycroft.conf)
But the tts output is still played through local 3,5mm speaker.

Maybe tts output is an mp3 stream and i should change this line
"play_mp3_cmdline": "mpg123 -a hw:0,0 %1",

I googled on how to use mpg123 with pulseaudio. This topic seems pretty common,but i do not find the right syntax for the config line from above.

Can anybody help me on how to modify the line for pulseaudio inclusive host and sinkname.

Thank you.

Have a look at my blog post about doing a similar thing. mpg123 does not allow much pulseaudio changes, so I used mplayer.

(not 100% sure if everything is still up to date with current development, but think the pulseaudio section might give you enough pointers to keep going)

Even if your link seems broken you got the right “keyword” for me - mplayer.
The following steps made mycroft use my existing remote pulseaudio sinks for tts.

  1. sudo apt-get install mplayer

  2. edit /etc/pulse/ and adding the following line
    load-module module-tunnel-sink sink_name=<localSinkAlias> server=<pulseaudioServer> sink=<remoteSinkName>

  3. Restart pulseaudio
    pulseaudio -k
    pulseaudio --start

  4. Modify mycroft.conf and replace the following content
    "play_mp3_cmdline": "mpg123 %1",
    "play_mp3_cmdline": "mplayer -ao pulse::<localSinkAlias> -volume 40 %1",

  5. /home/pi/mycroft-core/

  6. bash /home/pi/

Maybe that’s helpful for anyone :slight_smile:


Yeah, that looks about right / similar as what I wrote.:wink: