Author Topic: BASSASIO beta  (Read 128639 times)

Ian @ un4seen

  • Administrator
  • Posts: 20424
BASSASIO beta
« on: 17 Apr '05 - 17:22 »
BASSASIO isn't an add-on in the same sense as the CD/WMA/etc add-ons. It's a separate module and doesn't actually require BASS at all, though BASS can of course be used with it for decoding/DSP/FX/etc purposes. ASIO versions of a few of the BASS examples are included.

Now available on the BASSASIO page.
« Last Edit: 11 Jun '08 - 16:37 by Ian @ un4seen »

Ian @ un4seen

  • Administrator
  • Posts: 20424
Re: BASSASIO beta
« Reply #1 on: 18 Apr '05 - 15:36 »
The "BASSASIO beta" download has been updated. There are a couple of little tweaks to the examples, and a VB version of DSPTEST is now included (thanks to Jobby).

Your's fgerfr

  • Guest
Re: BASSASIO beta
« Reply #2 on: 18 Apr '05 - 17:36 »

Very nice. Thanks.

Chris

  • Posts: 1810
Re: BASSASIO beta
« Reply #3 on: 18 Apr '05 - 20:19 »
Hi
a DSP-Delphi example will coming soon
Hold on...
Greets Chris

Chris

  • Posts: 1810
Re: BASSASIO beta
« Reply #4 on: 19 Apr '05 - 10:32 »
Hi
Here can you downlod the Delphi AsioDSP Example
http://www.cst-development.de/bass_samples/asiodsptest.zip

@ Ian

If you want you can add the example to the bassasio packages.
And In the bassasio pas is an little error
Code: [Select]
function BASS_ASIO_ChannelEnable(input:BOOL; channel:DWORD;var  proc:ASIOPROC; user:DWORD): BOOL; stdcall; external bassasiodll;
must be
Code: [Select]
function BASS_ASIO_ChannelEnable(input:BOOL; channel:DWORD;proc:ASIOPROC; user:DWORD): BOOL; stdcall; external bassasiodll;
One Question about Pause/Restart how to implementing that  with asio ???
(So far as I see is there only the Option Start/Stop.....)

@All

For those People who don't have an asio Driver Card (AC97,Soundblaster Live .....and other )
Here is an Asio Driver what will work also with NONE Asio Soundcards (condition you must have an WDM Driver)
http://www.asio4all.com/


Greets Chris
« Last Edit: 19 Apr '05 - 10:42 by Chris »

Guest

  • Guest
Re: BASSASIO beta
« Reply #5 on: 19 Apr '05 - 11:59 »
what is ASIO (Audio Stream Input/Output)

what is ASIO used for ?

Ian @ un4seen

  • Administrator
  • Posts: 20424
Re: BASSASIO beta
« Reply #6 on: 19 Apr '05 - 15:29 »
Hi
Here can you downlod the Delphi AsioDSP Example
http://www.cst-development.de/bass_samples/asiodsptest.zip

@ Ian

If you want you can add the example to the bassasio packages.

Thanks. It's now in the "BASSASIO beta" download. VB versions of the LIVEFX and LIST examples are also included (courtesy of Jobby again). The BASSASIO.DLL has also been updated (BASS_ASIO_GetLatencies was swapping the input/output latencies).

One Question about Pause/Restart how to implementing that  with asio ???
(So far as I see is there only the Option Start/Stop.....)

ASIO doesn't have pause/resume functions. Pausing is basically the same thing as stopping, and resuming is the same as starting :)

If you want to pause individual channels, you could just return silence (0s) in the channel's ASIOPROC when it's "paused", or ignore the data if it's an input channel.

what is ASIO used for ?

ASIO provides low-latency playback and recording. So it's useful for when the sound needs to dynamically change, eg. soft-synths, etc... speaking of which, I've bunged an ASIO version of the SYNTH example in the download now too.

Chris

  • Posts: 1810
Re: BASSASIO beta
« Reply #7 on: 21 Apr '05 - 14:33 »
Hi
here the next (more comfortable) Delphi Asio Example (icl. compiled Binary)
This Demo has implement
1.)- a simple EndSync
2.)- Play/Stop-Status
3.)- Tempo/Pitch/PitchShifting (from the bass_fx.dll)
4.)- 2 DSP -Effects (from the bass_fx.dll)
5.) -2  FX-Effects
6.) Info about your AsioDriver

Here You can download the Example
http://www.cst-development.de/bass_samples/AsioTempoExample.zip

@ Ian you can add also of cource this Example to the asio Packages
Greets Chris


« Last Edit: 21 Apr '05 - 14:38 by Chris »

Ian @ un4seen

  • Administrator
  • Posts: 20424
Re: BASSASIO beta
« Reply #8 on: 21 Apr '05 - 16:49 »
here the next (more comfortable) Delphi Asio Example (icl. compiled Binary)

Nice work :)

You should call BASS_ASIO_Stop at the end of playback (eg. in FileHasTheEnd) though, so that the ending sound isn't just left repeating. I also noticed that the "Asio-Info" display values were out of whack, and then spotted a little bug in the Delphi API (the char arrays should be "0..31" I think). An updated API is in the BASSASIO download now.

