Xojo Conferences
MBSSep2018MunichDE
XDCMay2019MiamiUSA

Re: [MBS] PortAudio bug? (MBS Xojo Plugin Mailinglist archive)

Back to the thread list
Previous thread: [MBS] installing a font in Windows and Mac OSX
Next thread: [MBS] [ANN] 12.2pr5


Re: [MBS] Dropbox for plugin distribution?   -   Marc Zeedar
  Re: [MBS] PortAudio bug?   -   Garth Hjelte
   Re: [MBS] PortAudio bug?   -   Christian Schmitz
    Re: [MBS] PortAudio bug?   -   Garth Hjelte
     Re: [MBS] PortAudio bug?   -   Garth Hjelte
      [MBS] Media Card Detection, Windows   -   A. Christopher Rosado
    Re: [MBS] PortAudio bug?   -   Christian Schmitz
    Re: [MBS] PortAudio bug?   -   Garth Hjelte
    Re: [MBS] PortAudio bug?   -   Christian Schmitz
    Re: [MBS] PortAudio bug?   -   Garth Hjelte
     Re: [MBS] PortAudio bug?   -   Garth Hjelte
    Re: [MBS] PortAudio bug?   -   Christian Schmitz
    Re: [MBS] PortAudio bug?   -   Garth Hjelte
     [MBS] possibly some debugging output?   -   James Sentman
    [MBS] PortAudio bug?   -   Garth Hjelte

Re: [MBS] PortAudio bug?
Date: 24.04.12 18:41 (Tue, 24 Apr 2012 12:41:12 -0500)
From: Garth Hjelte
At 09:07 AM 4/24/2012, you wrote:

>Do you have any ideas what it could be? I'd like to rectify this on my main computer, it screws up my debugging etc. Is there something your plugin links to on computers? My Leopard computer does not drop out on other audio or apps. Does your plugin have a bug in Leopard and not Snow Leopard?

>Well, audio drivers can be different. And in the IDE, timings are also often different.

I'm checking both compiled and IDE. And I'm only checking Core Audio as the driver, so there's no difference there. Is there?

Again, realistically, given the same compiled test app I sent you, running in the same computer in Leopard, using Core Audio, I get the drop out, but running in Snow Leopard on the same computer running Core Audio I don't get a drop out. (All prerequisite reboots and PRAM clearings have been done.)

I know this is sort of a stumper question, and made harder since it's only one certain computer config/OS setup, but can you think of anything that could be done to shake the funk?


Garth Hjelte
Sampler User

_______________________________________________
Mbsplugins_monkeybreadsoftware.info mailing list
<email address removed>
https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info

Re: [MBS] PortAudio bug?
Date: 24.04.12 21:49 (Tue, 24 Apr 2012 22:49:19 +0200)
From: Christian Schmitz

Am 24.04.2012 um 15:52 schrieb Garth Hjelte:

> Back in the MBS 7.5 days, I was used to seeing MME and DirectSound on Windows. MME worked lousy, but DS worked fine (with latency). Now I only see MME, ASIO, and WSAPI. MME works lousy, ASIO works great, but WSAPI doesn't work. This is on Win7, a laptop computer, standard onboard sound stuff. ASIO only exists because I installed ASIO4ALL. Otherwise, my app would not work sound-wise. I hate to think what my customers experience that they don't tell me.

It looks like I simply forgot to enable DirectSound after the last update.

I added it here.

Your test app only works well with WASAPI. The DirectSound one doesn't work nice. Maybe you test it?

Greetings
Christian

Re: [MBS] PortAudio bug?
Date: 25.04.12 07:46 (Wed, 25 Apr 2012 01:46:50 -0500)
From: Garth Hjelte
At 04:46 PM 4/24/2012, you wrote:

>> Will do. Although on Windows I get error -996 paInvalidDevice when I do OpenStream on it.

>I think I found the bug.
>You need to use const paFloat32 = 1 for the SampleFormat. PortAudioStreamBufferedMBS class uses floats internally and converts everything to floats.

I haven't tried this, but are you sure? How would your the class know what is being passed into it using AddAudio()? I could pass 16-bit, 24-bit, or 32-bit linear data into it.

I checked PortAudio.com, http://portaudio.com/docs/v19-doxydocs/structPaStreamParameters.html it says:

-PaSampleFormat PaStreamParameters::sampleFormat
-The sample format of the buffer provided to the stream callback, a_ReadStream() or Pa_WriteStream(). It may be any of the formats described by the PaSampleFormat enumeration.

>Also please set OutputParameters.SuggestedLatency to something better than just zero. It works here with 0.2.

OK.

Garth Hjelte
Sampler User

_______________________________________________
Mbsplugins_monkeybreadsoftware.info mailing list
<email address removed>
https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info

Re: [MBS] PortAudio bug?
Date: 25.04.12 08:03 (Wed, 25 Apr 2012 02:03:04 -0500)
From: Garth Hjelte
At 04:46 PM 4/24/2012, you wrote:

>> Will do. Although on Windows I get error -996 paInvalidDevice when I do OpenStream on it.

