Discussion:
Hello Portaudio-Community :), ASIO + DSD
(too old to reply)
Maximilian Sauermann
2018-07-27 11:36:20 UTC
Permalink
Hi everyone 😊,

I am trying to get portaudio to work with the „native“ DSD-Format. DSD is an alternative to PCM. It is a 1-bit (packed in bytes). Because of that DSD streams come with higher samplerates. Starting at 44100 * 64 (DSD64). The ASIOSDK supports „native“ DSD. It has the sampleformats `ASIOSTDSDInt8LSB1`, `ASIOSTDSDInt8MSB1`, `ASIOSTDSDInt8NER8` (which prolly „match“ paInt8).

I managed to modifiy portaudio a little bit so that I can initialize a DSD-Stream and the ASIO-Driver reports the correct sampleformat + samplerate. But when I try to start the stream the program crashes at the ASIOStart()-line without an error. I am using blockingIO.

I am wondering if there are parts in the core of portaudio that cannot handle the high samplerates or if it is possible to get it to work.

-Maxi Sauermann
Ross Bencina
2018-07-27 12:28:14 UTC
Permalink
Hi Maxi,

I don't see "ASIOSTDSD" when grepping my ASIO SDK directory. It must be
a "recent" addition. What ASIO SDK version do you have?
Post by Maximilian Sauermann
I am wondering if there are parts in the core of portaudio that cannot
handle the high samplerates or if it is possible to get it to work.
My guess is that PortAudio is not calculating the buffer sizes correctly
and feeding garbage to the callback (does your PA callback get called?).
PA has no concept of a DSD callback buffer, so you'd need to do some
work to make it work.

Have you tried running in a debugger to see why it's crashing?

I don't think it would be impossible to make a "custom data format"
work. PA/DirectSound can do ac3 passthrough for example.

That said, I'm not sure what you would gain versus using the ASIO SDK
directly, unless you also want to support PCM audio I/O.

Ross.
Post by Maximilian Sauermann
Hi everyone 😊,
I am trying to get portaudio to work with the „native“ DSD-Format. DSD
is an alternative to PCM. It is a 1-bit (packed in bytes). Because of
that DSD streams come with higher samplerates. Starting at 44100 * 64
(DSD64). The ASIOSDK supports „native“ DSD. It has the sampleformats
`ASIOSTDSDInt8LSB1`, `ASIOSTDSDInt8MSB1`, `ASIOSTDSDInt8NER8` (which
prolly „match“ paInt8).
I managed to modifiy portaudio a little bit so that I can initialize a
DSD-Stream and the ASIO-Driver reports the correct sampleformat +
samplerate. But when I try to start the stream the program crashes at
the ASIOStart()-line without an error. I am using blockingIO.
I am wondering if there are parts in the core of portaudio that cannot
handle the high samplerates or if it is possible to get it to work.
-Maxi Sauermann
Maximilian Sauermann
2018-07-27 13:19:06 UTC
Permalink
Hi Ross,
Post by Ross Bencina
What ASIO SDK version do you have?
not sure when it was added. I downloaded the lastest release (2.3).
Post by Ross Bencina
My guess is that PortAudio is not calculating the buffer sizes correctly and feeding garbage to the callback (does your PA callback get called?).
Im not using a callback. -> BlockinIO (WriteStream, ReadStream). I am not getting to the point where I would write to the stream, because the application crashes before that.
Post by Ross Bencina
Have you tried running in a debugger to see why it's crashing?
No. I created a little nodejs-binding in c. But I guess I could try to attach a debugger to the portaudio-dll? Is that possible?
Post by Ross Bencina
That said, I'm not sure what you would gain versus using the ASIO SDK directly, unless you also want to support PCM audio I/O.
I would like to support pcm over all the other protocols aswell 😊. I am not a c/c++ developer so I don't think I could create an ASIOSDK-implementation from scratch that would pass my personal QS 😉

Thank you for your response!
-Maxi

-----Ursprüngliche Nachricht-----
Von: portaudio-***@lists.columbia.edu <portaudio-***@lists.columbia.edu> Im Auftrag von Ross Bencina
Gesendet: Freitag, 27. Juli 2018 14:28
An: Portaudio Mailing List <***@music.columbia.edu>
Betreff: Re: [Portaudio] Hello Portaudio-Community :), ASIO + DSD