engineeer

  • Posts: 86
Re: BASSASIO beta
« Reply #9 on: 21 Apr '05 - 18:30 »
Ian, is it possible to detect if ASIO channel is used by other application?
If I start two instances of contest example both plays fine (visualy, no errors), but I can hear only first one.

Chris

  • Posts: 1810
Re: BASSASIO beta
« Reply #10 on: 21 Apr '05 - 20:11 »
@Ian...
Yap the Bass_Asio_info is now accurate.

About to add Bass_Asio_Stop in the Endsync or in the FileHasEnd procedure
make the follwing Effect
if I`m closing the Application (after the sync End has reached)
user interface close but the process keeps on still running...
if I`m killing the process from the task manager.
crash windows complete !!!!!!(Blue-Screen , Soundcard Driver) !!!!!
(DRIVER_IRQL_NOT_LESS_OR_EQUAL  ,Stop 0x000000D1)
I'm now not shure why......
Here can you download the binary and the Unit
(In the Unit i will have only add Bass_Asio_Stop at the End of the FileHasEnd Procedure)
It seams that calling Bass_Asio_Stop inside the Sync will make Problems with the Driver
http://www.cst-development.de/bass_samples/AsioCrash.zip


Greets Chris

« Last Edit: 21 Apr '05 - 21:16 by Chris »

Chris

  • Posts: 1810
Re: BASSASIO beta
« Reply #11 on: 21 Apr '05 - 21:52 »
So...
Error was found.....to call Bass_Asio_Stop inside a Bass Sync Thread will crash Windows...
I have change inside the Sync to a Post Message now it will work fine
for all here you can download the fixed Example

http://www.cst-development.de/bass_samples/AsioTempoExample.zip

Greets Chris

Ian @ un4seen

  • Administrator
  • Posts: 20424
Re: BASSASIO beta
« Reply #12 on: 22 Apr '05 - 18:03 »
Ian, is it possible to detect if ASIO channel is used by other application?
If I start two instances of contest example both plays fine (visualy, no errors), but I can hear only first one.

I'm not sure if it's possible to detect that (I'll look into it), but some cards (eg. Audigys) do allow multiple apps to use ASIO simultaneously.

Error was found.....to call Bass_Asio_Stop inside a Bass Sync Thread will crash Windows...

Close :)

Thinking about it... When using a decoding channel, all syncs are "mix-time". That means they're run in the BASS_ChannelGetData call/thread, which is the ASIO callback thread in this case. So in effect it was calling BASS_ASIO_Stop inside the ASIO callback, which is a "no-no".

Chris

  • Posts: 1810
Re: BASSASIO beta
« Reply #13 on: 22 Apr '05 - 21:50 »
Thanks for the Info...
Onother Question about BASS_ASIO_ChannelSetFormat
i Have trying (example with the dsp-example) to change from Floating Point to one of the Integer Formats
(BASS_ASIO_FORMAT_xBIT)...

i have change

BASS_ASIO_ChannelSetFormat(false, 0, BASS_ASIO_FORMAT_32Bit);

and

chan := BASS_StreamCreateFile(false, PChar(opendialog1.FileName), 0, 0,BASS_STREAM_DECODE);

but will not working (sound will have a wrong sampling Frequenz)
Greets Chris....


---edit-----------
@ Ian it seams that

BASS_ASIO_ChannelSetFormat will have NO Effect
will be allways 32BitFloat
unaffected what I am setting....in the call
« Last Edit: 23 Apr '05 - 13:52 by Chris »

Ian @ un4seen

  • Administrator
  • Posts: 20424
Re: BASSASIO beta
« Reply #14 on: 23 Apr '05 - 14:48 »
Onother Question about BASS_ASIO_ChannelSetFormat
i Have trying (example with the dsp-example) to change from Floating Point to one of the Integer Formats
(BASS_ASIO_FORMAT_xBIT)...

i have change

BASS_ASIO_ChannelSetFormat(false, 0, BASS_ASIO_FORMAT_32Bit);

and

chan := BASS_StreamCreateFile(false, PChar(opendialog1.FileName), 0, 0,BASS_STREAM_DECODE);

The default format of BASS streams is 16-bit, so that should be BASS_ASIO_FORMAT_16BIT. Note that BASS_ASIO_ChannelSetFormat tells BASSASIO what sample format the channel's ASIOPROC expects - it does not affect the actual device/driver format, which can be retrieved via BASS_ASIO_ChannelGetInfo.

Btw, I've now added a short "do not call these functions" note in the ASIOPROC docs :)

Chris

  • Posts: 1810
Re: BASSASIO beta
« Reply #15 on: 23 Apr '05 - 18:41 »
Thanks....
but it seams that something will not work...
please try a liitle demo without Format Float (i have tested it under 3 diffrent Asio Drivers
the effekt will be MickmouseSound
(if Im using Format Float all will working fine,but if Im trying a 16Bit Format i will hear a absolute wrong sampling Freq

I`m Building the asio calls in this sequencing

OnFormCreate
Code: [Select]
BASS_Init(0, 48000, 0, 0, nil);
BASS_ASIO_Init(0)
BASS_ASIO_ChannelEnable(false, Chan, @AsioProc, 0);
BASS_ASIO_ChannelJoin(false, 1, 0);
BASS_ASIO_ChannelSetFormat(false, 0, BASS_ASIO_FORMAT_FLOAT);
-------------------------------------
Code: [Select]
procedure OpenFile;
var
   Asio_Format,FloatSupport := DWORD;
begin
   if not opendialog.execute then
    exit;

   Bass_Asio_Stop;
   BASS_StreamFree(chan);
 if checkbox.checked then
 begin
   Asio_Format := BASS_ASIO_FORMAT_FLOAT;
   FloatSupport := Bass_Sample_Float;
end
else
   Asio_Format := BASS_ASIO_FORMAT_16Bit;
   FloatSupport := 0;
end;
  BASS_ASIO_ChannelSetFormat(false, 0, Asio_Format);

Chan := BASS_StreamCreateFile(false, PChar(opendialog1.FileName), 0, 0, BASS_STREAM_DECODE or FloatSupport);

Do some Stuff

Bass_Asio_Start(0);


Greets Chris


« Last Edit: 24 Apr '05 - 18:49 by Chris »

Ian @ un4seen

  • Administrator
  • Posts: 20424
Re: BASSASIO beta
« Reply #16 on: 24 Apr '05 - 22:43 »
please try a liitle demo without Format Float (i have tested it under 3 diffrent Asio Drivers
the effekt will be MickmouseSound
(if Im using Format Float all will working fine,but if Im trying a 16Bit Format i will hear a absolute wrong sampling Freq

I have tried modifying the CONTEST.C example to use 16-bit, and it was fine. Are you setting the ASIO device/channel sample rate to that of the BASS channel?

Also, one little thing...

Code: [Select]
BASS_ASIO_ChannelEnable(false, Chan, @AsioProc, 0);
BASS_ASIO_ChannelJoin(false, 1, 0);

Assuming you're joining 2 channels to form a stereo channel, and "Chan" is the first of them, that should probably be...

Code: [Select]
BASS_ASIO_ChannelEnable(false, Chan, @AsioProc, 0);
BASS_ASIO_ChannelJoin(false, Chan+1, Chan);

Chris

  • Posts: 1810
Re: BASSASIO beta
« Reply #17 on: 25 Apr '05 - 00:00 »
Oooooooooops
Sorry after Installing new my Asio AudioDriver it will woll also with 16 Bit Channels.....
Sorry !!!!
Greets Chris

« Last Edit: 25 Apr '05 - 00:23 by Chris »

Edy

  • Posts: 27
Re: BASSASIO beta
« Reply #18 on: 26 Apr '05 - 13:34 »
Question:
BASSASIO donesn't seem to be designed to use different ASIO devices at the same time. Is this feature planned to be implemented in a future version?

I just need to know it in order to design my next developments.
Thank you!

Edy

Ian @ un4seen

  • Administrator
  • Posts: 20424
Re: BASSASIO beta
« Reply #19 on: 26 Apr '05 - 14:14 »
The ASIO driver API doesn't seem to be designed for using multiple devices simultaneously, eg. there's no "user" parameter in it's callbacks. That'll make it awkward to implement multi-device support in BASSASIO, but it may still happen, although there are no immediate plans for it.

Edy

  • Posts: 27
Re: BASSASIO beta
« Reply #20 on: 26 Apr '05 - 16:57 »
Ok, thanks!

Chris

  • Posts: 1810
Re: BASSASIO beta
« Reply #21 on: 26 Apr '05 - 21:46 »
Hi
I will hope that  Ian find a way to work with multible Devices then the bassasio where be perfekt....
Greets Chris
« Last Edit: 26 Apr '05 - 23:42 by Chris »

Ian @ un4seen

  • Administrator
  • Posts: 20424
Re: BASSASIO beta
« Reply #22 on: 27 Apr '05 - 15:28 »
I couldn't resist the challenge... so there's now a multi-device update in the BASSASIO download :)

It uses the same device context system as BASS (Set/GetDevice), so should be pretty familiar to you. Let me know how you get on with it.

Edy

  • Posts: 27
Re: BASSASIO beta
« Reply #23 on: 27 Apr '05 - 16:12 »
Wow... that's a really good (and unexpected) new!  Congratulations!

Just one quick question regarding Get/SetDevice. I use BASS for decoding only (not for playback). If I've understood it good, then I must to call SetDevice before any other call (or group of calls) to the BASS_ASIO functions, right?

I've read somewhere that there's no problem with multithreading if SetDevice is called this way. BASSASIO works the same way?

Thank you!

Edy

  • Posts: 27
Re: BASSASIO beta
« Reply #24 on: 27 Apr '05 - 16:20 »
Forget the above question... I've just read the help file.
Thank you!  :P