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
- Raspberry Pi 4 - Debian Stretch
- Sound card - Raspberry pi sound card
[workaround edit by @cpoisson ]
Workaround 1 - Back to 0.63.3
Downgrade snips-tts and snips-audio-server to 1.2.2 (0.63.3)
sudo apt install snips-audio-server=0.63.3
sudo apt install snips-tts=0.63.3
Workaround 2 - Back to portaudio
Switch back to portaudio for playback.
- Add
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.
- Switch back to portaudio
- Use the following configuration for playback
pcm.!default {
type asym
playback.pcm {
type plug
slave.pcm "hw:0,0"
slave.rate 48000 # Does not work if this is removed.
}
capture.pcm {
type plug
slave.pcm "hw:1,0" # Configure the correct hw:Id,SubId for your capture device
}
}
Workaround 4 : Delegate to dmix and dsnoop
Delegate to dmix to make sure that the sound is played well using alsa
pcm.!default {
type asym
playback.pcm "playback"
capture.pcm "capture"
}
pcm.playback {
type plug
slave.pcm "dmixed"
}
pcm.capture {
type plug
slave.pcm "array"
}
pcm.dmixed {
type dmix
ipc_key 555555
ipc_key_add_uid yes
ipc_perm 0666
slave.pcm "hw:1,0" # Set the correct hw:Id,SubId for your playback device
}
pcm.array {
type dsnoop
ipc_key 666666
ipc_key_add_uid yes
ipc_perm 0666
slave.pcm "hw:1,0" # Set the correct hw:Id,SubId for your capture device
}
This configuration has been tested on the following devices
| Audio device |
Playback |
Capture |
Details |
bcm2835 (raspberry pi) |
❌ |
|
Does not work. playback is stuck waiting for /dev/snd/timer (known issue) |
Jabra PHS002W |
✅ |
✅ |
|
UGREEN USB Sound card |
✅ |
✅ |
|
PS Eye Camera |
|
✅ |
|
Respeaker PiHAT 2 mics |
✅ |
✅ |
|
Respeaker 6 Microphones |
❌ |
✅ |
Playback does not work. The default configuration installed by the drivers works correctly tough |
Related Issue
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-ttsandsnips-audio-serverto1.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.tomlconfiguration file.sudo systemctl restart snips-audio-serverWorkaround 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 PHS002WUGREEN USB Sound cardPS Eye CameraRespeaker PiHAT 2 micsRespeaker 6 MicrophonesRelated Issue