Snips-audio-server 0.63.2 on Raspberry Pi3 chokes on InvalidSampleRate error

Hello community,

Until today, I had Snips just doing fine on a RPi 3B+ with a ReSpeaker 4mic hat. Today the 2019-05-17 kernel update came along and snips-audio-server stopped playing sounds.

  • sam test speaker works
  • aplay /some/audio/wav also works
  • Default PCM output is headphone jack (hw:0,0)

Looking at the output of snips-audio-server this looks strange:

Expression 'alsa_snd_pcm_hw_params_set_period_size_near( pcm, hwParams, &alsaPeriodFrames, &dir )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 923

When a hotword is recognised (mics apparently work fine) I get this:

Playing "82cba464-fbab-41e2-a921-83a9907cec30" using output "bcm2835 ALSA: IEC958/HDMI (hw:0,1)", wav spec: WavSpec { channels: 2, sample_rate: 22050, bits_per_sample: 16, sample_format: Int }

What puzzles me is that hw(0,0) should be the default audio device as per aplay -L. Why does it attempt to play over HDMI?

Any thoughts appreciated.

Thanks, Dan

I have many samplerates problems here too… Audio server won’t start on a fresh install…

Hi there,
I also have the same issue with a fresh install on Raspbian stretch 4.14 since May 20th '19.
Here are the tests I’ve done so far:

  • install manually snips-xxx version 0.63.2
  • install via sam version 0.63.2 (after having apt-get purge)
  • install manually snips-xxx version 0.55.2
    Each time, snips-audio-server doesn’t start and the verbose mode shows an “InvalidSampleRate” error.

In the past, I used to install snips v0.55.2 on Raspbian released on 29/11/2017. That one used to work.

So I suspect an incompatibility with last Raspbian release. Have anybody tried to reinstall snips 0.63.2 on a previous Rasbian?

We are also looking on our side. As far as we understood it seems not related to the audio-server.

Some changes happened lately on the raspbian

The kernel was updated from 4.14 to 4.19, seed drivers were also impacted.

Anyway let’s keep looking.

Keep you posted guys

EDIT

Psycho opened a ticket here

Hey everyone,

So far, here is what we found,

  • Those issues are not related to the snips platform
  • The kernel update cause some issues (you need to reboot to load the new kernel)
  • After a hard reboot, the sampling rate issue from the microphone disappears on our side.
  • The issues lies between the alsa configurations and portaudio.

[Edit]
For the one that are confident that their alsa configuration is ok, you can also try to bypass portaudio.

To do so, modify the snips-audio-server configuration in /etc/snips.toml to add the following options.

alsa_playback = "default"
alsa_capture = "default"

(adapt this depending on your alsa configuration of course ;), default is the common name, it may vary on your configuration )

1 Like

Just for clarification, Psycho’s ticket and etienne’s problem seem to be related to audio capture, in which case snips-audio-server fails to start.

My problem is that somehow snips-audio-server chooses the wrong playback device. The server starts, but gets stuck on the confirmation sounds. Capture works as expected.

Hi there,

before 21. May 2019 Snips on Raspberry 3 B+ with Stretch and latest snips version snips worked fine.
After complete new install of Stretch&snips the audio server is not running anymore.

The microphone test is succesfull.
Reboot doesn’t help.

I guess it is not the problem above for sampling rates, isn’t it?

Peter

Service status:
snips-analytics … (not running)
snips-asr … 0.63.2 (running)
snips-audio-server … 0.63.2 (not running)
snips-dialogue … 0.63.2 (running)
snips-hotword … 0.63.2 (running)
snips-nlu … 0.63.2 (running)
snips-skill-server … 0.63.2 (running)
snips-tts … 0.63.2 (running)

arecord:
card 1: UB1 [Samson UB1], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0

asound.conf:
pcm.!default {
type asym
playback.pcm {
type plug
slave.pcm “hw:0,0”
}
capture.pcm {
type plug
slave.pcm “hw:1,0”
}
}

Tried, but helped not:
snips.toml:
mike = “Samson UB1: - (hw:1,0)”

Hi, I can confirm this workaround for my environment. Just setup a second raspi (model 1B+) for snips satellite and wondered why this audio-server didn’t start.
Thx for your hint!

Hi,
cant get my snips working after kernel update. Did all the hints in this thread, the thread on git and in the matrix forum. i am very depressd about this.

can anybody help me? If i do “sam setup audio” all works well. Then “sam test microphone” also works well with recording and play the sound. But snips has no output.

Output from audio server:

Blockquote
sam service log | grep snips-audio
Jun 28 19:13:49 jeannie snips-audio-server[3782]: INFO:snips_audio_portaudio : Playing “e1b48fdd-c7f4-4ff9-8871-b 48e689ec630” using output “bcm2835 ALSA: IEC958/HDMI (hw:0,1)”, wav spec: WavSpec { channels: 2, sample_rate: 22050, b its_per_sample: 16, sample_format: Int }
Jun 28 19:13:49 jeannie snips-audio-server[3782]: Expression ‘paInvalidSampleRate’ failed in ‘src/hostapi/alsa/pa_linu x_alsa.c’, line: 2043
Jun 28 19:13:49 jeannie snips-audio-server[3782]: Expression ‘PaAlsaStreamComponent_InitialConfigure( &self->playback, outParams, self->primeBuffers, hwParamsPlayback, &realSr )’ failed in ‘src/hostapi/alsa/pa_linux_alsa.c’, line: 2717
Jun 28 19:13:49 jeannie snips-audio-server[3782]: Expression ‘PaAlsaStream_Configure( stream, inputParameters, outputP arameters, sampleRate, framesPerBuffer, &inputLatency, &outputLatency, &hostBufferSizeMode )’ failed in ‘src/hostapi/a lsa/pa_linux_alsa.c’, line: 2838
Jun 28 19:13:49 jeannie snips-audio-server[3782]: ERROR:snips_audio_server_hermes : could not play “e1b48fdd-c7f4-4ff 9-8871-b48e689ec630”
Jun 28 19:13:49 jeannie snips-audio-server[3782]: -> caused by: InvalidSampleRate
Jun 28 19:13:49 jeannie snips-audio-server[3782]: thread ‘portaudio.player’ panicked at ‘called Result::unwrap() on an Err value: “SendError(…)”’, src/libcore/result.rs:997:5
Jun 28 19:13:49 jeannie snips-audio-server[3782]: note: Run with RUST_BACKTRACE=1 environment variable to display a backtrace.
Jun 28 19:13:52 jeannie snips-audio-server[3782]: INFO:snips_audio_portaudio : Playing “6251d252-6cb5-48cc-b3cb-e bc58d30de96” using output “bcm2835 ALSA: IEC958/HDMI (hw:0,1)”, wav spec: WavSpec { channels: 2, sample_rate: 22050, b its_per_sample: 16, sample_format: Int }
Jun 28 19:13:52 jeannie snips-audio-server[3782]: Expression ‘paInvalidSampleRate’ failed in ‘src/hostapi/alsa/pa_linu x_alsa.c’, line: 2043
Jun 28 19:13:52 jeannie snips-audio-server[3782]: Expression ‘PaAlsaStreamComponent_InitialConfigure( &self->playback, outParams, self->primeBuffers, hwParamsPlayback, &realSr )’ failed in ‘src/hostapi/alsa/pa_linux_alsa.c’, line: 2717
Jun 28 19:13:52 jeannie snips-audio-server[3782]: Expression ‘PaAlsaStream_Configure( stream, inputParameters, outputP arameters, sampleRate, framesPerBuffer, &inputLatency, &outputLatency, &hostBufferSizeMode )’ failed in ‘src/hostapi/a lsa/pa_linux_alsa.c’, line: 2838
Jun 28 19:13:52 jeannie snips-audio-server[3782]: ERROR:snips_audio_server_hermes : could not play “6251d252-6cb5-48c c-b3cb-ebc58d30de96”
Jun 28 19:13:52 jeannie snips-audio-server[3782]: -> caused by: InvalidSampleRate
Jun 28 19:13:52 jeannie snips-audio-server[3782]: thread ‘portaudio.player’ panicked at ‘called Result::unwrap() on an Err value: “SendError(…)”’, src/libcore/result.rs:997:5
Jun 28 19:13:53 jeannie snips-audio-server[3782]: INFO:snips_audio_portaudio : Playing “2a652f23-be7f-41d8-a570-9 773f34d1b9d” using output “bcm2835 ALSA: IEC958/HDMI (hw:0,1)”, wav spec: WavSpec { channels: 1, sample_rate: 22050, b its_per_sample: 16, sample_format: Int }
Jun 28 19:13:53 jeannie snips-audio-server[3782]: Expression ‘paInvalidSampleRate’ failed in ‘src/hostapi/alsa/pa_linu x_alsa.c’, line: 2043
Jun 28 19:13:53 jeannie snips-audio-server[3782]: Expression ‘PaAlsaStreamComponent_InitialConfigure( &self->playback, outParams, self->primeBuffers, hwParamsPlayback, &realSr )’ failed in ‘src/hostapi/alsa/pa_linux_alsa.c’, line: 2717
Jun 28 19:13:53 jeannie snips-audio-server[3782]: Expression ‘PaAlsaStream_Configure( stream, inputParameters, outputP arameters, sampleRate, framesPerBuffer, &inputLatency, &outputLatency, &hostBufferSizeMode )’ failed in ‘src/hostapi/a lsa/pa_linux_alsa.c’, line: 2838
Jun 28 19:13:53 jeannie snips-audio-server[3782]: thread ‘portaudio.player’ panicked at ‘called Result::unwrap() on an Err value: “SendError(…)”’, src/libcore/result.rs:997:5
Jun 28 19:13:53 jeannie snips-audio-server[3782]: ERROR:snips_audio_server_hermes : could not play “2a652f23-be7f-41d 8-a570-9773f34d1b9d”
Jun 28 19:13:53 jeannie snips-audio-server[3782]: -> caused by: InvalidSampleRate
Jun 28 19:13:57 jeannie snips-audio-server[3782]: INFO:snips_audio_portaudio : Playing “51e9fe15-83c6-4020-9a75-9 890a8d46868” using output “bcm2835 ALSA: IEC958/HDMI (hw:0,1)”, wav spec: WavSpec { channels: 1, sample_rate: 22050, b its_per_sample: 16, sample_format: Int }
Jun 28 19:13:57 jeannie snips-audio-server[3782]: Expression ‘paInvalidSampleRate’ failed in ‘src/hostapi/alsa/pa_linu x_alsa.c’, line: 2043
Jun 28 19:13:57 jeannie snips-audio-server[3782]: Expression ‘PaAlsaStreamComponent_InitialConfigure( &self->playback, outParams, self->primeBuffers, hwParamsPlayback, &realSr )’ failed in ‘src/hostapi/alsa/pa_linux_alsa.c’, line: 2717
Jun 28 19:13:57 jeannie snips-audio-server[3782]: Expression ‘PaAlsaStream_Configure( stream, inputParameters, outputP arameters, sampleRate, framesPerBuffer, &inputLatency, &outputLatency, &hostBufferSizeMode )’ failed in ‘src/hostapi/a lsa/pa_linux_alsa.c’, line: 2838
Jun 28 19:13:57 jeannie snips-audio-server[3782]: thread ‘portaudio.player’ panicked at ‘called Result::unwrap() on an Err value: “SendError(…)”’, src/libcore/result.rs:997:5
Jun 28 19:13:57 jeannie snips-audio-server[3782]: ERROR:snips_audio_server_hermes : could not play “51e9fe15-83c6-402 0-9a75-9890a8d46868”
Jun 28 19:13:57 jeannie snips-audio-server[3782]: -> caused by: InvalidSampleRate