>>I think I found the bug.
>>You need to use const paFloat32 = 1 for the SampleFormat. PortAudioStreamBufferedMBS class uses floats internally and converts everything to floats.
>
>I haven't tried this, but are you sure? How would your the class know what is being passed into it using AddAudio()? I could pass 16-bit, 24-bit, or 32-bit linear data into it.

Oh, never mind, I got it, AddAudio has it's own bitrate parameter.

Thank you very much, that seems to fix the drop out thing AND the response to the WASAPI drivers on Windows.

Garth Hjelte
Sampler User

_______________________________________________
Mbsplugins_monkeybreadsoftware.info mailing list
<email address removed>
https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info

Re: [MBS] PortAudio bug?
Date: 24.04.12 22:46 (Tue, 24 Apr 2012 23:46:28 +0200)
From: Christian Schmitz

Am 24.04.2012 um 23:05 schrieb Garth Hjelte:

> Will do. Although on Windows I get error -996 paInvalidDevice when I do OpenStream on it.
>

I think I found the bug.

You need to use
const paFloat32 = 1

For the SampleFormat. PortAudioStreamBufferedMBS class uses floats internally and converts everything to floats.

Also please set OutputParameters.SuggestedLatency to something better than just zero. It works here with 0.2.

Greetings
Christian

Re: [MBS] PortAudio bug?
Date: 24.04.12 22:05 (Tue, 24 Apr 2012 16:05:54 -0500)
From: Garth Hjelte
At 03:49 PM 4/24/2012, you wrote:

>> Back in the MBS 7.5 days, I was used to seeing MME and DirectSound on Windows. MME worked lousy, but DS worked fine (with latency). Now I only see MME, ASIO, and WSAPI. MME works lousy, ASIO works great, but WSAPI doesn't work. This is on Win7, a laptop computer, standard onboard sound stuff. ASIO only exists because I installed ASIO4ALL. Otherwise, my app would not work sound-wise. I hate to think what my customers experience that they don't tell me.
>
>It looks like I simply forgot to enable DirectSound after the last update.
>
>I added it here.
>
>Your test app only works well with WASAPI. The DirectSound one doesn't work nice. Maybe you test it?

Will do. Although on Windows I get error -996 paInvalidDevice when I do OpenStream on it.

Also, I tried my app on a PPC Mac and get real bad results using OutputParameters::Device = 0 (the Core Audio driver, the only one). Just a slow buzzing. Any thing else for OutputParameters::Device gives me paInvalidDevice. Is PPC supported?

I found the paError codes on the PortAudio site, where are they listed on your site? They are referred to.

I am also going to check OpenDefaultStream, again my customers are choking me right now (on other stuff). Will check tonight, thanks for the update thing.

Garth Hjelte
Sampler User

_______________________________________________
Mbsplugins_monkeybreadsoftware.info mailing list
<email address removed>
https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info

Re: [MBS] PortAudio bug?
Date: 24.04.12 15:07 (Tue, 24 Apr 2012 16:07:24 +0200)
From: Christian Schmitz

Am 24.04.2012 um 15:30 schrieb Garth Hjelte:

> Do you have any ideas what it could be? I'd like to rectify this on my main computer, it screws up my debugging etc. Is there something your plugin links to on computers? My Leopard computer does not drop out on other audio or apps. Does your plugin have a bug in Leopard and not Snow Leopard?

Well, audio drivers can be different. And in the IDE, timings are also often different.

Greetings
Christian

Re: [MBS] PortAudio bug?
Date: 24.04.12 14:30 (Tue, 24 Apr 2012 08:30:12 -0500)
From: Garth Hjelte
At 02:51 AM 4/24/2012, you wrote:

>> It doesn't matter how much sound data I put in before I start the stream, I still get this dropout right after the audio starts.
>>
>> If it's a bug, which I think it is, can you fix it, like, right away? =) (I'm taking advantage of you, you are very good about this stuff.)
>
>Can't reproduce it here, sorry.
>
>Does it happen for you with current plugins on another Mac?

I built an app and tried it on my Snow Leopard drive - same computer, different system drive and OS, and it works, it DOES NOT have the dropout. The test app and the IDE on my main system (Leopard) have the dropout.

Do you have any ideas what it could be? I'd like to rectify this on my main computer, it screws up my debugging etc. Is there something your plugin links to on computers? My Leopard computer does not drop out on other audio or apps. Does your plugin have a bug in Leopard and not Snow Leopard?

Garth Hjelte
Sampler User

_______________________________________________
Mbsplugins_monkeybreadsoftware.info mailing list
<email address removed>
https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info

Re: [MBS] PortAudio bug?
Date: 24.04.12 14:52 (Tue, 24 Apr 2012 08:52:28 -0500)
From: Garth Hjelte
At 02:51 AM 4/24/2012, you wrote:

