I've searched the Pd mailinglist archive for this ALSA error and found this post, Re: [PD] alsa : Invalid value for card, by IOhannes Zmölning:
iirc, there's a problem if the cards are not in consecuritve order,
starting with 0.
e.g. my devices are
$ cat /proc/asound/cards
0 [DSP ]: H-DSP - Hammerfall DSP
How to tell Rpi to use the speakers connected to the USB sound stick?
I am using Rpi3B+ stretch 9 GUI Desktop's automatically installed VLC
My speaker is connected to the USB hub.
GUI Desktop Top Menu > Preferences > Audio Device Settings > Sound Card >
Choose the following USB audio device, make it ...
The 3.5 mm jack is an analog output, it doesn't recognize anything. If you are having trouble getting sound out of it, the first thing to try is forcing audio out to the 3.5 mm jack with raspi-config.
In raspi-config, go to advanced, then audio, then select Force 3.5mm ('headphone') jack.
According to the official schematics of the Raspberry Pi 4 the configuration is:
Sleeve - Composite video (Testpint TP24)
Ring 2 - Ground (TP7, TP8, TP9, among others)
Ring 1 - Audio-Right (TP23)
Tip - Audio-Left (TP22)
Incidentally the configuration is identical to the Pi 3 models.
Side note, the preliminary Raspberry Pi 4 Model B datasheet ...
Thank you to everyone who tried to help me.
I figured it out on my own. (Or I guess you could say with CoderMike's help)
So what was the problem you may ask?
It was not with my program.
It was not with the players (ffplay, omxplayer, or whatever)
It was with the program I used to sync my music from google drive to the pi.
It corrupted the mp3 files.