Skip to content

Reconsider maximum allowed channel count (currently 32) #555

@orottier

Description

@orottier

See ircam-ismm/node-web-audio-api#159

Let's benchmark changing

pub struct AudioRenderQuantum {
    channels: ArrayVec<AudioRenderQuantumChannel, MAX_CHANNELS>,
...

To

pub struct AudioRenderQuantum {
    channels: SmallVec<[AudioRenderQuantumChannel; 2]>, // 2, or 4, 5, 8 or any other well known channel count

SmallVec will spill to the heap if the initial capacity is exceeded. So buffers with channel count < X will be put on the stack, larger ones on the heap. This will hurt our allocation-free-rendering but it will effectively remove the limit on the number of channels.

Some more usage of MAX_CHANNELS or assert_valid_number_of_channels should be reviewed. The io abstractions and some nodes use it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions