[ALSA] Unable to query max channel count for MOTU UltraLite-mk5 (class compliant)
Hi all. So, it appears that I'm unable to query the max channel count for a MOTU UltraLite-mk5 using the ALSA hw plugin. I currently need this as I'm attempting to write a multi-track audio player.
The issue appears to be due to the lack of SND_PCM_FORMAT_S24_LE at https://github.com/RustAudio/cpal/blob/master/src/host/alsa/mod.rs#L334, which appears to be the only format supported by this card. As a result, when querying supported_output_configs from the card, the supplied iterator is empty.
aplay -D hw:1,0 --dump-hw-params /dev/zero
Playing raw data '/dev/zero' : Unsigned 8 bit, Rate 8000 Hz, Mono
HW Params of device "hw:1,0":
--------------------
ACCESS: MMAP_INTERLEAVED RW_INTERLEAVED
FORMAT: S24_3LE
SUBFORMAT: STD
SAMPLE_BITS: 24
FRAME_BITS: [240 528]
CHANNELS: [10 22]
RATE: [44100 192000]
PERIOD_TIME: [125 1000000]
PERIOD_SIZE: [6 192000]
PERIOD_BYTES: [180 12672000]
PERIODS: [2 1024]
BUFFER_TIME: (62 2000000]
BUFFER_SIZE: [12 384000]
BUFFER_BYTES: [360 25344000]
TICK_TIME: ALL
--------------------
aplay: set_params:1343: Sample format non available
Available formats:
- S24_3LE
Cloning the cpal repo and adding in the given SampleFormat into the above mentioned list populates the supported_output_configs as expected, which in turn allows for querying the max channels.
I notice that the 24/48 bit sample formats in src/sample_formats.rs are commented out. I'm guessing this is because of the lack of a nice way of handling these integer sizes. It would be nice to be able to get this channel count, however.