PulseAudio support


#1

Hi,

Is it possible to use Snips with PulseAudio? Would it be possible to apply special settings on Snips side, e.g. similar to AlexaPi?
At the moment, I am trying to use RPi3 with PS3 eye microphone and Snips which works, but ALSA does not work properly with multi channel microphones e.g. not possible to adjust the microphone volume. Therefore, I’ve tried to use PulseAudio, however, it seems like Snips is still trying to connect ALSA directly despite settings in ~/.asoundrcfile.


#2

Hello Molodax,

We don’t currently support PulseAudio on our docker image. However we are working on having a debian package working in the near future that will give you the option of plugging whatever audio source you want. Stay tuned !


#3

Hi @Charles,
Is there any update since July?


#4

The debian packages are available.


#5

Hi, I did not manage to get snips using pulseaudio. I used the guide from https://docs.snips.ai/guides/raspberry-pi-guides/sound-setup-linux. It is working, but the sound is going directly to alsa device and not through pulseaudio. How the setup is to be done? Any help would be apreciated.


Pulseaudio support for sound output
#6

I have the same issue, Snips does not play via pulseaudio after installing pulseaudio on the rapsberrypi and restarting snips-audio-server.
Essentially I followed the tutorial.
Is there an additional step needed, that is not listed in the tutorial?

Here are the logs of starting the audio server with -vvv:

Jan 08 19:15:54 raspberrypi systemd[1]: Started Snips Audio Server.
Jan 08 19:15:54 raspberrypi snips-audio-server[2547]: DEBUG:snips_common_cli::cli: conf lookup: snips-audio-server.frame -> Ok(None)
Jan 08 19:15:54 raspberrypi snips-audio-server[2547]: DEBUG:snips_common_cli::cli: conf lookup: snips-common.frame -> Ok(None)
Jan 08 19:15:54 raspberrypi snips-audio-server[2547]: DEBUG:snips_common_cli::cli: conf lookup: snips-audio-server.nomike -> Ok(None)
Jan 08 19:15:54 raspberrypi snips-audio-server[2547]: DEBUG:snips_common_cli::cli: conf lookup: snips-common.nomike -> Ok(None)
Jan 08 19:15:54 raspberrypi snips-audio-server[2547]: DEBUG:snips_common_cli::cli: conf lookup: snips-audio-server.mike -> Ok(None)
Jan 08 19:15:54 raspberrypi snips-audio-server[2547]: DEBUG:snips_common_cli::cli: conf lookup: snips-common.mike -> Ok(None)
Jan 08 19:15:54 raspberrypi snips-audio-server[2547]: DEBUG:snips_common_cli::cli: conf lookup: snips-audio-server.bind -> Ok(None)
Jan 08 19:15:54 raspberrypi snips-audio-server[2547]: DEBUG:snips_common_cli::cli: conf lookup: snips-common.bind -> Ok(None)
Jan 08 19:15:54 raspberrypi snips-audio-server[2547]: DEBUG:snips_common_cli::cli: conf lookup: snips-audio-server.alsa_capture -> Ok(None)
Jan 08 19:15:54 raspberrypi snips-audio-server[2547]: DEBUG:snips_common_cli::cli: conf lookup: snips-common.alsa_capture -> Ok(None)
Jan 08 19:15:54 raspberrypi snips-audio-server[2547]: DEBUG:snips_common_cli::cli: conf lookup: snips-audio-server.hijack -> Ok(None)
Jan 08 19:15:54 raspberrypi snips-audio-server[2547]: DEBUG:snips_common_cli::cli: conf lookup: snips-common.hijack -> Ok(None)
Jan 08 19:15:54 raspberrypi snips-audio-server[2547]: DEBUG:snips_common_cli::cli: conf lookup: snips-audio-server.bind -> Ok(None)
Jan 08 19:15:54 raspberrypi snips-audio-server[2547]: DEBUG:snips_common_cli::cli: conf lookup: snips-common.bind -> Ok(None)
Jan 08 19:15:54 raspberrypi snips-audio-server[2547]: DEBUG:snips_common_cli::cli: conf lookup: snips-audio-server.bus -> Ok(None)
Jan 08 19:15:54 raspberrypi snips-audio-server[2547]: DEBUG:snips_common_cli::cli: conf lookup: snips-common.bus -> Ok(None)
Jan 08 19:15:54 raspberrypi snips-audio-server[2547]: DEBUG:snips_common_cli::cli: conf lookup: snips-audio-server.mqtt -> Ok(None)
Jan 08 19:15:54 raspberrypi snips-audio-server[2547]: DEBUG:snips_common_cli::cli: conf lookup: snips-common.mqtt -> Ok(None)
Jan 08 19:15:54 raspberrypi snips-audio-server[2547]: DEBUG:snips_common_cli::cli: conf lookup: snips-audio-server.mqtt_username -> Ok(None)
Jan 08 19:15:54 raspberrypi snips-audio-server[2547]: DEBUG:snips_common_cli::cli: conf lookup: snips-common.mqtt_username -> Ok(None)
Jan 08 19:15:54 raspberrypi snips-audio-server[2547]: DEBUG:snips_common_cli::cli: conf lookup: snips-audio-server.mqtt_password -> Ok(None)
Jan 08 19:15:54 raspberrypi snips-audio-server[2547]: DEBUG:snips_common_cli::cli: conf lookup: snips-common.mqtt_password -> Ok(None)
Jan 08 19:15:54 raspberrypi snips-audio-server[2547]: DEBUG:snips_common_cli::cli: conf lookup: snips-audio-server.mqtt_tls_hostname -> Ok(None)
Jan 08 19:15:54 raspberrypi snips-audio-server[2547]: DEBUG:snips_common_cli::cli: conf lookup: snips-common.mqtt_tls_hostname -> Ok(None)
Jan 08 19:15:54 raspberrypi snips-audio-server[2547]: DEBUG:snips_audio_server   : About to start audio main server on MQTT with site-id default
Jan 08 19:15:54 raspberrypi snips-audio-server[2547]: DEBUG:snips_common_cli::cli: conf lookup: snips-audio-server.alsa_playback -> Ok(None)
Jan 08 19:15:54 raspberrypi snips-audio-server[2547]: DEBUG:snips_common_cli::cli: conf lookup: snips-common.alsa_playback -> Ok(None)
Jan 08 19:15:54 raspberrypi snips-audio-server[2547]: DEBUG:snips_common_cli::cli: conf lookup: snips-audio-server.disable_playback -> Ok(None)
Jan 08 19:15:54 raspberrypi snips-audio-server[2547]: DEBUG:snips_common_cli::cli: conf lookup: snips-common.disable_playback -> Ok(None)
Jan 08 19:15:54 raspberrypi snips-audio-server[2547]: DEBUG:snips_common_cli::cli: conf lookup: snips-audio-server.output -> Ok(None)
Jan 08 19:15:54 raspberrypi snips-audio-server[2547]: DEBUG:snips_common_cli::cli: conf lookup: snips-common.output -> Ok(None)
Jan 08 19:15:54 raspberrypi snips-audio-server[2547]: INFO:snips_broadcast_mqtt_server: Starting broadcasting audio on hermes as site "default"
Jan 08 19:15:54 raspberrypi snips-audio-server[2547]: DEBUG:snips_broadcast_mqtt_server: Audio reading started
Jan 08 19:15:54 raspberrypi snips-audio-server[2547]: DEBUG:snips_audio_portaudio      : Attempt 0
Jan 08 19:15:54 raspberrypi snips-audio-server[2547]: DEBUG:snips_audio_portaudio      : Mike source capture started
Jan 08 19:15:54 raspberrypi snips-audio-server[2547]: DEBUG:snips_broadcast_mqtt_server: MQTT Audio forwarding thread started
Jan 08 19:15:54 raspberrypi snips-audio-server[2547]: Failed to create secure directory (/var/empty/.config/pulse): No such file or directory
Jan 08 19:15:54 raspberrypi pulseaudio[2554]: [autospawn] core-util.c: Failed to create secure directory (/var/empty/.config/pulse): No such file or dir
Jan 08 19:15:54 raspberrypi snips-audio-server[2547]: ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.HifiberryAmp.pcm.front.
Jan 08 19:15:54 raspberrypi snips-audio-server[2547]: ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file o
Jan 08 19:15:54 raspberrypi snips-audio-server[2547]: ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
Jan 08 19:15:54 raspberrypi snips-audio-server[2547]: ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM front
Jan 08 19:15:54 raspberrypi snips-audio-server[2547]: ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
Jan 08 19:15:54 raspberrypi snips-audio-server[2547]: ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
Jan 08 19:15:54 raspberrypi snips-audio-server[2547]: ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
Jan 08 19:15:54 raspberrypi snips-audio-server[2547]: ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.HifiberryAmp.pcm.surrou
Jan 08 19:15:54 raspberrypi snips-audio-server[2547]: ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file o
Jan 08 19:15:54 raspberrypi snips-audio-server[2547]: ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
Jan 08 19:15:54 raspberrypi snips-audio-server[2547]: ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround21
Jan 08 19:15:54 raspberrypi snips-audio-server[2547]: ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.HifiberryAmp.pcm.surrou
Jan 08 19:15:54 raspberrypi snips-audio-server[2547]: ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file o
Jan 08 19:15:54 raspberrypi snips-audio-server[2547]: ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
Jan 08 19:15:54 raspberrypi snips-audio-server[2547]: ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround21
Jan 08 19:15:54 raspberrypi snips-audio-server[2547]: ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.HifiberryAmp.pcm.surrou
Jan 08 19:15:54 raspberrypi snips-audio-server[2547]: ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file o
Jan 08 19:15:54 raspberrypi snips-audio-server[2547]: ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
Jan 08 19:15:54 raspberrypi snips-audio-server[2547]: ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround40
Jan 08 19:15:54 raspberrypi snips-audio-server[2547]: ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.HifiberryAmp.pcm.surrou
Jan 08 19:15:54 raspberrypi snips-audio-server[2547]: ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file o
Jan 08 19:15:54 raspberrypi snips-audio-server[2547]: ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
Jan 08 19:15:54 raspberrypi snips-audio-server[2547]: ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround41
Jan 08 19:15:54 raspberrypi snips-audio-server[2547]: ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.HifiberryAmp.pcm.surrou
Jan 08 19:15:54 raspberrypi snips-audio-server[2547]: ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file o
Jan 08 19:15:54 raspberrypi snips-audio-server[2547]: ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
Jan 08 19:15:54 raspberrypi snips-audio-server[2547]: ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround50
Jan 08 19:15:54 raspberrypi snips-audio-server[2547]: ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.HifiberryAmp.pcm.surrou
Jan 08 19:15:54 raspberrypi snips-audio-server[2547]: ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file o
Jan 08 19:15:54 raspberrypi snips-audio-server[2547]: ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
Jan 08 19:15:54 raspberrypi snips-audio-server[2547]: ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround51
Jan 08 19:15:54 raspberrypi snips-audio-server[2547]: ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.HifiberryAmp.pcm.surrou
Jan 08 19:15:54 raspberrypi snips-audio-server[2547]: ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file o
Jan 08 19:15:54 raspberrypi snips-audio-server[2547]: ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
Jan 08 19:15:54 raspberrypi snips-audio-server[2547]: ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround71
Jan 08 19:15:54 raspberrypi snips-audio-server[2547]: ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.HifiberryAmp.pcm.iec958
Jan 08 19:15:54 raspberrypi snips-audio-server[2547]: ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file o
Jan 08 19:15:54 raspberrypi snips-audio-server[2547]: ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
Jan 08 19:15:54 raspberrypi snips-audio-server[2547]: ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM iec958
Jan 08 19:15:54 raspberrypi snips-audio-server[2547]: ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.HifiberryAmp.pcm.iec958
Jan 08 19:15:54 raspberrypi snips-audio-server[2547]: ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file o
Jan 08 19:15:54 raspberrypi snips-audio-server[2547]: ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
Jan 08 19:15:54 raspberrypi snips-audio-server[2547]: ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM spdif
Jan 08 19:15:54 raspberrypi snips-audio-server[2547]: ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.HifiberryAmp.pcm.iec958
Jan 08 19:15:54 raspberrypi snips-audio-server[2547]: ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file o
Jan 08 19:15:54 raspberrypi snips-audio-server[2547]: ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
Jan 08 19:15:54 raspberrypi snips-audio-server[2547]: ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM spdif
Jan 08 19:15:54 raspberrypi snips-audio-server[2547]: ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
Jan 08 19:15:54 raspberrypi snips-audio-server[2547]: ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
Jan 08 19:15:54 raspberrypi snips-audio-server[2547]: ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
Jan 08 19:15:54 raspberrypi snips-audio-server[2547]: ALSA lib pcm_dmix.c:1052:(snd_pcm_dmix_open) unable to open slave
Jan 08 19:15:54 raspberrypi snips-audio-server[2547]: DEBUG:snips_audio_portaudio      : Portaudio: Ok("PortAudio V19-devel (built Oct 26 2018 15:55:11)
Jan 08 19:15:54 raspberrypi snips-audio-server[2547]: DEBUG:snips_audio_portaudio      : Looking for default input device
Jan 08 19:15:54 raspberrypi snips-audio-server[2547]: INFO:snips_audio_portaudio      : Use input device: "USB Camera-B4.09.24.1: Audio (hw:1,0)"
Jan 08 19:15:54 raspberrypi snips-audio-server[2547]: DEBUG:snips_audio_portaudio      : Start capture: InputSettings { params: Parameters { device: Ind
Jan 08 19:15:54 raspberrypi snips-audio-server[2547]: DEBUG:snips_audio_portaudio      : Attempt 1
Jan 08 19:15:54 raspberrypi snips-audio-server[2547]: DEBUG:snips_audio_portaudio      : start capture loop
Jan 08 19:15:54 raspberrypi snips-audio-server[2547]: DEBUG:snips_audio_portaudio      : Attempt 2
Jan 08 19:15:54 raspberrypi snips-audio-server[2547]: DEBUG:snips_audio_portaudio      : Mike initialization looking good

#7

Hello,

If you are not with desktop version of os, the easier method seems to use systemwide configuration of pulseaudio.
I think it’s possible to use pulseaudio with daemon user (standard pulseaudio config) in lite os, but i don’t really finish my research of something clean on this point.

Ced


#8

Thanks for your reply.
I used a system-wide configuration now and it seems to work.


#9

How to setup system-wide: Pulseaudio support for sound output (since I as a noob spent a lot of time to setup)