Aiyprojects-raspbian: "Sample format non available" when starting AIY demos

Created on 12 Jan 2018  路  3Comments  路  Source: google/aiyprojects-raspbian

I built the AIY projects kit from the May 2017 MagPi, downloading the aiyprojects-2018-01-03.img.xz OS image. It boots and and after updating OS to current and configuring, it passes the check_audio and check_wifi tests, so pi, speaker and microphone are working. However following the instructions on https://aiyprojects.withgoogle.com/voice/ to run any of the demos fail - see listing below:

(env) pi@HardyAIY:~/AIY-projects-python/src/examples/voice $ ./assistant_grpc_demo.py 
Press the button and speak
[2018-01-12 20:45:17,123] INFO:recorder:started recording
arecord: set_params:1299: Sample format non available
Available formats:
- S32_LE
[2018-01-12 20:45:17,133] ERROR:recorder:Microphone recorder died unexpectedly, aborting...
(env) pi@HardyAIY:~/AIY-projects-python/src/examples/voice $ 
Voice

Most helpful comment

Thanks for reporting! Can you check if you have a file called ~/.asoundrc? If so, what does it contain?

If it exists, you can try deleting it and rerunning the demos.

If it doesn't exist, could you post the output of arecord --list-pcms?

All 3 comments

Thanks for reporting! Can you check if you have a file called ~/.asoundrc? If so, what does it contain?

If it exists, you can try deleting it and rerunning the demos.

If it doesn't exist, could you post the output of arecord --list-pcms?

./asoundrc does exist. It contains:

pcm.!default {
    type hw
    card 0
}

ctl.!default {
    type hw
    card 0
}

I deleted the file and tried the assistant_grpc_demo.py again, and it works!
assistant_library_demo.py also works OK.

Any clue as to how/why that file got created?

Yes, it gets created by the default volume widget (source). It seems to get created if the driver hasn't been loaded correctly.

Maybe the best thing to do in the short term is to make check_audio.py detect this case and explain what to do, or even automatically resolve it.

Was this page helpful?
0 / 5 - 0 ratings