@flight453 You could look at the messages sent to Pd when you select alsa and alsamidi in your settings. Connect a [print] directly to [r pd] to see all messages.
Then send those messages to Pd with a [s pd] from your patch as it starts.
(ping and autopatch arrive frequently and are not helpful for what you are looking for)
If there are no messages, which is unlikely but I cannot test...... then.......
In windows you would edit a shortcut to the Pd executable or create a batch file to start Pd...... and add the command line switches to that.
The way I know for Linux is to use a (dot)desktop file in \RASPBERRYPI3\home\home\pi.config\autostart (that is my path.... you need to find your (dot)config folder).
I use this to start x11vnc....... this is the contents of x11vnc.desktop in my .config folder.
It runs automatically when the desktop has loaded
Exec=x11vnc -forever -loop -passwd $££%%Xnotreal -display :0 -ultrafilexfer
So I imagine you would change the contents to something like.......
Exec=Pd -alsa -alsamidi -midiindev 0 -midioutdev 0 -audioindev n -audiooutdev n -inchannels n -outchannels n
Where "n" is the number........ and I am pretty certain always starts at 0 for devices but "inchannels" is the actual quantity.... 2 for two channels.
Adding any other switches you might need to the "Exec" line..... for realtime audio, audio buffer size, sample rate etc.
Alsa should already have loaded before the desktop I think.
Of course you only absolutely need to set the devices in the command line as you can use the dialogs in my first post to change channels etc.