PiSound card number changes each time I boot, causes issues with Alsa

hi there

Each time I boot the RPi, the PiSound has a different card number and that causes problems for Alsa and my midi keyboard setup. Looking for a way to have a static card number for the PiSound or any other solution to get a consistent connection between PiSound & Alsa.

My setup is:
RPi + PiSound running Buster
Midi keyboard
Fluidsynth installed via Fluidpatcher wrapper

Fluidsynth/FluidPatcher works very well to generate sound from the midi keyboard.

However, each time i boot up the RPi, the PiSound card has a different card number. And for Fluidsynth/Fluidpatcher to work successfully i have to include the PiSound card number in the Alsa config file /usr/share/alsa/alsa.conf

I’m wondering if there is a way to have a static card number associated with the PiSound or another way to solve this problem?

Thanks!

Hey, try using hw:pisound in your configuration files.

If that doesn’t work, there’s probably a way to write a udev rule to assign static number to a particular device.

Could you show two examples of outputs of these commands where the order is different?

aplay -l
arecord -l
amidi -l