Author Topic: Linking files for ASIO?  (Read 112 times)

SoundMike

  • Posts: 364
Linking files for ASIO?
« on: 2 Dec '22 - 23:21 »
Scenarios: 4 files are to be played perfectly in sync to 4 mono outputs of a selected audio output device.

DirectSound: No problem. I use BASS_ChannelSetLink on channels 2-4 to link them to channel 1. Plays perfectly.

ASIO: I can't use BASS_ChannelSetLink on the source channels because they are now decoding channels that are fed to the BASS mixer, and the BASS mixer output is played to ASIO outputs. Result: playback is not 'perfectly' in sync - user reports "the tracks aren’t staying in alignment, with some occasionally running a little ahead of the others, and then dropping behind".

Is there some way I can play channels in sync when using ASIO, where the individual tracks must be played to separate outputs of the selected ASIO device? Unfortunately some audio devices only support 2 outputs with their DirectSound drivers, so ASIO becomes a must.

Ian @ un4seen

  • Administrator
  • Posts: 24784
Re: Linking files for ASIO?
« Reply #1 on: 5 Dec '22 - 13:53 »
Are the ASIO channels all on the same device? If so, they are inherently linked and should stay perfectly in sync. But when you want to make multiple changes to ASIO channels at the same time, BASS_ASIO_Lock can be used to ensure that they take effect simultaneously:

Code: [Select]
BASS_ASIO_Lock(true); // lock ASIO device
// apply changes here
BASS_ASIO_Lock(false); // unlock ASIO device

If the problem persists, are the channels out of sync from the start or are they drifting apart over time?

SoundMike

  • Posts: 364
Re: Linking files for ASIO?
« Reply #2 on: 6 Dec '22 - 00:08 »
Thanks, Ian. I hadn't used BASS_ASIO_LOCK so I've now wrapped the locking/unlocking around the relevant BASS function calls. Tests OK here, so I've sent an updated version of my program to the user who raised the problem.