Author Topic: Additional speakers arent playing (ASIO + Split_StreamCreate + Quadrophonic)  (Read 101 times)

gosucherry

  • Posts: 16
I have and issue where the sounds from the additional speakers arent playing. Sound's are played only from front-left and front-right. Im sure my hardware is OK (tested it with windows test - all are playing). Im using Asio4all. I split my 4-channel mixer into 4 single channel streams, then I use some effects on then, then I parse all of them to Asio outputs.

Code: [Select]
Bass.BASS_Init(audioDeviceList.SelectedIndex, 48000, BASSInit.BASS_DEVICE_FREQ | BASSInit.BASS_DEVICE_LATENCY, IntPtr.Zero);
BassAsio.BASS_ASIO_Init(asioDeviceList.SelectedIndex, BASSASIOInit.BASS_ASIO_THREAD);
mixerHandler = BassMix.BASS_Mixer_StreamCreate(48000, 4, BASSFlag.BASS_MIXER_NONSTOP | BASSFlag.BASS_STREAM_DECODE | BASSFlag.BASS_SAMPLE_FLOAT);
int[] mapping = { 0, -1 };
outputStreams[0] = BassMix.BASS_Split_StreamCreate(Program.mixerHandler, BASSFlag.BASS_STREAM_DECODE | BASSFlag.BASS_SAMPLE_FLOAT | BASSFlag.BASS_SPEAKER_FRONTLEFT, mapping);
mapping[0] = 1;
outputStreams[1] = BassMix.BASS_Split_StreamCreate(Program.mixerHandler, BASSFlag.BASS_STREAM_DECODE | BASSFlag.BASS_SAMPLE_FLOAT, mapping);
mapping[0] = 2;
outputStreams[2] = BassMix.BASS_Split_StreamCreate(Program.mixerHandler, BASSFlag.BASS_STREAM_DECODE | BASSFlag.BASS_SAMPLE_FLOAT, mapping);
mapping[0] = 3;
Output.outputStreams[3] = BassMix.BASS_Split_StreamCreate(Program.mixerHandler, BASSFlag.BASS_STREAM_DECODE | BASSFlag.BASS_SAMPLE_FLOAT, mapping);
BassAsio.BASS_ASIO_SetRate(48000);
for (int x = 0; x < 4; x++)
{
    BassAsio.BASS_ASIO_ChannelEnable(false, x, Program.myAsioProc, new IntPtr(Output.outputStreams[x]));
    BassAsio.BASS_ASIO_ChannelSetFormat(false, x, BASSASIOFormat.BASS_ASIO_FORMAT_FLOAT);
    BassAsio.BASS_ASIO_ChannelSetRate(false, x, 48000);
}
BassAsio.BASS_ASIO_Start(0);

Adding my streams to mixer :

Code: [Select]
BassMix.BASS_Mixer_StreamAddChannel(mixerHandler, tempo, BASSFlag.BASS_MIXER_MATRIX);
float[,] matrix = { // stereo to quad matrix
    {1, 0}, // left in = left front out
    {0, 1}, // right in = right front out
    {1, 0}, // left in = left rear out
    {0, 1}
   };
BassMix.BASS_Mixer_ChannelSetMatrix(tempo, matrix);

I have no clue what could be wrong, but only first two speakers are playing... others are mute. Could anyone help me fixing this?

EDIT: Problem was solved. In Asio4All i've noticed I have 6 output channels, so I investigated. It appears that speakers in Bass are listed in different order than in Windows, and Bass was playing on the output from the front of the PC (which isn't connected!). Speakers 2+3 in windows were 4+5 in BASS ;) So problem is solved!
« Last Edit: 6 Jul '18 - 18:44 by gosucherry »