When using ALSA for audio playback, the following error is always reported when you exit the program:
Pcm_plug.c: 67: snd_pcm_close: assertion 'plug-> gen. Slave = plug-> req_slave 'failedaborted
After finding a circle on the Internet, there are two solutions:
1. Upgrade ALSA. It is said that this error is often reported in version 1.0.14. You can upgrade it. My account is 1.0.23, which is obviously not the reason.
2. check whether there is a problem with the sound card settings. I did this by referring to the code used in the Alsa open-source project, and I was also excluded from it, because the open-source project runs on the board, there is a problem with wood.
After being depressed for a long time, I checked the code carefully and found that the snd_pcm_close () function was called twice. The above error occurred during the second call. Modify the call logic to avoid secondary calls to snd_pcm_close () and solve the problem.