Thank you so much for checking. The metadata/actual duration mismatch is because I cropped the file with ffmpeg (because the full track is hundreds of Mbytes). I'm sorry I ought to have told you that!
I agree that padding the source files manually is the simplest solution: I was hoping to avoid it only because I'd like to use CamillaDSP and padding the entire <6 channel library to 6 channels to make them uniform would take rather a long rime (it's about 2Tbytes of files). I may try to get padding with ALSA working in another distribution and, if I succeed, perhaps I can share it here for your reference?
For all those interested, I have managed to make the bulk of my source material (mono, stereo, 5.0, and 5.1) work in RPIOS via MPD with CamillaDSP and ALSA. When I have time, I am going to try to replicate the solution in Moode (because it is a lovely bit of software), and will post here if I can manage it.
The first thing I had to do (after installing MPD, CamillaDSP & cetera) was create an ALSA configuration to override the "default" output:
#Loopback is our final destination for audio output
pcm_slave.six_channel_loopback {
pcm "hw:Loopback,0,0"
channels 6
rate 96000
format "S32_LE"
}
#Define a plug for sample rate and format conversion
pcm.conversion_plug {
type plug
slave six_channel_loopback
}
#Define a channel router
pcm.channel_route {
type route
slave.pcm "conversion_plug"
slave.channels 6
ttable {
0.0 1 #ALSA 0=FL -> FLAC 0=FL
1.1 1 #ALSA 1=FR -> FLAC 1=FR
2.4 1 #ALSA 2=RL -> FLAC 4=RL
3.5 1 #ALSA 3=RR -> FLAC 5=RR
4.2 1 #ALSA 4=C -> FLAC 2=C
5.3 1 #ALSA 5=LFE -> FLAC 3=LFE
}
}
#Force our default output to use our router+converter into the loopback
pcm.!default {
type copy
slave.pcm "channel_route"
}
ctl.!default {
type hw
card "Loopback"
}
Then I removed the audio output from my mpd configuration (so it used the default output). For whatever reason, I could *not* get it to work with an audio_output defined in MPD - or rather, it worked, but sent a mono mix of all source channels to each MPD output/Loopback input channel.
In my CDSP configuration, I defined Loopback 1 as my capture device, and vc4hdmi0 as my output devce.
Then I defined the following mixer in CDSP:
As you can see, the channels are re-routed again, but the re-routing is not merely inverting/reversing the ALSA routing. When I tried to consolidate the two mappings into the ALSA routing, it didn't work (more than likely I was making an error, but I'd spent long enough on getting *something* working I didn't want to spend any more time fixing it "properly").
As I mentioned, my horrible kludge works with monophonic, stereophonic, 5 and 6 channel flac files. It does *not* work when playing the wav files in /usr/share/sounds/alsa - everything comes out of the (front) Left speaker. It also does *not* work with one quad album that I have, but it does work with the pseudo-quad albums I have which had a silent centre channel.
Although I'd much prefer to use Moode, and my solution is clearly of the "two wrongs making a right" variety, at least I finally have a solution which plays 99% of my music gaplessly and correctly without having to alter my source files, so I'm pleased. Hopefully someone else might benefit. I shall post again here if I can get it working in Moode as well (my php is non-existent, so I have doubts).