Author Topic: DSD: Playing 6-chn out of stereo ASIO driver  (Read 148 times)

lqbe

  • Posts: 32
I just noticed that playing a 6-chn DSD64 file through an ASIO 2-chn driver (in DSD mode) is accepted without errors or warnings and produced a pitched down result with a bit of static noise.

Is it possible to just play the first two channels (but I realize, RAW means as-is) or is it best practice to simply check the device output count and disallow playback of mismatching files?

Cheers

Ian @ un4seen

  • Administrator
  • Posts: 20336
Re: DSD: Playing 6-chn out of stereo ASIO driver
« Reply #1 on: 9 Aug '17 - 17:44 »
You could try discarding the 4 extra channels' from the DSD data before passing it to BASSASIO, perhaps something like this:

Code: [Select]
DWORD CALLBACK AsioProc(BOOL input, DWORD channel, void *buffer, DWORD length, void *user)
{
BYTE *temp = new BYTE[length*3]; // temporary buffer for DSD data (3 times as much is needed)
int c = BASS_ChannelGetData(dsdstream, temp, length*3); // get data from the DSD stream
if (c == -1) c = 0; // an error, no data
c /= 6; // per-channel bytes
BYTE *out = (BYTE*)buffer;
for (int a = 0; a < c; a++) {
out[a*2] = temp[a*6]; // keep 1st channel
out[a*2+1] = temp[a*6+1]; // and 2nd channel
}
delete[] temp;
return c*2;
}

lqbe

  • Posts: 32
Re: DSD: Playing 6-chn out of stereo ASIO driver
« Reply #2 on: 10 Aug '17 - 22:05 »
Thanks, this works well.

In my mind I was not to touch the DSD stream at all, for whatever reason :)