Hi Maxi,

I don't see "ASIOSTDSD" when grepping my ASIO SDK directory. It must be a "recent" addition. What ASIO SDK version do you have?
Post by Ross Bencina
I am wondering if there are parts in the core of portaudio that cannot > handle the high samplerates or if it is possible to get it to work.
My guess is that PortAudio is not calculating the buffer sizes correctly and feeding garbage to the callback (does your PA callback get called?).
PA has no concept of a DSD callback buffer, so you'd need to do some work to make it work.

Have you tried running in a debugger to see why it's crashing?

I don't think it would be impossible to make a "custom data format"
work. PA/DirectSound can do ac3 passthrough for example.

That said, I'm not sure what you would gain versus using the ASIO SDK directly, unless you also want to support PCM audio I/O.

Ross.
Post by Ross Bencina
Hi everyone 😊,
I am trying to get portaudio to work with the „native“ DSD-Format. DSD
is an alternative to PCM. It is a 1-bit (packed in bytes). Because of
that DSD streams come with higher samplerates. Starting at 44100 * 64
(DSD64). The ASIOSDK supports „native“ DSD. It has the sampleformats
`ASIOSTDSDInt8LSB1`, `ASIOSTDSDInt8MSB1`, `ASIOSTDSDInt8NER8` (which
prolly „match“ paInt8).
I managed to modifiy portaudio a little bit so that I can initialize a
DSD-Stream and the ASIO-Driver reports the correct sampleformat +
samplerate. But when I try to start the stream the program crashes at
the ASIOStart()-line without an error. I am using blockingIO.
I am wondering if there are parts in the core of portaudio that cannot
handle the high samplerates or if it is possible to get it to work.
-Maxi Sauermann
_______________________________________________
Portaudio mailing list
***@lists.columbia.edu
https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.columbia.edu%2Fmailman%2Flistinfo%2Fportaudio&amp;data=02%7C01%7C%7C74ee5277ab264fa5b44908d5f3bc76ce%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636682913123948679&amp;sdata=FyoZiI5iWpIfQ5efzmSCOcGwzL3deSYqj4HjmmctxsE%3D&amp;reserved=0
Reinhold Hoffmann
2018-07-27 13:32:22 UTC
Permalink
Hi Maxi,

I think it is worth to read the ASIO SDK forum at
https://sdk.steinberg.net/viewtopic.php?f=1&t=332
and double-check if your reported issue is similar to that issue in that
post or if it is really related to Portaudio.

Reinhold

-----Ursprüngliche Nachricht-----
Von: portaudio-***@lists.columbia.edu
[mailto:portaudio-***@lists.columbia.edu] Im Auftrag von Maximilian
Sauermann
Gesendet: Freitag, 27. Juli 2018 15:19
An: portaudio list
Betreff: Re: [Portaudio] Hello Portaudio-Community :), ASIO + DSD

Hi Ross,
Post by Ross Bencina
What ASIO SDK version do you have?
not sure when it was added. I downloaded the lastest release (2.3).
Post by Ross Bencina
My guess is that PortAudio is not calculating the buffer sizes correctly
and feeding garbage to the callback (does your PA callback get called?).
Im not using a callback. -> BlockinIO (WriteStream, ReadStream). I am not
getting to the point where I would write to the stream, because the
application crashes before that.
Post by Ross Bencina
Have you tried running in a debugger to see why it's crashing?
No. I created a little nodejs-binding in c. But I guess I could try to
attach a debugger to the portaudio-dll? Is that possible?
Post by Ross Bencina
That said, I'm not sure what you would gain versus using the ASIO SDK
directly, unless you also want to support PCM audio I/O.
I would like to support pcm over all the other protocols aswell ??. I am not
a c/c++ developer so I don't think I could create an ASIOSDK-implementation
from scratch that would pass my personal QS ??

Thank you for your response!
-Maxi