Please help, thanks

Like the other users, I am unable to get any sound played by Snips through PulseAudio.

I tried to add alsa_playback = "default" to /etc/snips.toml and here’s what I get in syslog when I run sudo systemctl start snips-audio-server:

Capture ok but wrong attempt to use HDMI as output and a bunch of error messages

Jun 29 18:09:41 raspberrypi systemd[1]: Started Snips Audio Server.
Jun 29 18:09:41 raspberrypi snips-audio-server[2295]: INFO:snips_audio_server_cli: Starting audio server on mqtt for site default
Jun 29 18:09:41 raspberrypi snips-audio-server[2295]: Failed to create secure directory (/var/empty/.config/pulse): No such file or directory
Jun 29 18:09:41 raspberrypi snips-audio-server[2295]: Failed to load cookie file from cookie: No such file or directory
Jun 29 18:09:41 raspberrypi pulseaudio[347]: Created 48 “Native client (UNIX socket client)”
Jun 29 18:09:41 raspberrypi pulseaudio[347]: Freed 48 “Native client (UNIX socket client)”
Jun 29 18:09:41 raspberrypi pulseaudio[347]: Connection died.
Jun 29 18:09:41 raspberrypi snips-audio-server[2295]: Expression ‘alsa_snd_pcm_hw_params_set_period_size_near( pcm, hwParams, &alsaPeriodFrames, &dir )’ failed in ‘src/hostapi/alsa/pa_linux_alsa.c’, line: 923
Jun 29 18:09:41 raspberrypi kernel: [ 786.367371] vc4_hdmi 3f902000.hdmi: ASoC: can’t open interface 3f902000.hdmi: -19
Jun 29 18:09:41 raspberrypi snips-audio-server[2295]: Expression ‘alsa_snd_pcm_hw_params_set_period_size_near( pcm, hwParams, &alsaPeriodFrames, &dir )’ failed in ‘src/hostapi/alsa/pa_linux_alsa.c’, line: 923
Jun 29 18:09:41 raspberrypi snips-audio-server[2295]: ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition ‘cards.bcm2835_alsa.pcm.front.0:CARD=0’
Jun 29 18:09:41 raspberrypi snips-audio-server[2295]: ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
Jun 29 18:09:41 raspberrypi snips-audio-server[2295]: ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
Jun 29 18:09:41 raspberrypi snips-audio-server[2295]: ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM front
Jun 29 18:09:41 raspberrypi snips-audio-server[2295]: ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
Jun 29 18:09:41 raspberrypi snips-audio-server[2295]: ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
Jun 29 18:09:41 raspberrypi snips-audio-server[2295]: ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
Jun 29 18:09:41 raspberrypi snips-audio-server[2295]: ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition ‘cards.bcm2835_alsa.pcm.surround51.0:CARD=0’
Jun 29 18:09:41 raspberrypi snips-audio-server[2295]: ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
Jun 29 18:09:41 raspberrypi snips-audio-server[2295]: ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
Jun 29 18:09:41 raspberrypi snips-audio-server[2295]: ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround21
Jun 29 18:09:41 raspberrypi snips-audio-server[2295]: ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition ‘cards.bcm2835_alsa.pcm.surround51.0:CARD=0’
Jun 29 18:09:41 raspberrypi snips-audio-server[2295]: ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
Jun 29 18:09:41 raspberrypi snips-audio-server[2295]: ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
Jun 29 18:09:41 raspberrypi snips-audio-server[2295]: ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround21
Jun 29 18:09:41 raspberrypi snips-audio-server[2295]: ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition ‘cards.bcm2835_alsa.pcm.surround40.0:CARD=0’
Jun 29 18:09:41 raspberrypi snips-audio-server[2295]: ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
Jun 29 18:09:41 raspberrypi snips-audio-server[2295]: ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
Jun 29 18:09:41 raspberrypi snips-audio-server[2295]: ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround40
Jun 29 18:09:41 raspberrypi snips-audio-server[2295]: ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition ‘cards.bcm2835_alsa.pcm.surround51.0:CARD=0’
Jun 29 18:09:41 raspberrypi snips-audio-server[2295]: ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
Jun 29 18:09:41 raspberrypi snips-audio-server[2295]: ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
Jun 29 18:09:41 raspberrypi snips-audio-server[2295]: ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround41
Jun 29 18:09:41 raspberrypi snips-audio-server[2295]: ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition ‘cards.bcm2835_alsa.pcm.surround51.0:CARD=0’
Jun 29 18:09:41 raspberrypi snips-audio-server[2295]: ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
Jun 29 18:09:41 raspberrypi snips-audio-server[2295]: ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
Jun 29 18:09:41 raspberrypi snips-audio-server[2295]: ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround50
Jun 29 18:09:41 raspberrypi snips-audio-server[2295]: ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition ‘cards.bcm2835_alsa.pcm.surround51.0:CARD=0’
Jun 29 18:09:41 raspberrypi snips-audio-server[2295]: ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
Jun 29 18:09:41 raspberrypi snips-audio-server[2295]: ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
Jun 29 18:09:41 raspberrypi snips-audio-server[2295]: ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround51
Jun 29 18:09:41 raspberrypi snips-audio-server[2295]: ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition ‘cards.bcm2835_alsa.pcm.surround71.0:CARD=0’
Jun 29 18:09:41 raspberrypi snips-audio-server[2295]: ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
Jun 29 18:09:41 raspberrypi snips-audio-server[2295]: ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
Jun 29 18:09:41 raspberrypi snips-audio-server[2295]: ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround71
Jun 29 18:09:41 raspberrypi snips-audio-server[2295]: ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition ‘cards.bcm2835_alsa.pcm.iec958.0:CARD=0,AES0=4,AES1=130,AES2=0,AES3=2’
Jun 29 18:09:41 raspberrypi snips-audio-server[2295]: ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
Jun 29 18:09:41 raspberrypi snips-audio-server[2295]: ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
Jun 29 18:09:41 raspberrypi snips-audio-server[2295]: ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM iec958
Jun 29 18:09:41 raspberrypi snips-audio-server[2295]: ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition ‘cards.bcm2835_alsa.pcm.iec958.0:CARD=0,AES0=4,AES1=130,AES2=0,AES3=2’
Jun 29 18:09:41 raspberrypi snips-audio-server[2295]: ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
Jun 29 18:09:41 raspberrypi snips-audio-server[2295]: ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
Jun 29 18:09:41 raspberrypi snips-audio-server[2295]: ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM spdif
Jun 29 18:09:41 raspberrypi snips-audio-server[2295]: ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition ‘cards.bcm2835_alsa.pcm.iec958.0:CARD=0,AES0=4,AES1=130,AES2=0,AES3=2’
Jun 29 18:09:41 raspberrypi snips-audio-server[2295]: ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
Jun 29 18:09:41 raspberrypi snips-audio-server[2295]: ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
Jun 29 18:09:41 raspberrypi snips-audio-server[2295]: ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM spdif
Jun 29 18:09:41 raspberrypi snips-audio-server[2295]: ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
Jun 29 18:09:41 raspberrypi snips-audio-server[2295]: ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
Jun 29 18:09:41 raspberrypi snips-audio-server[2295]: ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
Jun 29 18:09:41 raspberrypi snips-audio-server[2295]: ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
Jun 29 18:09:41 raspberrypi snips-audio-server[2295]: ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
Jun 29 18:09:41 raspberrypi snips-audio-server[2295]: ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
Jun 29 18:09:41 raspberrypi snips-audio-server[2295]: ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition ‘defaults.bluealsa.device’
Jun 29 18:09:41 raspberrypi snips-audio-server[2295]: ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
Jun 29 18:09:41 raspberrypi snips-audio-server[2295]: ALSA lib conf.c:4996:(snd_config_expand) Args evaluate error: No such file or directory
Jun 29 18:09:41 raspberrypi snips-audio-server[2295]: ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM bluealsa
Jun 29 18:09:41 raspberrypi snips-audio-server[2295]: ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition ‘defaults.bluealsa.device’
Jun 29 18:09:41 raspberrypi snips-audio-server[2295]: ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
Jun 29 18:09:41 raspberrypi snips-audio-server[2295]: ALSA lib conf.c:4996:(snd_config_expand) Args evaluate error: No such file or directory
Jun 29 18:09:41 raspberrypi snips-audio-server[2295]: ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM bluealsa
Jun 29 18:09:41 raspberrypi snips-audio-server[2295]: ALSA lib pcm_dmix.c:990:(snd_pcm_dmix_open) The dmix plugin supports only playback stream
Jun 29 18:09:42 raspberrypi snips-audio-server[2295]: ALSA lib pcm_dsnoop.c:556:(snd_pcm_dsnoop_open) The dsnoop plugin supports only capture stream
Jun 29 18:09:42 raspberrypi snips-audio-server[2295]: ALSA lib pcm_dmix.c:990:(snd_pcm_dmix_open) The dmix plugin supports only playback stream
Jun 29 18:09:42 raspberrypi snips-audio-server[2295]: ALSA lib pcm_dsnoop.c:556:(snd_pcm_dsnoop_open) The dsnoop plugin supports only capture stream
Jun 29 18:09:42 raspberrypi snips-audio-server[2295]: Failed to create secure directory (/var/empty/.config/pulse): No such file or directory
Jun 29 18:09:42 raspberrypi snips-audio-server[2295]: Failed to load cookie file from cookie: No such file or directory
Jun 29 18:09:42 raspberrypi pulseaudio[347]: Created 49 “Native client (UNIX socket client)”
Jun 29 18:09:42 raspberrypi snips-audio-server[2295]: ALSA lib pulse.c:243:(pulse_connect) PulseAudio: Unable to connect: Access denied
Jun 29 18:09:42 raspberrypi snips-audio-server[2295]: Failed to create secure directory (/var/empty/.config/pulse): No such file or directory
Jun 29 18:09:42 raspberrypi snips-audio-server[2295]: Failed to load cookie file from cookie: No such file or directory
Jun 29 18:09:42 raspberrypi pulseaudio[347]: Got credentials: uid=115 gid=122 success=0
Jun 29 18:09:42 raspberrypi snips-audio-server[2295]: ALSA lib pulse.c:243:(pulse_connect) PulseAudio: Unable to connect: Access denied
Jun 29 18:09:42 raspberrypi pulseaudio[347]: Denied access to client with invalid authentication data.
Jun 29 18:09:42 raspberrypi pulseaudio[347]: Freed 49 “Native client (UNIX socket client)”
Jun 29 18:09:42 raspberrypi pulseaudio[347]: Connection died.
Jun 29 18:09:42 raspberrypi snips-audio-server[2295]: INFO:snips_audio_portaudio : Use input device: “seeed-2mic-voicecard: - (hw:2,0)”
Jun 29 18:09:42 raspberrypi pulseaudio[347]: Created 50 “Native client (UNIX socket client)”
Jun 29 18:09:42 raspberrypi pulseaudio[347]: Got credentials: uid=115 gid=122 success=0
Jun 29 18:09:42 raspberrypi pulseaudio[347]: Denied access to client with invalid authentication data.
Jun 29 18:09:42 raspberrypi pulseaudio[347]: Freed 50 “Native client (UNIX socket client)”
Jun 29 18:09:42 raspberrypi pulseaudio[347]: Connection died.
Jun 29 18:09:43 raspberrypi snips-audio-server[2295]: INFO:snips_broadcast_mqtt_server: Starting broadcasting audio on hermes as site “default”
Jun 29 18:09:43 raspberrypi snips-hotword[2081]: INFO:snips_hotword::server : Discovered audio_server default/mqtt, starting hotword listener
Jun 29 18:09:43 raspberrypi snips-hotword[2081]: INFO:snips_hotword::server : Connecting using MQTT site-id default
Jun 29 18:09:43 raspberrypi snips-hotword[2081]: INFO:snips_hotword_lib::audio : Audio thread for default started
Jun 29 18:09:43 raspberrypi snips-hotword[2081]: INFO:snips_hotword_lib::audio : Net and VAD thread for site default started (vad inhibitor: true, vad messages: false
Jun 29 18:09:43 raspberrypi snips-hotword[2081]: INFO:snips_hotword_lib : Detector “detector.default.default”, sensitivity: 0.5, threshold 0.47
Jun 29 18:09:43 raspberrypi snips-hotword[2081]: INFO:snips_hotword_lib : detector.default.default thread started
Jun 29 18:10:14 raspberrypi snips-hotword[2081]: INFO:snips_hotword_hermes : Hotword detected: site_id:default model:default (254ms ago)
Jun 29 18:10:14 raspberrypi snips-dialogue[2068]: INFO:snips_dialogue_lib::coordinator::coordinator: Site [default]: reset site -> turn off ASR and turn off Hotword
Jun 29 18:10:14 raspberrypi snips-dialogue[2068]: INFO:snips_dialogue_lib::coordinator::coordinator: Session [24bf4e87-3314-480b-8d17-7311c1283e4c]: The session has been created because the site “default” is free
Jun 29 18:10:14 raspberrypi snips-audio-server[2295]: Failed to create secure directory (/var/empty/.config/pulse): No such file or directory
Jun 29 18:10:14 raspberrypi snips-audio-server[2295]: Failed to load cookie file from cookie: No such file or directory
Jun 29 18:10:14 raspberrypi pulseaudio[347]: Created 51 “Native client (UNIX socket client)”
Jun 29 18:10:14 raspberrypi pulseaudio[347]: Got credentials: uid=115 gid=122 success=0
Jun 29 18:10:14 raspberrypi snips-audio-server[2295]: ALSA lib pulse.c:243:(pulse_connect) PulseAudio: Unable to connect: Access denied
Jun 29 18:10:14 raspberrypi snips-audio-server[2295]: ERROR:snips_audio_server_hermes : could not play “dceeaff2-5123-4196-8692-2ab69370d4f8”
Jun 29 18:10:14 raspberrypi snips-audio-server[2295]: -> caused by: ALSA function ‘snd_pcm_open’ failed with error ‘ECONNREFUSED: Connection refused’
Jun 29 18:10:14 raspberrypi pulseaudio[347]: Denied access to client with invalid authentication data.
Jun 29 18:10:14 raspberrypi pulseaudio[347]: Freed 51 “Native client (UNIX socket client)”
Jun 29 18:10:14 raspberrypi pulseaudio[347]: Connection died.
Jun 29 18:10:14 raspberrypi snips-hotword[2081]: INFO:snips_hotword_lib::audio : Audio thread for site default stopped.
Jun 29 18:10:30 raspberrypi snips-dialogue[2068]: INFO:snips_dialogue_lib::coordinator::coordinator: Session [24bf4e87-3314-480b-8d17-7311c1283e4c]: closing session which was active: Timeout
Jun 29 18:10:30 raspberrypi snips-dialogue[2068]: INFO:snips_dialogue_lib::coordinator::coordinator: Site [default]: reset site -> turn off ASR and turn on Hotword
Jun 29 18:10:30 raspberrypi snips-hotword[2081]: INFO:snips_hotword_lib::audio : Audio thread for site default started.

Here’s what happens if I say “Jarvis”:

When the hotword is recognized, no sound back

Jun 29 18:18:27 raspberrypi snips-hotword[2081]: INFO:snips_hotword_hermes : Hotword detected: site_id:default model:default (110ms ago)
Jun 29 18:18:27 raspberrypi snips-dialogue[2068]: INFO:snips_dialogue_lib::coordinator::coordinator: Site [default]: reset site -> turn off ASR and turn off Hotword
Jun 29 18:18:27 raspberrypi snips-dialogue[2068]: INFO:snips_dialogue_lib::coordinator::coordinator: Session [ae39a5c9-81e2-44d1-8b90-8400e9b7a670]: The session has been created because the site “default” is free
Jun 29 18:18:27 raspberrypi snips-hotword[2081]: INFO:snips_hotword_lib::audio : Audio thread for site default stopped.
Jun 29 18:18:27 raspberrypi snips-audio-server[2295]: Failed to create secure directory (/var/empty/.config/pulse): No such file or directory
Jun 29 18:18:27 raspberrypi snips-audio-server[2295]: Failed to load cookie file from cookie: No such file or directory
Jun 29 18:18:27 raspberrypi pulseaudio[347]: Created 52 “Native client (UNIX socket client)”
Jun 29 18:18:27 raspberrypi snips-audio-server[2295]: ALSA lib pulse.c:243:(pulse_connect) PulseAudio: Unable to connect: Access denied
Jun 29 18:18:27 raspberrypi snips-audio-server[2295]: ERROR:snips_audio_server_hermes : could not play “4b3bd2a5-faeb-4838-9fc8-172e1d9c93e8”
Jun 29 18:18:27 raspberrypi snips-audio-server[2295]: -> caused by: ALSA function ‘snd_pcm_open’ failed with error ‘ECONNREFUSED: Connection refused’
Jun 29 18:18:27 raspberrypi pulseaudio[347]: Got credentials: uid=115 gid=122 success=0
Jun 29 18:18:27 raspberrypi pulseaudio[347]: Denied access to client with invalid authentication data.
Jun 29 18:18:27 raspberrypi pulseaudio[347]: Freed 52 “Native client (UNIX socket client)”
Jun 29 18:18:27 raspberrypi pulseaudio[347]: Connection died.

If I comment out the line I added in snips.toml, I get that when the keywork is recognized:

Once again, when the hotword is recognized, no sound back

Jun 29 18:20:57 raspberrypi snips-hotword[2081]: INFO:snips_hotword_hermes : Hotword detected: site_id:default model:default (113ms ago)
Jun 29 18:20:57 raspberrypi snips-dialogue[2068]: INFO:snips_dialogue_lib::coordinator::coordinator: Site [default]: reset site -> turn off ASR and turn off Hotword
Jun 29 18:20:58 raspberrypi snips-dialogue[2068]: INFO:snips_dialogue_lib::coordinator::coordinator: Session [ed2d28f8-8af0-4952-a1fe-e54a9b2d143f]: The session has been created because the site “default” is free
Jun 29 18:20:58 raspberrypi snips-audio-server[2435]: INFO:snips_audio_portaudio : Playing “3091b925-e2d7-4741-bbbc-2bb24391f6b8” using output “bcm2835 ALSA: IEC958/HDMI (hw:0,1)”, wav spec: WavSpec { channels: 2, sample_rate: 22050, bits_per_sample: 16, sample_format: Int }
Jun 29 18:20:58 raspberrypi snips-audio-server[2435]: Expression ‘paInvalidSampleRate’ failed in ‘src/hostapi/alsa/pa_linux_alsa.c’, line: 2043
Jun 29 18:20:58 raspberrypi snips-audio-server[2435]: Expression ‘PaAlsaStreamComponent_InitialConfigure( &self->playback, outParams, self->primeBuffers, hwParamsPlayback, &realSr )’ failed in ‘src/hostapi/alsa/pa_linux_alsa.c’, line: 2717
Jun 29 18:20:58 raspberrypi snips-audio-server[2435]: Expression ‘PaAlsaStream_Configure( stream, inputParameters, outputParameters, sampleRate, framesPerBuffer, &inputLatency, &outputLatency, &hostBufferSizeMode )’ failed in ‘src/hostapi/alsa/pa_linux_alsa.c’, line: 2838
Jun 29 18:20:58 raspberrypi snips-audio-server[2435]: thread ‘portaudio.player’ panicked at ‘ERROR:snips_audio_server_hermes : could not play “3091b925-e2d7-4741-bbbc-2bb24391f6b8”
Jun 29 18:20:58 raspberrypi snips-audio-server[2435]: -> caused by: InvalidSampleRate
Jun 29 18:20:58 raspberrypi snips-audio-server[2435]: called Result::unwrap() on an Err value: “SendError(…)”’, src/libcore/result.rs:997:5
Jun 29 18:20:58 raspberrypi snips-audio-server[2435]: note: Run with RUST_BACKTRACE=1 environment variable to display a backtrace.
Jun 29 18:20:58 raspberrypi snips-hotword[2081]: INFO:snips_hotword_lib::audio : Audio thread for site default stopped.
Jun 29 18:21:13 raspberrypi snips-dialogue[2068]: INFO:snips_dialogue_lib::coordinator::coordinator: Session [ed2d28f8-8af0-4952-a1fe-e54a9b2d143f]: closing session which was active: Timeout
Jun 29 18:21:13 raspberrypi snips-dialogue[2068]: INFO:snips_dialogue_lib::coordinator::coordinator: Site [default]: reset site -> turn off ASR and turn on Hotword
Jun 29 18:21:13 raspberrypi snips-hotword[2081]: INFO:snips_hotword_lib::audio : Audio thread for site default started.

The pulseaudio daemon runs under the right of the pulse user. The _snips user is already in the pulse-access group. I don’t force HDMI output (no HDMI cable is even currently plugged to my Rasp 3). The current PulseAudio settings are:

$ pactl info

$ pactl info
Server String: /var/run/pulse/native
Library Protocol Version: 32
Server Protocol Version: 32
Is Local: yes
Client Index: 56
Tile Size: 65496
User Name: pulse
Host Name: raspberrypi
Server Name: pulseaudio
Server Version: 10.0
Default Sample Specification: s16le 2ch 44100Hz
Default Channel Map: front-left,front-right
Default Sink: alsa_output.usb-Generic_USB2.0_Device_20130100ph0-00.analog-stereo
Default Source: alsa_input.platform-soc_sound.analog-stereo
Cookie: ba3a:ec66

Now the available sinks:

$ pactl list short sinks

$ pactl list short sinks
0 alsa_output.usb-Generic_USB2.0_Device_20130100ph0-00.analog-stereo module-alsa-card.c s16le 2ch 48000Hz SUSPENDED
1 alsa_output.platform-soc_sound.analog-stereo module-alsa-card.c s16le 2ch 44100Hz SUSPENDED
2 alsa_output.platform-soc_audio.analog-stereo module-alsa-card.c s16le 2ch 44100Hz SUSPENDED

Do you have any idea? I have to mention that my setup worked well prior to the recent kernel updates that other users already reported in this thread.

Same issue, on a raspberry pi 4.

Jul 23 11:07:36 gateway snips-audio-server[540]: INFO:snips_audio_portaudio : Playing “c3a189bb-etc” using output “bcm2835 ALSA: IEC958/HDMI (hw:0,1)”, wav spec: WavSpec { channels: 1, sample_rate: 16000, bits_per_sample: 16, sample_format: Int }
Jul 23 11:07:36 gateway snips-audio-server[540]: Expression ‘paInvalidSampleRate’ failed in ‘src/hostapi/alsa/pa_linux_alsa.c’, line: 2043
Jul 23 11:07:36 gateway snips-audio-server[540]: Expression ‘PaAlsaStreamComponent_InitialConfigure( &self->playback, outParams, self->primeBuffers, hwParamsPlayback, &realSr )’ failed in ‘src/hostapi/alsa/pa_linux_alsa.c’, line: 2717
Jul 23 11:07:36 gateway snips-audio-server[540]: Expression ‘PaAlsaStream_Configure( stream, inputParameters, outputParameters, sampleRate, framesPerBuffer, &inputLatency, &outputLatency, &hostBufferSizeMode )’ failed in ‘src/hostapi/alsa/pa_linux_alsa.c’, line: 2838
Jul 23 11:07:36 gateway snips-audio-server[540]: ERROR:snips_audio_server_hermes : could not play “c3a189bb-etc

// update: I was able to fix it using this github issue:

Thanks for the hint. It solved my problems.

if I remember correctly, in my case it was just that it was trying to use the HDMI output instead of the audio jack

This post solved my problems with sample rates and port audio etc

1 Like