I had this exact error message when trying to run flite (TTS software, got with "apt install flite" in the usual manner) from within a C program with the system() command, on a Pi500.
I got it working by creating the file /etc/asound.conf and putting in the following 2 lines:
defaults.pcm.card 1
defaults.ctl.card 1
(No vertical space between those lines.)
I rebooted the Pi500 and it worked.