You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Multiple stack overflows on coreaudio with soundcards with large amount of channels #980
We're starting to see a few high-channel-count (1024+ like the Marian Clara E) soundcards ; this seems to cause issue with the coreaudio backend for instance starting from 128 channels.
So the whole logic of ma_log_postf wrapping ma_log_postv doesn't really make sense as in the end you have to call va_start / va_end from within postv anyways
Code is also incorrect in ma_channel_map_to_string as it does not null-terminate pBufferOuut if we overflow the buffer size.
I'll prepare a PR to fix both of these and likely report soon the usage of these high-channel-count cards with other backends :)
Thanks. I haven't done any testing personally on huge channel counts so I'd be happy to hear any feedback on that.
A heads up in case you aren't already aware, I have a macro called MA_MAX_CHANNELS which is defined as 254 so I wouldn't be surprised if some functionality might be outright broken beyond that point. I think channel maps and the node graph stuff in particular would be an issue.
I had a look at your PR, but I didn't like your proposed solutions.
For the logging thing, I think the error was that I was not calling va_copy(). I want to keep the current pattern where the "f" version calls into the "v" version.
For the channel map thing, your proposal returns 0 when pBufferOut is null which is incorrect. The intended usage of that function is to call it with pBufferOut as null to compute the required length. Similar in concept to snprintf().
I haven't had a chance to properly test these so I'll leave this ticket open as a reminder for myself to get to that. Changes are in the dev branch if you wanted to try them out for yourself.
Activity
mackron commentedon Apr 10, 2025
Thanks. I haven't done any testing personally on huge channel counts so I'd be happy to hear any feedback on that.
A heads up in case you aren't already aware, I have a macro called
MA_MAX_CHANNELSwhich is defined as 254 so I wouldn't be surprised if some functionality might be outright broken beyond that point. I think channel maps and the node graph stuff in particular would be an issue.jcelerier commentedon Apr 10, 2025
thanks! will report as soon as I can test. So far up to 256 channels seem to work.
Attempt to fix an error with ma_log_postv().
Try fixing a null termination bug in ma_channel_map_to_string().
mackron commentedon Apr 25, 2025
I had a look at your PR, but I didn't like your proposed solutions.
For the logging thing, I think the error was that I was not calling
va_copy(). I want to keep the current pattern where the "f" version calls into the "v" version.For the channel map thing, your proposal returns 0 when
pBufferOutis null which is incorrect. The intended usage of that function is to call it withpBufferOutas null to compute the required length. Similar in concept tosnprintf().I haven't had a chance to properly test these so I'll leave this ticket open as a reminder for myself to get to that. Changes are in the dev branch if you wanted to try them out for yourself.
mackron commentedon Jul 3, 2025
These changes seem to be working fine for me. Closing.