19 Jun '13 - 00:20 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1]
  Reply  |  Print  
Author Topic: bass + linux  (Read 369 times)
dennis_margelys
Posts: 66


« on: 1 Mar '12 - 12:28 »
Reply with quoteQuote

hi everyone.....

i have a M-audio delta 1010 soundcard and i need to use all channels independently in linux..... in windows i used bassasio but in linux i don't know how to achieve that with bass........

i need help...
Logged
Ian @ un4seen
Administrator
Posts: 15363


« Reply #1 on: 1 Mar '12 - 16:03 »
Reply with quoteQuote

Are you joining the ASIO output channels and using a mixer to feed them? If so, you can use the same mixer setup without ASIO. For example, create a mixer with the same number of channels as there are available speakers, something like this...

BASS_INFO bi;
BASS_GetInfo(&bi); // get output device info
mixer=BASS_Mixer_StreamCreate(bi.freq, bi.speakers, BASS_SAMPLE_FLOAT); // create a mixer with same rate and channel count
// add sources to mix here
BASS_ChannelPlay(mixer, FALSE); // start the mixer

Note the mixer will add latency. If you would like to reduce that, you can use the BASS_CONFIG_BUFFER option (and BASS_CONFIG_UPDATEPERIOD) to do that, or perhaps BASS_ATTRIB_NOBUFFER. Please see the documentation for details on those things.
Logged
dennis_margelys
Posts: 66


« Reply #2 on: 1 Mar '12 - 21:08 »
Reply with quoteQuote

i saw bassmix docs but nothing..... this is what i'm doing....
int chanmap_a[]={0,-1};
    int chanmap_b[]={NULL,1,-1};
    int chanmap_c[]={NULL,NULL,0.5,-1};
    int chanmap_d[]={NULL,NULL,NULL,NULL,-1};
    int chanmap_e[]={NULL,NULL,NULL,NULL,1,-1};
    int chanmap_f[]={NULL,NULL,NULL,NULL,NULL,1,-1};
    int chanmap_g[]={NULL,NULL,NULL,NULL,NULL,NULL,1,-1};
    int chanmap_h[]={NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,-1};
    chan[0]=BASS_StreamCreateFile(FALSE,"/home/icrt/Desktop/a.mp3",0,0,BASS_SAMPLE_FLOAT|BASS_STREAM_DECODE);
    chan[1]=BASS_StreamCreateFile(FALSE,"/home/icrt/Desktop/1.mp3",0,0,BASS_SAMPLE_FLOAT|BASS_STREAM_DECODE);
    chan[2]=BASS_StreamCreateFile(FALSE,"/home/icrt/Desktop/2.mp3",0,0,BASS_SAMPLE_FLOAT|BASS_STREAM_DECODE);
    chan[3]=BASS_StreamCreateFile(FALSE,"/home/icrt/Desktop/3.mp3",0,0,BASS_SAMPLE_FLOAT|BASS_STREAM_DECODE);
    chan[4]=BASS_StreamCreateFile(FALSE,"/home/icrt/Desktop/4.mp3",0,0,BASS_SAMPLE_FLOAT|BASS_STREAM_DECODE);
    chan[5]=BASS_StreamCreateFile(FALSE,"/home/icrt/Desktop/5.mp3",0,0,BASS_SAMPLE_FLOAT|BASS_STREAM_DECODE);
    chan[6]=BASS_StreamCreateFile(FALSE,"/home/icrt/Desktop/6.mp3",0,0,BASS_SAMPLE_FLOAT|BASS_STREAM_DECODE);
    chan[7]=BASS_StreamCreateFile(FALSE,"/home/icrt/Desktop/7.mp3",0,0,BASS_SAMPLE_FLOAT|BASS_STREAM_DECODE);


    mixer[1]=BASS_Split_StreamCreate(chan[1],BASS_SAMPLE_SOFTWARE, chanmap_b);
    mixer[2]=BASS_Split_StreamCreate(chan[2],BASS_SAMPLE_SOFTWARE, chanmap_c);
    mixer[3]=BASS_Split_StreamCreate(chan[3],BASS_SAMPLE_SOFTWARE, chanmap_d);
    mixer[4]=BASS_Split_StreamCreate(chan[4],BASS_SAMPLE_SOFTWARE, chanmap_e);
    mixer[5]=BASS_Split_StreamCreate(chan[5],BASS_SAMPLE_SOFTWARE, chanmap_f);
    mixer[6]=BASS_Split_StreamCreate(chan[6],BASS_SAMPLE_SOFTWARE, chanmap_g);
    mixer[7]=BASS_Split_StreamCreate(chan[7],BASS_SAMPLE_SOFTWARE, chanmap_h);
   
    BASS_ChannelPlay(mixer[1],FALSE);
    BASS_ChannelPlay(mixer[2],FALSE);
   BASS_ChannelPlay(mixer[3],FALSE);
    BASS_ChannelPlay(mixer[4],FALSE);
    BASS_ChannelPlay(mixer[5],FALSE);
    BASS_ChannelPlay(mixer[6],FALSE);
    BASS_ChannelPlay(mixer[7],FALSE);
Logged
Ian @ un4seen
Administrator
Posts: 15363


« Reply #3 on: 2 Mar '12 - 13:43 »
Reply with quoteQuote

That looks like you may be getting the splitter "chanmap" option mixed up with matrix mixing. Matrix mixing deals with per-channel mixing levels, but the BASS_Split_StreamCreate "chanmap" parameter deals with channel indexes (0=1st, 1=2nd, etc), so "0.5" is not an appropriate setting (nor is "NULL" really).

Do you want to play 8 files on 8 speakers? If so, you can use the SPEAKER flags to do that...

    chan[0]=BASS_StreamCreateFile(FALSE,"/home/icrt/Desktop/a.mp3",0,0,BASS_SAMPLE_FLOAT|BASS_SPEAKER_N(0)|BASS_SPEAKER_LEFT);
    chan[1]=BASS_StreamCreateFile(FALSE,"/home/icrt/Desktop/1.mp3",0,0,BASS_SAMPLE_FLOAT|BASS_SPEAKER_N(0)|BASS_SPEAKER_RIGHT);
    chan[2]=BASS_StreamCreateFile(FALSE,"/home/icrt/Desktop/2.mp3",0,0,BASS_SAMPLE_FLOAT|BASS_SPEAKER_N(1)|BASS_SPEAKER_LEFT);
    chan[3]=BASS_StreamCreateFile(FALSE,"/home/icrt/Desktop/3.mp3",0,0,BASS_SAMPLE_FLOAT|BASS_SPEAKER_N(1)|BASS_SPEAKER_RIGHT);
    chan[4]=BASS_StreamCreateFile(FALSE,"/home/icrt/Desktop/4.mp3",0,0,BASS_SAMPLE_FLOAT|BASS_SPEAKER_N(2)|BASS_SPEAKER_LEFT);
    chan[5]=BASS_StreamCreateFile(FALSE,"/home/icrt/Desktop/5.mp3",0,0,BASS_SAMPLE_FLOAT|BASS_SPEAKER_N(2)|BASS_SPEAKER_RIGHT);
    chan[6]=BASS_StreamCreateFile(FALSE,"/home/icrt/Desktop/6.mp3",0,0,BASS_SAMPLE_FLOAT|BASS_SPEAKER_N(3)|BASS_SPEAKER_LEFT);
    chan[7]=BASS_StreamCreateFile(FALSE,"/home/icrt/Desktop/7.mp3",0,0,BASS_SAMPLE_FLOAT|BASS_SPEAKER_N(3)|BASS_SPEAKER_RIGHT);
    BASS_ChannelPlay(chan[0],FALSE);
    BASS_ChannelPlay(chan[1],FALSE);
    BASS_ChannelPlay(chan[2],FALSE);
    BASS_ChannelPlay(chan[3],FALSE);
    BASS_ChannelPlay(chan[4],FALSE);
    BASS_ChannelPlay(chan[5],FALSE);
    BASS_ChannelPlay(chan[6],FALSE);
    BASS_ChannelPlay(chan[7],FALSE);

Or using a mixer...

    chan[0]=BASS_StreamCreateFile(FALSE,"/home/icrt/Desktop/a.mp3",0,0,BASS_SAMPLE_FLOAT|BASS_STREAM_DECODE);
    chan[1]=BASS_StreamCreateFile(FALSE,"/home/icrt/Desktop/1.mp3",0,0,BASS_SAMPLE_FLOAT|BASS_STREAM_DECODE);
    chan[2]=BASS_StreamCreateFile(FALSE,"/home/icrt/Desktop/2.mp3",0,0,BASS_SAMPLE_FLOAT|BASS_STREAM_DECODE);
    chan[3]=BASS_StreamCreateFile(FALSE,"/home/icrt/Desktop/3.mp3",0,0,BASS_SAMPLE_FLOAT|BASS_STREAM_DECODE);
    chan[4]=BASS_StreamCreateFile(FALSE,"/home/icrt/Desktop/4.mp3",0,0,BASS_SAMPLE_FLOAT|BASS_STREAM_DECODE);
    chan[5]=BASS_StreamCreateFile(FALSE,"/home/icrt/Desktop/5.mp3",0,0,BASS_SAMPLE_FLOAT|BASS_STREAM_DECODE);
    chan[6]=BASS_StreamCreateFile(FALSE,"/home/icrt/Desktop/6.mp3",0,0,BASS_SAMPLE_FLOAT|BASS_STREAM_DECODE);
    chan[7]=BASS_StreamCreateFile(FALSE,"/home/icrt/Desktop/7.mp3",0,0,BASS_SAMPLE_FLOAT|BASS_STREAM_DECODE);
    mixer=BASS_Mixer_StreamCreate(freq, 8, BASS_SAMPLE_FLOAT);
    BASS_Mixer_StreamAddChannel(mixer,chan[0],BASS_SPEAKER_N(0)|BASS_SPEAKER_LEFT);
    BASS_Mixer_StreamAddChannel(mixer,chan[1],BASS_SPEAKER_N(0)|BASS_SPEAKER_RIGHT);
    BASS_Mixer_StreamAddChannel(mixer,chan[2],BASS_SPEAKER_N(1)|BASS_SPEAKER_LEFT);
    BASS_Mixer_StreamAddChannel(mixer,chan[3],BASS_SPEAKER_N(1)|BASS_SPEAKER_RIGHT);
    BASS_Mixer_StreamAddChannel(mixer,chan[4],BASS_SPEAKER_N(2)|BASS_SPEAKER_LEFT);
    BASS_Mixer_StreamAddChannel(mixer,chan[5],BASS_SPEAKER_N(2)|BASS_SPEAKER_RIGHT);
    BASS_Mixer_StreamAddChannel(mixer,chan[6],BASS_SPEAKER_N(3)|BASS_SPEAKER_LEFT);
    BASS_Mixer_StreamAddChannel(mixer,chan[7],BASS_SPEAKER_N(3)|BASS_SPEAKER_RIGHT);
    BASS_ChannelPlay(mixer,FALSE);
Logged
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.18 | SMF © 2013, Simple Machines