Channel Order Confusion #1029
Replies: 1 comment 1 reply
-
|
Sorry for the delay. I missed this one. I believe this will be because you have not specified an explicit channel map which means miniaudio will use the default channel map as reported by the backend. It's a bit awkward because you've also not specified an explicit channel count which means it'll use the "native" channel count. This makes it unpractical to plug in a pre-defined channel map because you won't know the channel count ahead of time. I think your most practical option would be to plug in your own Thinking about this, I wonder if it might be practical to add an option to the device config to make it so when no channel map is supplied, it always uses a well-defined channel map. I've added an item to my todo list to investigate this for 0.12. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hey! I'm having a bit of confusion around the expected order of channels on Linux when recording using the ALSA backend. My audio interface has 4 channels in and 4 channels out.
When using miniaudio.h on Windows or macOS the order in which the callback receives its data is interleaved like this: 1, 2, 3, 4, but on Linux (using ALSA) it receives its data 1, 3, 2, 4. This happens when using any of the "Monitor Of [device name]" loopback devices or when using the inputs on my interface directly.
This is how I am initializing it.
ma_device_config device_config = ma_device_config_init(ma_device_type_capture); device_config.capture.format = ma_format_f32; device_config.capture.channelMixMode = ma_channel_mix_mode_simple; device_config.dataCallback = miniaudio_callback; device_config.pUserData = this; device_config.periodSizeInFrames = 256; device_config.resampling.algorithm = ma_resample_algorithm_linear; ma_result init_result = ma_device_init_ex(nullptr, 0, nullptr, &device_config, &m_device); if (init_result != MA_SUCCESS) { return; } auto result = ma_device_start(&m_device); while (result != MA_SUCCESS) { result = ma_device_start(&m_device); }Audacity and Bitwig seem to receive the audio in the order I expect as well. I tested with the current dev and dev 0.12 branches and they have the same behavior.
Is there something I have missed?
Thank you for your time.
Beta Was this translation helpful? Give feedback.
All reactions