googlesamples/assistant-sdk-python

Audio output unavailable through speaker connected via 3.5mm jack on raspberry pi 4

mijazm opened this issue · 2 comments

I have been using google assistant sdk service and using this tutorial to set everything up with my raspberry pi 4.
The issue is that, the assistant once launched, is not able to output audio to my speaker connected via 3.5 mm jack. The following commands work as expected:
speaker-test -t wav
arecord --format=S16_LE --duration=5 --rate=16000 --file-type=raw out.raw
aplay --format=S16_LE --rate=16000 --file-type=raw out.raw
I am able to hear the audio, both the test and recorded ones clearly through my speaker.
Here is what my .asoundrc file looks like:

pcm.!default {
    type asym
    playback.pcm "playback"
    capture.pcm "capture"
}

pcm.playback {
    type plug
    slave.pcm "hw:1,0"
}

pcm.capture {
    type plug
    slave.pcm "hw:2,0"
}

I have tried the following command:
python -m pushtotalk --device-id 'my-device-identifier' --device-model-id 'my-model-identifier' -o out.wav
and it works, I am able to play out.wav and it is the correct response.

I tried using the audio-helper.py with multiple settings for audio-block-size but it still doesn't work. I have been at it for a few days now and hundreds of searches later still stuck at the same place. Any help would be greatly appreciated. Thanks in advance!

Its working now once I used respeaker output as the default output.

Using the respeaker output by editing .asoundrc worked for me.