>>> It doesn't matter how much sound data I put in before I start the stream, I still get this dropout right after the audio starts.
>>>
>>> If it's a bug, which I think it is, can you fix it, like, right away? =) (I'm taking advantage of you, you are very good about this stuff.)
>>
>>Can't reproduce it here, sorry.
>>
>>Does it happen for you with current plugins on another Mac?
>
>I built an app and tried it on my Snow Leopard drive - same computer, different system drive and OS, and it works, it DOES NOT have the dropout. The test app and the IDE on my main system (Leopard) have the dropout.
>
>Do you have any ideas what it could be? I'd like to rectify this on my main computer, it screws up my debugging etc. Is there something your plugin links to on computers? My Leopard computer does not drop out on other audio or apps. Does your plugin have a bug in Leopard and not Snow Leopard?

To expand this slightly, I had a customer complain about my app (which used this code) that starting playback would take about 10 seconds and then it would start playing, and probably referred to a dropout or similar. I'm not sure if I believe the 10 second part, and it makes me think a bit about the PA implementation. I have gotten some negative feedback but not much, but still there seems to be funny business happening.

Back in the MBS 7.5 days, I was used to seeing MME and DirectSound on Windows. MME worked lousy, but DS worked fine (with latency). Now I only see MME, ASIO, and WSAPI. MME works lousy, ASIO works great, but WSAPI doesn't work. This is on Win7, a laptop computer, standard onboard sound stuff. ASIO only exists because I installed ASIO4ALL. Otherwise, my app would not work sound-wise. I hate to think what my customers experience that they don't tell me.

I understand that DirectSound is really WASAPI now so it's no big deal, but I'm unsure why WASAPI doesn't work.

I know you are just linking into the latest issue of PortAudio, but is there a way we can revisit some of this?

Garth Hjelte
Sampler User

_______________________________________________
Mbsplugins_monkeybreadsoftware.info mailing list
<email address removed>
https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info

Re: [MBS] PortAudio bug?
Date: 24.04.12 08:51 (Tue, 24 Apr 2012 09:51:45 +0200)
From: Christian Schmitz

Am 24.04.2012 um 06:09 schrieb Garth Hjelte:

> It doesn't matter how much sound data I put in before I start the stream, I still get this dropout right after the audio starts.
>
> If it's a bug, which I think it is, can you fix it, like, right away? =) (I'm taking advantage of you, you are very good about this stuff.)

Can't reproduce it here, sorry.

Does it happen for you with current plugins on another Mac?

Greetings
Christian

Re: [MBS] PortAudio bug?
Date: 24.04.12 06:28 (Tue, 24 Apr 2012 00:28:28 -0500)
From: Garth Hjelte
At 11:09 PM 4/23/2012, you wrote:

>Has there been any bug work on the PortAudio stuff since v12.1pr3? I didn't see any. That's what I'm using.
>Try this: www.chickensys.com/bin/pa_test.zip
>When I use PortAudio on Mac, I get like the 2nd second of audio as silence, it drops out. This happens with all sounds.
>Look at the function TestSound() in my test project. You'll have to change the location of the test.wav I supplied, and the OutputParameters.Device parameter.
>test.wav is a good file, no doubt.
>It just loads up some seconds of audio (AddAudio()) and then starts the stream, then loads more seconds of audio, and then sits there so the stream does go out of scope.
>It doesn't matter how much sound data I put in before I start the stream, I still get this dropout right after the audio starts.
>If it's a bug, which I think it is, can you fix it, like, right away? =) (I'm taking advantage of you, you are very good about this stuff.)

Adding some info: I think when your function has no buffers, it drops not the first but the second. If I fill up a stream while its' going and I get ahead maybe 3-4 seconds, and then stop the stream, destroy it, and create a new stream, fill it once and start it, it doesn't do it - it's like it still has the buffers from last time, or is just "primed". The new streams doesn't play the old buffers though.

But if I stop a stream and wait a bit, then start a new stream, it does it again.

The above information may not be exact, but since my test project does the same thing, I think it's a bug on your side. I have a feeling it's only cropped up with 12.1pr3.

Garth Hjelte
Sampler User

_______________________________________________
Mbsplugins_monkeybreadsoftware.info mailing list
<email address removed>
https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info

[MBS] PortAudio bug?
Date: 24.04.12 05:09 (Mon, 23 Apr 2012 23:09:30 -0500)
From: Garth Hjelte
Has there been any bug work on the PortAudio stuff since v12.1pr3? I didn't see any.

That's what I'm using.

Try this: www.chickensys.com/bin/pa_test.zip

When I use PortAudio on Mac, I get like the 2nd second of audio as silence, it drops out. This happens with all sounds.

Look at the function TestSound() in my test project. You'll have to change the location of the test.wav I supplied, and the OutputParameters.Device parameter.

test.wav is a good file, no doubt.

It just loads up some seconds of audio (AddAudio()) and then starts the stream, then loads more seconds of audio, and then sits there so the stream does go out of scope.

It doesn't matter how much sound data I put in before I start the stream, I still get this dropout right after the audio starts.

If it's a bug, which I think it is, can you fix it, like, right away? =) (I'm taking advantage of you, you are very good about this stuff.)

Garth Hjelte
Sampler User

_______________________________________________
Mbsplugins_monkeybreadsoftware.info mailing list
<email address removed>
https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info