-----Ursprüngliche Nachricht-----
Von: portaudio-***@lists.columbia.edu
<portaudio-***@lists.columbia.edu> Im Auftrag von Ross Bencina
Gesendet: Freitag, 27. Juli 2018 14:28
An: Portaudio Mailing List <***@music.columbia.edu>
Betreff: Re: [Portaudio] Hello Portaudio-Community :), ASIO + DSD

Hi Maxi,

I don't see "ASIOSTDSD" when grepping my ASIO SDK directory. It must be a
"recent" addition. What ASIO SDK version do you have?
Post by Ross Bencina
I am wondering if there are parts in the core of portaudio that cannot >
handle the high samplerates or if it is possible to get it to work.

My guess is that PortAudio is not calculating the buffer sizes correctly and
feeding garbage to the callback (does your PA callback get called?).
PA has no concept of a DSD callback buffer, so you'd need to do some work to
make it work.

Have you tried running in a debugger to see why it's crashing?

I don't think it would be impossible to make a "custom data format"
work. PA/DirectSound can do ac3 passthrough for example.

That said, I'm not sure what you would gain versus using the ASIO SDK
directly, unless you also want to support PCM audio I/O.

Ross.
Post by Ross Bencina
Hi everyone ??,
I am trying to get portaudio to work with the „native“ DSD-Format. DSD
is an alternative to PCM. It is a 1-bit (packed in bytes). Because of
that DSD streams come with higher samplerates. Starting at 44100 * 64
(DSD64). The ASIOSDK supports „native“ DSD. It has the sampleformats
`ASIOSTDSDInt8LSB1`, `ASIOSTDSDInt8MSB1`, `ASIOSTDSDInt8NER8` (which
prolly „match“ paInt8).
I managed to modifiy portaudio a little bit so that I can initialize a
DSD-Stream and the ASIO-Driver reports the correct sampleformat +
samplerate. But when I try to start the stream the program crashes at
the ASIOStart()-line without an error. I am using blockingIO.
I am wondering if there are parts in the core of portaudio that cannot
handle the high samplerates or if it is possible to get it to work.
-Maxi Sauermann
_______________________________________________
Portaudio mailing list
***@lists.columbia.edu
https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.colu
mbia.edu%2Fmailman%2Flistinfo%2Fportaudio&amp;data=02%7C01%7C%7C74ee5277ab26
4fa5b44908d5f3bc76ce%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C6366829131
23948679&amp;sdata=FyoZiI5iWpIfQ5efzmSCOcGwzL3deSYqj4HjmmctxsE%3D&amp;reserv
ed=0
Ross Bencina
2018-08-02 01:58:46 UTC
Permalink
Hello Maxi,

Firstly, yes do review Reinhold's suggestion. Also, if you can verify
that some existing software successfully does DSD via ASIO on your
machine that would eliminate a lot of guesswork.
Post by Maximilian Sauermann
Post by Ross Bencina
Have you tried running in a debugger to see why it's crashing?
No. I created a little nodejs-binding in c. But I guess I could try to attach a debugger to the portaudio-dll? Is that possible?
Please get a basic C program working correctly before trying any foreign
language binding. The binding just adds confusion to an already
complicated situation.

Start with getting input OR output working, then combine them.
Post by Maximilian Sauermann
I am not a c/c++ developer so I don't think I could create an ASIOSDK-implementation from scratch that would pass my personal QS 😉
The alternative to using the ASIO SDK directly is to understand both the
ASIO SDK and PortAudio internals enough to modify PortAudio.

As it stands, it seems likely that you're going to have to make some
changes to PortAudio. This will most likely be limited to pa_asio.cpp
and pa_asio.h

To begin with, you'll need to modify these functions in pa_asio.cpp to
deal with the DSD formats: AsioSampleTypeToPaNativeSampleFormat,
AsioSampleTypeLOG, BytesPerAsioSample.

As a hack, you may be able to get away with mapping the DSD ASIO types
to paInt8 or paUInt8 and opening the PA client stream with the same
format, this should effectively give you data pass-through with
byte-size samples. (That assumes the rest of the ASIO SDK represents DSD
using byte-size samples -- I haven't checked!) In the end though there
will need to be some more elaborate format selection scheme via
paCustomFormat.

Ross.

Loading...