MultiChannel Problems

Hi… I’ve this problem:
I have to use 8 audio channels in output.
So, i choose the sound card and select the 8 channels, but the “audiosamplebuffer info” that i use in the getNextAudioBlock has always just 2 channels; it let me stream audio just to the first two channel selected in the selector (eg, if i select 1…8 audio comes out from monitor 1&2, if i deselect channels 1&2 audio comes out from monitor 3&4…)
I think that when i choose the sound card in the AudioDeviceSelectorComponent it has to change the channel number in the buffer… but nothing!

Let me know what it’s possible that i miss

thanks and forgive me for my english

Marcello

The number of channels is set in AudioDeviceManager::initialise().

so it’s not atomatic that if i select 8 (or more…) channel in the selector the buffer will become an 8 channel uffer??

but anyhow, when i create the devicemanager i do this:

const String error (audioDeviceManager.initialise (1, /* number of input channels */
                        8, /* number of output channels */
                        0, /* no XML settings.. */
                        true  /* select default device on failure */));

    if (error.isNotEmpty())
    {
        AlertWindow::showMessageBox (AlertWindow::WarningIcon,
                                     T("Audio Demo"),
                                     T("Couldn't open an output device!\n\n") + error);
    }
    else
    {

        // ..and connect the mixer to our source player.
        audioSourcePlayer.setSource (&transportSource2);

        // start the IO device pulling its data from our callback..
        audioDeviceManager.setAudioCallback (this);

       /* other stuff */
    }
		audioSettingsComp=new AudioDeviceSelectorComponent (              audioDeviceManager,
                                                            0, 1,
                                                            2, 8,
                                                            true);
		audioSettingsComp->setSize (500, 300);

but always just 2 channels opened…
maybe it’s becouse, by default, my app first open a sound card with 2 chan out… then i choose the other one…

let me know…

thanks jules

Well if you’ve only got 2 channels active then the callback just gives you a buffer containing those 2 channels.

so, after selecting the new device i got to call the initialise(…); right?

No, you don’t have to call it again. Sorry, I’m not sure I understand exactly what the problem is?

Maybe it’s becouse of my english… :smiley:
Ok, let me explain better than before…

In the constructor of the main component i do this:

const String error (audioDeviceManager.initialise (1, /* number of input channels */
                        8, /* number of output channels */
                        0, /* no XML settings.. */
                        true  /* select default device on failure */));

    if (error.isNotEmpty())
    {
        AlertWindow::showMessageBox (AlertWindow::WarningIcon,
                                     T("Audio Demo"),
                                     T("Couldn't open an output device!\n\n") + error);
    }
    else
    {

        // ..and connect the mixer to our source player.
        audioSourcePlayer.setSource (&transportSource2);

        // start the IO device pulling its data from our callback..
        audioDeviceManager.setAudioCallback (this);

       /* other stuff */
    }
      audioSettingsComp=new AudioDeviceSelectorComponent (              audioDeviceManager,
                                                            0, 1,
                                                            2, 8,
                                                            true); 

When i run the app, it choose the default audiodevice that has 2 output channels.

Then I open the AudioDeviceSelectorComponent and choose the other audiodevice selecting all the 8 output channels.

But when i “play” audio just the first 2 channels selected (1&2 or, if 1&2 are uncecked, 3&4…) will stream audio; this (i think) becouse info.buffer in the getNextAudioBlock got still 2 output channels.

I thought that selecting the right audiodevice and selecting the output channels to open then info.buffer would change with it.

I hope you understand what i mean…

Thanks

Ok. If you can select and activate 8 channels in the audio device panel, then the audio device will definitely be delivering an 8-channel buffer in its callback…

But I think I recently fixed the AudioSourcePlayer code because that was only passing on the first two channels to the audio source… Are you using the latest juce version?

I got Juce 1.41…
Could be this???
let me know…

Yes, try the latest one.

Nothing…
I try to open just 1 channel to test, but when debugging i find just 2 channel for the info.buffer!!!

Just to tell you: when I choose the asio device in the selector and also choose all the 8 channels in the output tab of VC++ appear:

in  0 0
out 1 0
out 2 1
out 3 2
out 4 3
out 5 4
out 6 5
out 7 6
out 8 7

I really don’t know what it is and what to do…

help me…

I’m working on some multi-channel apps at the moment and they work just fine, so it’s very unlikely to be a bug - you must just be misunderstanding something.

The debug info shows that it is opening that many channels, so I assume you’re getting them in your callback. Sorry, without seeing all your code I can’t guess what else you might be missing…

I compiled the jucedemo to see if i did something stupid… but even with it just 2 channels spray audio…
what da hell!!!

breaking news:

I told you i try with the jucedemo…
now, with the audio sound (cello) it do not work… but it work with the mid, all the channels!!!

wow… but what it means???

Eh? Of course the cello only uses 2 channels, it’s a stereo sample. And the demo’s only designed to use 2 channels anyway. Not sure I understand what you think is wrong?

let me explain…
i modified the jucedemo code to use asio device and then i select my device (that allow to use up to 10 out channels).
Now if i play midi it sounds good…
i know that cello is a stereo file but i thought, maybe i was wrong, that it would play the same…

So there’s no problem, right?

uhm… no, problems remain!
but i don’t want to bore you anymore… today!!! :smiley:
i will try… i got to play audiosample in all the channels…
so I will try!

See you tomorrow Jules :slight_smile:

ps: thanks

hi, here I am again…
Let me explain the actual situation; i got something like this:

AudioSourcePlayer <-- TransportSource <-- MyMixer <-- Filter0 <-- Channel0
                                                  <-- Filter1 <-- Channel1
                                                  <-- FilterN <-- ChannelN  

where MyMixer, Filter and Channel inherit from PositionableAudioSource.
In this situation I can play, stop and other but the channel number for MyMixer is always 2!

if I try this:

AudioSourcePlayer <-- MyMixer <-- Filter0 <-- Channel0
                              <-- Filter1 <-- Channel1
                              <-- FilterN <-- ChannelN  

it let me change the channel number in MyMixer in whatever I choose in the AudioDeviceSelector… but, obviously, becouse of there’s no transportsource, i cannot start playing and other…

Help me find the solution to my sick problem…

thanks

Sorry, I still don’t understand - exactly which class are you saying is not working, and in what way is it failing?