Skip to content

ChannelVolume misbehaving with non power of 2 number of channels #484

Open
@DivineGod

Description

@DivineGod

I seem to have stumbled into a strange issue where adding more output channels to a ChannelVolume will make it mess up the output.

My setup is that I have a custom source which is basically an extended version of Spatial with a self.input which is a ChannelVolume if I create an audio interface with 2 or 4 channels and configure the ChannelVolume to have 2 or 4 channels the output seems fine. But if I add more than 4 the output which was meant to go to channel 1 goes to channel 5 and channel 2 goes to channel 6.

Shown here is the loopback interface where the volume is shown for the 6 channel version:
Screenshot 2023-03-06 at 10 50 43

Here is the version with 4 channels which shows the correct behaviour:
Screenshot 2023-03-06 at 10 51 39

The only thing changed is the number of channels in the output configuration which impacts ChannelVolume getting either 4 or 6 channels. I have confirmed that the set_volume call does get called with the correct index and volume levels as per my spatial algorithm in both cases.

Edited to add:

Upon further inspection it seems that any number of channels that are not powers of two say 6 or 10 will exhibit this behaviour while power of two number of channels look like they behave perfectly okay

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions