-
Notifications
You must be signed in to change notification settings - Fork 5
[audio-server] Audio issues using alsa playback backend (drain error + sound is cut) #203
Comments
Thanks for your ticket @cburghardt, Quick question, Which sound card are you using as your main sound playback interface? Can you post as well your Many thanks for your feedbacks |
I use the onboard sound card of the raspberry.
|
Ok, So the issue is indeed related to #201 Using alsa, the ring buffer parameters setup done by the audio server is incorrect, and seems to induce multiple issues:
This issue seems to appears with different behavior depending on your sound card. Pi 3 Embedded sound card
Jabra
Typical parameters induced by aplay
What seems to work
Which give me the following hw parameters when playing a sound sample with the audio-server.
The buffer size is back to a reasonable value. The sound issues disappears. (I found some documentation for the one interested) |
I gave a try to your configuration (coming from the forum I suppose), using portaudio.
Seems to work correclty I don't see any errors. Can you patch your |
So I upgraded to 0.64 and applied the changes. Result: |
Ok, that's another one to figure out. I also tried to delegate things to dmix. Works great with the piHAT 2 (provided the user using the sound is in the audio group) But as soon as I switch on the raspberry pi even |
Hi, this work for me with my respeaker mic 4 array. Thank you for your help |
Regarding the Otherwise the following /etc/asound.conf
Hardware tested
|
So how do I convince the audio server to use portaudio if that seems to work? |
The test above was done using alsa for playback and capture. I had the following configuration working on my side using portaudio on the bcm2835, it should match your needs
Test it along
Fun fact, it stops working if you remove
|
Result:
|
🤔 ok, now I'm running short of ideas. Can you show me the content of This configuration works on 3 out of 3 Pi 3 boards using version 0.64.0 Here are the logs I obtain. :~ $ snips-audio-server -v --disable-capture --portaudio_playback=default
[14:39:28.521619] DEBUG:snips_common_cli::cli: conf lookup: snips-audio-server.no_exit_on_all_panics -> Ok(None)
[14:39:28.521984] DEBUG:snips_common_cli::cli: conf lookup: snips-common.no_exit_on_all_panics -> Ok(None)
...
[14:39:36.319702] DEBUG:snips_audio_server_hermes::player: Playing bytes dummysessionid
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
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
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.front
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround21
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround21
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround40
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround41
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround50
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround51
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround71
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pcm_asym.c:106:(_snd_pcm_asym_open) capture slave is not defined
[14:39:36.365710] INFO :snips_audio_portaudio : Playing "dummysessionid" using output "default", wav spec: WavSpec { channels: 2, sample_rate: 22050, bits_per_sample: 16, sample_format: Int }
[14:39:36.372966] DEBUG:snips_audio_portaudio : Padding output with 23 frames
[14:39:36.952786] INFO :snips_audio_portaudio : Playing of "dummysessionid" finished
[14:39:36.954156] DEBUG:snips_audio_server_hermes::player: Finished Playing bytes dummysessionid You should not have those following lines in your log
Looks like a configuration issue to me but I prefer to confirm that with your device information ( |
It's a pi 4 maybe that's the difference.
|
Hi, I have the same problem here. I tried a lot of solution without success. It doesn't work better by downgrading snips-tts and snips-audio-server to version 0.63.3. On hardware side I tried with a Jabra PHS001U and a Respeaker 6mics with the same result for both. Let me know if you need more informations. |
I could grab a Pi 4 on debian buster.
I do confirm that the following configuration is working with snips-audio-server 0.64.0 using portaudio backend for playback
(same test command)
|
I can confirm that the workaround works for me. But with portaudio I have to remove capture.pcm from asound.conf. Otherwise I also get the PortAudio default device error. |
Thanks a lot @sven5s - that was the key. With that modification it works. |
Nice to heart that! I'll keep it open to follow up this issue until we release a definitive fix. |
For the record, Trying to fix this issue we still stumbled on It seems that there is a kernel known issue about that => raspberrypi/linux#2983 The current version is
I guess this particular issue will be solved in a next official kernel update. |
I can confirm that the downgrade on 4.19.36 works for my setup (all snips components running 0.64.0, raspberry 3b running stetch). |
I was having issues with cutted sounds and unstable audio server and upgrading kernel to 4.19.79 solved them all. |
Uh oh!
There was an error while loading. Please reload this page.
What's the issue
I just upgraded my system (Raspi 4 with Stretch packages) to 0.64. Unfortunately the error
ALSA function 'snd_pcm_drain' failed with error 'EIO: I/O error'
is back. None of the known workarounds fix it.
Once I downgraded to 0.63.3 the problem disappears.
Expected
Same behavior as 1.2.2
Version
1.3.0 (0.64.0)
Environment
[workaround edit by @cpoisson ]
Workaround 1 - Back to 0.63.3
Downgrade
snips-tts
andsnips-audio-server
to1.2.2 (0.63.3)
Workaround 2 - Back to portaudio
Switch back to portaudio for playback.
portaudio_playback = "default"
to the[snips-audio-server]
section of your/etc/snips.toml
configuration file.sudo systemctl restart snips-audio-server
Workaround 3 - bcm2835
If you are using the pi 3 or pi 4 bcm2835 embedded sound card.
Workaround 4 : Delegate to dmix and dsnoop
Delegate to dmix to make sure that the sound is played well using alsa
This configuration has been tested on the following devices
bcm2835
(raspberry pi)/dev/snd/timer
(known issue)Jabra PHS002W
UGREEN USB Sound card
PS Eye Camera
Respeaker PiHAT 2 mics
Respeaker 6 Microphones
Related Issue
The text was updated successfully, but these errors were encountered: