ans-ashkan / portaudiosharp Goto Github PK
View Code? Open in Web Editor NEWAutomatically exported from code.google.com/p/portaudiosharp
Automatically exported from code.google.com/p/portaudiosharp
What steps will reproduce the problem:
- Compile & Debug the PortAudioSharpTest project
Vista SP1
Visual Studio 9
Port Audio V19 posted December 7, 2007
Original issue reported on code.google.com by [email protected]
on 5 Aug 2009 at 9:03
First of I don't know much about audio, or audio drivers on Linux...
But in the Audio class you favor paOSS instead of ALSA... Doesn't everybody
use ALSA these days and isn't OSS just left there for backwards
compatibility...
I noticed it because you get an exception if you try to play audio using
OSS while playing something else, e.g. background music:
System.ArgumentNullException: Argument cannot be null.
Parameter name: src
at (wrapper managed-to-native)
System.Runtime.InteropServices.Marshal:PtrToStructure (intptr,System.Type)
at PortAudioSharp.PortAudio.Pa_GetDeviceInfo (Int32 device) [0x00000]
at PortAudioSharp.Audio..ctor (Int32 channels, Int32 frequency, UInt32
framesPerBuffer, PortAudioSharp.PaStreamCallbackDelegate paStreamCallback)
[0x00000]
at PortAudioSharpTest.PortAudioTest.Run () [0x00000]
Also using ALSA doesn't work... Probably because I'm doing something wrong
I just tried to change the PortAudio.PaHostApiTypeId.paOSS to
PortAudio.PaHostApiTypeId.paALSA in the following:
private int apiSelect() {
int selectedHostApi = PortAudio.Pa_GetDefaultHostApi();
int apiCount = PortAudio.Pa_GetHostApiCount();
for (int i = 0; i<apiCount; i++) {
PortAudio.PaHostApiInfo apiInfo = PortAudio.Pa_GetHostApiInfo(i);
if ((apiInfo.type == PortAudio.PaHostApiTypeId.paDirectSound)
|| (apiInfo.type == PortAudio.PaHostApiTypeId.paOSS))
selectedHostApi = i;
}
return selectedHostApi;
}
Don't know why I didn't get ALSA working, but shouldn't ALSA be preferred
over OSS in the Audio class ?
Just for the record:
portaudiosharp-0.19.2.zip
with Mono 1.9.1 on Ubuntu 8.10
I had two versions of PortAudio don't know to which the libportaudio was
resolved :)
/usr/lib/libportaudio.so.2 (0.19, tried hardcoding it to this thought, in
the dllmap)
/usr/lib/libportaudio.so.0 (0.18)
Please provide any additional information below.
Absolutely nice library... I was amazed that it was so easy to compile and
use...
I've always feared having mixin unmanaged code, as I thought it would make
distribution and compilation much more complicated...
Original issue reported on code.google.com by [email protected]
on 17 Jan 2009 at 8:15
Attachments:
What steps will reproduce the problem?
1. Connect Asio RME
2. Call function PortAudio.Pa_GetHostApiInfo(i) with count available
3. No device detected related to Asio
What is the expected output? What do you see instead?
I do not see Asio device detected, with win7 32 it was working.
Original issue reported on code.google.com by [email protected]
on 18 Jul 2014 at 9:22
What steps will reproduce the problem?
1. compile portaudio with asio as indicated in
http://portaudio.com/docs/v19-doxydocs/compile_windows.html
* extract portaudio archive
* extract asio sdk into asio hostapi subfolder and rename src\hostapi\asio\ASIOSDK2 (asio sdk archive) to src\hostapi\asio\ASIOSDK
* open msvc solution found in build\msvc and set switches for all platforms as indicated in URL above. leaving the structure aligning to default
2. "compile" or assemble portaudiosharp
3. place portaudio_x64.dll, renamed to portaudio.dll in
\PortAudioSharpTest\bin\Debug
What is the expected output? What do you see instead?
I don't know what to expect, certainly not the error below.
What version of the product are you using? On what operating system?
windows 7 64bit
Please provide any additional information below.
I changed the code just a little bit to show the pointer types, so that the
errorCheck("OpenDefaultStream", PortAudio.Pa_OpenStream( ... )) call appears in
line 150.
PortAudioSharpTest.exe
PortAudioSharp Test
*******************
PortAudioSharpTest version: 0.1.4419.2504
PortAudioSharp version: 0.19.3.2504
PortAudio version: PortAudio V19-devel (built Feb 6 2012 01:33:54) (1899)
PortAudio: Initializing...
before paHostApiInitializers[0].
after paHostApiInitializers[0].
before paHostApiInitializers[1].
ASIO names[0]:Audio 8 DJ
after paHostApiInitializers[1].
before paHostApiInitializers[2].
WASAPI: device idx: 00
WASAPI: ---------------
WASAPI:0| name[Speakers (SoundMAX Integrated Digital HD Audio)]
WASAPI:0| form-factor[1]
WASAPI:0| def.SR[48000] max.CH[2] latency{hi[0.010000] lo[0.003000]}
WASAPI: device idx: 01
WASAPI: ---------------
WASAPI:1| name[SPDIF Interface (SoundMAX Integrated Digital HD Audio)]
WASAPI:1| form-factor[8]
WASAPI:1| def.SR[44100] max.CH[2] latency{hi[0.010159] lo[0.003000]}
WASAPI: device idx: 02
WASAPI: ---------------
WASAPI:2| name[Microphone (SoundMAX Integrated Digital HD Audio)]
WASAPI:2| form-factor[4]
WASAPI:2| def.SR[48000] max.CH[2] latency{hi[0.010000] lo[0.003000]}
WASAPI: initialized ok
after paHostApiInitializers[2].
before paHostApiInitializers[3].
Setup called
Enum called
noError = 0
Enum called
noError = 1
Device 1 has render alias
Enum called
noError = 0
Enum called
noError = 0
Device 3 has capture alias
Enum called
noError = 0
Enum called
noError = 1
Device 5 has render alias
Enum called
Interfaces found: 3
Device 1 has render alias
Interface 1, Name: HD Audio digital out
Creating pin 0:
No standard streaming
Creating pin 1:
Not source/sink
Filter NOT created
Device 3 has capture alias
Interface 3, Name: SoundMAX HD Audio I
Creating pin 0:
No standard streaming
Creating pin 1:
Not source/sink
Filter NOT created
Device 5 has render alias
Interface 5, Name: SoundMAX HD Audio O
Creating pin 0:
No standard streaming
Creating pin 1:
Not source/sink
Filter NOT created
after paHostApiInitializers[3].
PortAudio: Initialize OK
PortAudio: available API index: 0
[PaHostApiInfo]
structVersion: 1
type: paMME
name: MME
deviceCount: 5
defaultInputDevice: 1
defaultOutputDevice: 3
PortAudio: available API index: 1
[PaHostApiInfo]
structVersion: 1
type: paASIO
name: ASIO
deviceCount: 0
defaultInputDevice: -1
defaultOutputDevice: -1
PortAudio: available API index: 2
[PaHostApiInfo]
structVersion: 1
type: paWASAPI
name: Windows WASAPI
deviceCount: 3
defaultInputDevice: 7
defaultOutputDevice: 5
PortAudio: available API index: 3
[PaHostApiInfo]
structVersion: 1
type: paWDMKS
name: Windows WDM-KS
deviceCount: 0
defaultInputDevice: -1
defaultOutputDevice: -1
PortAudio: selected Host API: 0
PortAudio: input device:
[PaDeviceInfo]
name:
hostApi: 2
maxInputChannels: 0
maxOutputChannels: 1889785610
defaultLowInputLatency: 0,09
defaultLowOutputLatency: 0,18
defaultHighInputLatency: 0,18
defaultHighOutputLatency: 44100
defaultSampleRate: 5,4535343634296E-312
PortAudio: output device:
[PaDeviceInfo]
name:
hostApi: 0
maxInputChannels: 2
maxOutputChannels: 1889785610
defaultLowInputLatency: 0,09
defaultLowOutputLatency: 0,18
defaultHighInputLatency: 0,18
defaultHighOutputLatency: 44100
defaultSampleRate: 5,4535343634296E-312
PortAudio: Starting...
PortAudio: data ptr = 0
stream ptr = 0
System.AccessViolationException: Attempted to read or write protected memory.
This is often an indication that other memory is corrupt.
at PortAudioSharp.PortAudio.Pa_OpenStream(IntPtr& stream, PaStreamParameters& inputParameters, PaStreamParameters& outputParameters, Double sampleR
ate, UInt32 framesPerBuffer, PaStreamFlags streamFlags,
PaStreamCallbackDelegate streamCallback, IntPtr userData)
at PortAudioSharp.Audio.streamOpen(Int32 inputDevice, Int32 inputChannels, Int32 outputDevice, Int32 outputChannels, Int32 sampleRate, UInt32 framesPerBuffer) in D:\Users\alex\Downloads\PortAudioSharp-src-0.19.3\PortAudioSharp-src-0.19.3\PortAudioSharp\src\PortAudioSharp\Audio.cs:line 150
at PortAudioSharp.Audio.Start() in D:\Users\alex\Downloads\PortAudioSharp-src-0.19.3\PortAudioSharp-src-0.19.3\PortAudioSharp\src\PortAudioSharp\Audio.cs:line 80
at PortAudioSharpTest.PortAudioTest.Run() in D:\Users\alex\Downloads\PortAudioSharp-src-0.19.3\PortAudioSharp-src-0.19.3\PortAudioSharpTest\src\PortAudioTest.cs:line 78
PortAudio: Terminating...
TerminateHostApis in
TerminateHostApis out
PortAudio: Terminate OK
Original issue reported on code.google.com by [email protected]
on 6 Feb 2012 at 11:16
What steps will reproduce the problem?
1. pError = PortAudio.Pa_SetStreamFinishedCallback(ref newStream,
StreamFinishedCallback);
2. private void StreamFinishedCallback(IntPtr userData){}
3. pError comes always paBadStreamPtr
What is the expected output? What do you see instead? paNoError
What version of the product are you using? On what operating system? V19
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 25 Sep 2014 at 7:19
What steps will reproduce the problem?
1. PortAudio.Pa_Initialize();
2. PortAudio.PaDeviceInfo paDeviceInfo = PortAudio.Pa_GetDeviceInfo(0);
What is the expected output? What do you see instead?
IntPtr structptr = IntPtr_Pa_GetDeviceInfo(device);
This line produces a PInvokeStackImbalance warning. From what I found on the
internet, it seems to occur when there's a mismatch between the parameters
passed through the stack.
What version of the product are you using? On what operating system?
Visual C# 2010 Express - .NET4 Client - Windows Seven
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 17 Oct 2011 at 7:00
What steps will reproduce the problem?
Can't call Pa_OpenStream() without input stream parameters or without output
stream parameters. Instead both values must be specified.
What is the expected output? What do you see instead?
You should be able to call Pa_OpenStream() without input or output stream
parameters. Passing null to both should be valid as well, but the PortAudio
library itself should return an error to you for that.
What version of the product are you using? On what operating system?
PortAudioSharp 0.19.3 on Windows, but issue applies to all platforms.
Please provide any additional information below.
See the attached patch file for my recommendation. I've already tested the
changes and everything works. In essence the patch changes PaStreamParameters
from a struct to a class and removes all several unnecessary ref attributes
from several parameters.
PS: The library is working pretty awesome so far other than the mentioned issue
above. I'm glad I didn't have to write a binding from scratch.
Original issue reported on code.google.com by [email protected]
on 5 Dec 2012 at 4:27
Attachments:
It would be nice to be able to use types other than float[] in WriteStream.
Thanks for making PortAudioSharp by the way. I am finding it very useful.
Original issue reported on code.google.com by [email protected]
on 30 Aug 2010 at 1:07
Hi,
I am trying to use projects from monodevelop 2.6 on ubuntu 11.10 and I get the
following message only with PortAudioSharp project :
not built in active configuration.
Original issue reported on code.google.com by [email protected]
on 6 Nov 2011 at 3:46
What steps will reproduce the problem?
1. Disable Sound card
2. Run sample
What is the expected output? What do you see instead?
Sound.
Stack trace.
What version of the product are you using? On what operating system?
19.3
Windows 7 64 bit
Please provide any additional information below.
Audio.CS: Line 74-ish
this.inputDeviceInfo = PortAudio.Pa_GetDeviceInfo(apiInfo.defaultInputDevice);
generates a null exception because apiInfo.defaultInputDevice is -1
I fixed this by doing the following.
1) Adding a new p/invoke Pa_OpenStream
[DllImport("PortAudio.dll")]
public static extern PaError Pa_OpenStream(
out IntPtr stream,
IntPtr inputParameters,
ref PaStreamParameters outputParameters,
double sampleRate,
uint framesPerBuffer,
PaStreamFlags streamFlags,
PaStreamCallbackDelegate streamCallback,
IntPtr userData);
2) Added a new overload to streamOpen, without the input device parameters
private IntPtr streamOpen(
int outputDevice, int outputChannels,
int sampleRate, uint framesPerBuffer)
{
IntPtr stream = new IntPtr();
IntPtr data = new IntPtr(0);
PortAudio.PaStreamParameters outputParams = new PortAudio.PaStreamParameters();
outputParams.channelCount = outputChannels;
outputParams.device = outputDevice;
outputParams.sampleFormat = PortAudio.PaSampleFormat.paFloat32;
outputParams.suggestedLatency = this.outputDeviceInfo.defaultLowOutputLatency;
errorCheck("OpenStream", PortAudio.Pa_OpenStream(
out stream,
IntPtr.Zero,
ref outputParams,
sampleRate,
framesPerBuffer,
PortAudio.PaStreamFlags.paNoFlag,
this.paStreamCallback,
data));
return stream;
}
Made the following changes to method 'start' in class audio.
public void Start() {
log("Starting...");
if (this.apiInfo.defaultInputDevice != -1)
{
this.stream = streamOpen(this.apiInfo.defaultInputDevice, this.inputChannels,
this.apiInfo.defaultOutputDevice, this.outputChannels,
this.frequency, this.framesPerBuffer);
}
else
{
this.stream = streamOpen(
this.apiInfo.defaultOutputDevice, this.outputChannels,
this.frequency, this.framesPerBuffer);
}
log("Stream pointer: " + stream.ToInt32());
streamStart(stream);
}
Now it no longer fails when no input device is detected.
Original issue reported on code.google.com by [email protected]
on 28 Jan 2012 at 4:42
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.