Spencer Russell | 28 Jan 19:16 2015

Xrun error messages in ALSA

In pa_linux_alsa.c, in the PaAlsaStream_HandleXrun function, it calls
alsa_snd_pcm_recover with the third argument 0. That argument controls
whether or not that ALSA function prints out an error reason on an Xrun,
and a value of 0 enables the error (the parameter is "silent").

What would you think about either setting that to 1 and silencing the
error on STDERR, or making it configurable? It seems like in general
libraries shouldn't be printing directly to STDERR and should instead
bubble up error to the application via the error callback, right?

Because my library is used from a REPL or from a web-based notebook that
automatically displays STDOUT and STDERR to the user, those messages end
up adding noise to the display.

Thanks,
Spencer
Dorian Cazau | 27 Jan 12:00 2015
Picon

Compilation problem with portaudio

<!-- .hmmessage P { margin:0px; padding:0px } body.hmmessage { font-size: 12pt; font-family:Calibri } -->
Dear all, 

I am trying to compile the Playrec matlab Software (), but I get the following error message about linkers , I use Visual Studio 2010. I already checked that the file pa_win_coinitialize.c is in my folder \Playrec\lib\portaudio\src\os\win  ,so I do not really know what to do next ..



--> link /out:"playrec.mexw32" /debug /PDB:"playrec.mexw32.pdb" /dll /export:mexFunction /LIBPATH:"C:\Users\Asus\Desktop\R2014a\extern\lib\win32\microsoft" libmx.lib libmex.lib libmat.lib /MACHINE:X86 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /manifest /incremental:NO /implib:"C:\Users\Asus\AppData\Local\Temp\mex_9FrXUY\templib.x" /MAP:"playrec.mexw32.map" <at> C:\Users\Asus\AppData\Local\Temp\mex_9FrXUY\mex_tmp.rsp   
 
   Creating library C:\Users\Asus\AppData\Local\Temp\mex_9FrXUY\templib.x and object C:\Users\Asus\AppData\Local\Temp\mex_9FrXUY\templib.exp 
pa_asio.obj : error LNK2019: unresolved external symbol _PaWinUtil_CoUninitialize referenced in function __catch$_PaAsio_Initialize$3 
pa_asio.obj : error LNK2019: unresolved external symbol _PaWinUtil_CoInitialize referenced in function _PaAsio_Initialize 
pa_asio.obj : error LNK2019: unresolved external symbol _PaUtil_InitializeRingBuffer referenced in function "int __cdecl OpenStream(struct PaUtilHostApiRepresentation *,void * *,struct PaStreamParameters const *,struct PaStreamParameters const *,double,unsigned long,unsigned long,int (__cdecl*)(void const *,void *,unsigned long,struct PaStreamCallbackTimeInfo const *,unsigned long,void *),void *)" (?OpenStream <at> <at> YAHPAUPaUtilHostApiRepresentation <at> <at> PAPAXPBUPaStreamParameters <at> <at> 2NKKP6AHPBXPAXKPBUPaStreamCallbackTimeInfo <at> <at> K4 <at> Z4 <at> Z) 
pa_asio.obj : error LNK2019: unresolved external symbol _PaUtil_AdvanceRingBufferWriteIndex referenced in function "int __cdecl StartStream(void *)" (?StartStream <at> <at> YAHPAX <at> Z) 
pa_asio.obj : error LNK2019: unresolved external symbol _PaUtil_FlushRingBuffer referenced in function "int __cdecl StartStream(void *)" (?StartStream <at> <at> YAHPAX <at> Z) 
pa_asio.obj : error LNK2019: unresolved external symbol _PaUtil_AdvanceRingBufferReadIndex referenced in function "int __cdecl ReadStream(void *,void *,unsigned long)" (?ReadStream <at> <at> YAHPAX0K <at> Z) 
pa_asio.obj : error LNK2019: unresolved external symbol _PaUtil_GetRingBufferReadRegions referenced in function "int __cdecl ReadStream(void *,void *,unsigned long)" (?ReadStream <at> <at> YAHPAX0K <at> Z) 
pa_asio.obj : error LNK2019: unresolved external symbol _PaUtil_GetRingBufferReadAvailable referenced in function "int __cdecl ReadStream(void *,void *,unsigned long)" (?ReadStream <at> <at> YAHPAX0K <at> Z) 
pa_asio.obj : error LNK2019: unresolved external symbol _PaUtil_GetRingBufferWriteRegions referenced in function "int __cdecl WriteStream(void *,void const *,unsigned long)" (?WriteStream <at> <at> YAHPAXPBXK <at> Z) 
pa_asio.obj : error LNK2019: unresolved external symbol _PaUtil_GetRingBufferWriteAvailable referenced in function "int __cdecl WriteStream(void *,void const *,unsigned long)" (?WriteStream <at> <at> YAHPAXPBXK <at> Z) 
pa_asio.obj : error LNK2019: unresolved external symbol _PaUtil_WriteRingBuffer referenced in function "int __cdecl BlockingIoPaCallback(void const *,void *,unsigned long,struct PaStreamCallbackTimeInfo const *,unsigned long,void *)" (?BlockingIoPaCallback <at> <at> YAHPBXPAXKPBUPaStreamCallbackTimeInfo <at> <at> K1 <at> Z) 
pa_asio.obj : error LNK2019: unresolved external symbol _PaUtil_ReadRingBuffer referenced in function "int __cdecl BlockingIoPaCallback(void const *,void *,unsigned long,struct PaStreamCallbackTimeInfo const *,unsigned long,void *)" (?BlockingIoPaCallback <at> <at> YAHPBXPAXKPBUPaStreamCallbackTimeInfo <at> <at> K1 <at> Z) 
playrec.mexw32 : fatal error LNK1120: 12 unresolved externals 
 
  C:\USERS\ASUS\DESKTOP\R2014A\BIN\MEX.PL: Error: Link of 'playrec.mexw32' failed. 



If anyone could help me with that  , it would be great, 

thank you very much
Dorian
_______________________________________________
Portaudio mailing list
Portaudio <at> music.columbia.edu
http://music.columbia.edu/mailman/listinfo/portaudio
Alan Horstmann | 23 Jan 21:25 2015
Picon

Re: Portaudio Linux, recent developments

Hi Owen,

[cc the Portaudio list, for wider interest, OK?]

On Friday 23 January 2015 18:53, Owen Williams wrote:
> Thanks for coming back to this issue.  I recently purchased an Audio10,
> and the drivers no longer use sub devices so luckily the problem is not
> universal.  (It looks like the Audio2 is affected though:
> https://bugs.launchpad.net/mixxx/+bug/1076948)
>
> I will try out the branch on my audio4dj and see if it works properly.
> I would like to be able to give NI hardware my full recommendation for
> Mixxx since they have shown a commitment to open drivers, and fixing
> this problem would make that a lot easier.

The experimental Alsa branch has the *capability* to resolve the issues, but 
to do so will require a Audio4DJ specific entry.  I was planning to ask if 
someone had one - if you can post the output of
  ' aplay -l '
then I should be able to create an entry and give a one-line patch to add that 
to the pre-defines list.  What the Audio4DJ needs is
  a) sub-device listing
  b) use plughw device to adapt the data endianness.

The Audio2 oddly looks like it presents as 2 mono sub-devices?  And possibly 
also big-endian.  So a similar entry would be needed.  From that Mixxx bug 
report, the card name is 'TraktorAudio2'?

I should say, though, that if it is 2 mono sub-devices, there would be a good 
case for the Alsa card conf to include a multi plugin to combine them in the 
Alsa-lib layer to a single stereo device.  Probably that also applies to 
making the Audio4DJ have a single 4-ch device available?

It would be great to get your reaction to the rather different presentation of 
devices in the branch Alsa code!

Regards

Alan
encore1 | 21 Jan 23:39 2015
Picon
Picon

Assembler Error When Compiling pa_converter.c

When running the sequence configure, make clean and make the assembler 
reports the following:

libtool: compile:  gcc -c -g -O2 -DPA_LITTLE_ENDIAN -I./include 
-I./src/common -I./src/os/win -DPA_U
SE_WMME=0 -DPA_USE_ASIO=0 -DPA_USE_WDMKS=0 -DPA_USE_DS=0 
-DPA_USE_WASAPI=0 -UPA_USE_WMME -DPA_USE_WM
ME=1 -mthreads -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" 
-DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"
\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DSTDC_HEADERS=1 
-DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT
_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 
-DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -D
HAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DLT_OBJDIR=\".libs/\" 
-DSIZEOF_SHORT=2 -DSIZEOF_INT=4 -DSIZEOF_LO
NG=4 src/common/pa_converters.c  -DDLL_EXPORT -DPIC -o 
src/common/.libs/pa_converters.o
C:\Users\dick\AppData\Local\Temp\ccL6kwYo.s: Assembler messages:
C:\Users\dick\AppData\Local\Temp\ccL6kwYo.s:1206: Error: expecting 
string instruction after `rep'
C:\Users\dick\AppData\Local\Temp\ccL6kwYo.s:1418: Error: expecting 
string instruction after `rep'
C:\Users\dick\AppData\Local\Temp\ccL6kwYo.s:1828: Error: expecting 
string instruction after `rep'
C:\Users\dick\AppData\Local\Temp\ccL6kwYo.s:2125: Error: expecting 
string instruction after `rep'
C:\Users\dick\AppData\Local\Temp\ccL6kwYo.s:2204: Error: expecting 
string instruction after `rep'
C:\Users\dick\AppData\Local\Temp\ccL6kwYo.s:4925: Error: expecting 
string instruction after `rep'
make: *** [src/common/pa_converters.lo] Error 1

I am running Windows 7, MinGW/Msys, gcc 4.8.1, m4 version 1.4.14 and 
PortAudio release v19 dated 20140130. I ran configure (which finished 
with no errors) and make with no parameters.

I'm at a loss for how to proceed. Thanks in advance for your help!
__________________________
Dick Holmes
Ross Bencina | 21 Jan 06:49 2015

ksguid.lib fix/change

Hi Everyone,

Following recent complaints about the ksguid.lib dependency in MSVC 
builds of PortAudio, I have removed the dependency.

The change should only affect MSVC builds (not GCC, which had no ksguid 
dependency).

The change, rev 2944 is here:

https://www.assembla.com/code/portaudio/subversion/commit/1944

"Removed MSVC dependence on ksguid.lib from 
src/os/win/pa_win_wdmks_utils.c (ksguid.lib is no longer in Platform SDK 
8.0). Always use static instances of GUIDs like the GCC builds do. 
Removed ksguid.lib from MSVC project file. The following symbols are no 
longer used: PA_WDMKS_NO_KSGUID_LIB, PAWIN_WDMKS_NO_KSGUID_LIB; removed 
them from CMakeLists.txt and the MSVC project file."

The related ticket is here:

https://www.assembla.com/spaces/portaudio/support/tickets/228

Notes about the change:

- With regard to pa_win_wdmks_utils.c this change has the same effect as 
if PA_WDMKS_NO_KSGUID_LIB was always defined.

- Change should only impact MSVC builds, as GCC never used ksguid.lib

- Change is mostly relevant to src/os/win/pa_win_wdmks_utils.c

- Since wdmks.lib was removed form the MSVC project file, it's possible 
that hostapi/wdmks and hostapi/wasapi may be negatively affected. 
However no issue was observed here with MSVC2005/SDK7.1A nor MSVC2013

- I chose not to alter the wasapi nor wdmks host api implementations. As 
far as I can tell they don't actually need ksguid.lib with recent 
platform SDKs. If someone finds that the change doesn't work with an 
older platform SDK please advise and we'll fix it.

If this change might affect you please test SVN trunk, or a nightly 
snapshot in a day or two.

Thanks,

Ross.
robert.bielik | 20 Jan 19:57 2015
Picon

Re : Bad sound quality

I use PA in a recording application using ASIO, WDMKS and CoreAudio and I have never experienced problems like these, must be something you do in the callback.

 

Regards 

/Rob

------ Ursprungligt meddelande------

Från: Bjorn Roche

Datum: tis, 20 jan 2015 19:37

Till: Portaudio Mailing List;

Ämne:Re: [Portaudio] Bad sound quality

 

I don't know much about windows, but your symptoms sound like you are doing something very wrong in the callback. I suggest you post your callback function and maybe someone will be able to provide more help.

Another thing to try is simply generating tones in the callback with your current settings. If that works, you know it's probably not PA causing your problems. If it doesn't work, you've got a great SSCCE for us to look at.

bjorn

On Tue, Jan 20, 2015 at 1:29 PM, Jan Ekholm <jan.ekholm <at> d-pointer.com> wrote:

> On 20 jan 2015, at 17:07, Jan Ekholm <jan.ekholm <at> d-pointer.com> wrote:
>
>
> Hi,
>
> I'm using Portaudio for a small conferencing application and it's worked quite well so far. There are
> a few issues however and I have no idea where to start looking.

...

I tried the newest snapshot now and the issue still persists. It's actually even worse now. The captured audio
has the same "burrrr" and general distorsion (sounds a bit like clipping) as well as a very robot like metallic
tone.

When I scan for devices I find only 6 of them in total:

2 for paInDevelopment
4 for paDirectSound

The DS devices are the capture and output device, but twice with different names:

    0: Input Primary Sound Capture Driver
    1: Input Microphone (Parallels Audio Controller)
    2: Output Primary Sound Driver
    3: Output Speakers (Parallels Audio Controller)

I expected there to be some devices for the other API:s too, as I now enabled all API:s except ASIO. I don't
have any ASIO drivers. I expected to find some paMME, paWDMKS or paWASAPI devices, but perhaps I
simply do it all wrong somehow?

I'm not actually sure if the capture quality was ever ok, I did not have much time to test it when I integrated in
last summer. The output has always been flawless and I was mostly testing with audio from RTP or a tone
generator, so the quality may always have been awful.

I need to find a solution here or I'll have to ditch PA and go with something else or revert to my old
wave API code (ugh). I can also provide some funding in case someone wants to help me out a bit.

--
Jan Ekholm
jan.ekholm <at> d-pointer.com



_______________________________________________
Portaudio mailing list
Portaudio <at> music.columbia.edu
http://music.columbia.edu/mailman/listinfo/portaudio



--
---------------------
Bjorn Roche
<at> xonamiaudio
_______________________________________________
Portaudio mailing list
Portaudio <at> music.columbia.edu
http://music.columbia.edu/mailman/listinfo/portaudio
Jan Ekholm | 20 Jan 16:07 2015

Bad sound quality


Hi,

I'm using Portaudio for a small conferencing application and it's worked quite well so far. There are
a few issues however and I have no idea where to start looking.

I use the DirectSound API on a Windows 7 machine and have compiled PA with these options:

PA_ENABLE_DEBUG_OUTPUT
PAWIN_USE_WDMKS_DEVICE_INFO
PA_USE_ASIO=0
PA_USE_DS=1
PA_USE_WMME=0
PA_USE_WASAPI=1
PA_USE_WDMKS=0
PA_WDMKS_NO_KSGUID_LIB=1

Wasapi does not work at all and every time I try to open a device I get "Invalid stream pointer" and that's it. 
I have no idea what WDMKS is. MME I guess is the old wave API? I used that before switching to
PA and it worked ok, but it was annoying to do correctly. ASIO I guess requires custom drivers and that
is not an option in my case. I had counted on Wasapi to work as latency is quite important for me.

Anyway, the DirectSound API works and I can capture audio and do what I need with it (such as stream over RTP).
The issue here is that the audio quality is awful. Speech is recognizable, but everything is a bit distorted
as if overlaid
with a "burrrrr" sound. If I play sound from a tone generator in my application to the speakers the sound
quality is fine,
only capturing with PA gives the distorted sound. 

The parameters I use for opening the input stream are:

    PaStreamParameters inputParameters;
    inputParameters.channelCount     = 1;
    inputParameters.device           = m_systemId;
    inputParameters.sampleFormat     = paInt16;
    inputParameters.suggestedLatency = Pa_GetDeviceInfo( m_systemId )->defaultLowInputLatency;

The m_systemId is a previously scanned PA device id. The real stream is opened with:

    error = Pa_OpenStream( &m_stream,
                           &inputParameters,
                           NULL,
                           8000,
                           s_rtpBufferSize,
                           paNoFlag, //flags that can be used to define dither, clip settings and more
                           AudioInputDevicePortAudio::audioCallback, // callback
                           this ); // pass ourselves as the user data

I thus do 16 bit, 8kHz audio. With the WAVE API that combination was fine, perhaps PA does not handle it
as well? Changing the sample rate is a big thing for me, so I will not do it unless strictly necessary.

The output from PA when I open the devices (one input and one output) is below:

before paHostApiInitializers[0].
PA - PlatformId = 0x2
PA - MajorVersion = 0x6
PA - MinorVersion = 0x1
PA - PlatformId = 0x2
PA - MajorVersion = 0x6
PA - MinorVersion = 0x1
PA - PlatformId = 0x2
PA - MajorVersion = 0x6
PA - MinorVersion = 0x1
PA - PlatformId = 0x2
PA - MajorVersion = 0x6
PA - MinorVersion = 0x1
after paHostApiInitializers[0].
before paHostApiInitializers[1].
WASAPI: device idx: 00
WASAPI: ---------------
WASAPI:0| name[Speakers (Parallels Audio Controller)]
WASAPI:0| form-factor[1]
WASAPI:0| def.SR[44100] max.CH[2] latency{hi[0.010000] lo[0.003000]}
WASAPI: device idx: 01
WASAPI: ---------------
WASAPI:1| name[Microphone (Parallels Audio Controller)]
WASAPI:1| form-factor[4]
WASAPI:1| def.SR[44100] max.CH[2] latency{hi[0.010000] lo[0.003000]}
WASAPI: initialized ok
after paHostApiInitializers[1].
DirectSound host buffer size frames: 1120, polling period seconds: 0.007500,  <at>  sr: 8000.000000
InitInputBuffer() returns 0
StartStream: DSW_StartInput returned = 0x0.
DirectSound host buffer size frames: 1120, polling period seconds: 0.007500,  <at>  sr: 8000.000000
InitOutputBuffer() returns 0
PaHost_ClearOutputBuffer: IDirectSoundBuffer_SetCurrentPosition returned = 0x0.
PaHost_StartOutput: IDirectSoundBuffer_Play returned = 0x0.

I currently use pa_stable_v19_20140130.tgz, but I will try the nightly build later today to see if there's any
change. I also use Parallels in the test above, but running on different real Windows 7 PC:s gives the same
result.

Any suggestions as to what could be causing my distorted microphone audio?

--

-- 
Jan Ekholm
jan.ekholm <at> d-pointer.com
Bastian Bechtold | 19 Jan 15:16 2015
Picon

Bug: Portaudio crashes for soundcards with non-power-of-two channels

I am using a sound card Focusrite Scarlett 6i6, which has 6 inputs and 6 
outputs.

Whenever I open a portaudio stream, it crashes with

     Assertion failed: (!err), function initializeBlioRingBuffers, file 
src/hostapi/coreaudio/pa_mac_core_blocking.c, line 191

That particular line is asserting that the return value of

     PaUtil_InitializeRingBuffer(..., 
ringBufferSize*blio->outputSampleSizePow2*outChan, ...)

should be zero. The documentation of `PaUtil_InitializeRingBuffer` 
states that it will return zero if the `elementCount` (the shown 
argument) is a power of 2.

But that obviously depends on the value of `outChan`! Thus, this 
assertion will always fail if `outChan` is not a power of two. By 
default, `outChan` will be the number of channels of your sound card.

I can prevent this by passing a power-of-two number of channels to 
`Pa_OpenStream`'s `outputParameters.channelCount`.

This should be fixed, or at least be mentioned in the documentation for 
`Pa_OpenStream`. Also, portaudio should return a meaningful error code 
and not just an assertion failure.

Kind regards,
Bastian
keghn | 19 Jan 02:24 2015
Picon

Extracting audio from a video



Hello, Can portaudio extract audio from a video?
_______________________________________________
Portaudio mailing list
Portaudio <at> music.columbia.edu
http://music.columbia.edu/mailman/listinfo/portaudio
Scott Whitney | 15 Jan 19:39 2015

ksguid.lib and PortAudio x64 builds?

Hello Ross, Luke, and group,

Has there been any progress on a resolution for building PortAudio without ksguid.lib?  It appears to prevent building x64 versions of the PortAudio DLL.  I am currently trying to build using Visual Studio 2013 Community Edition.  It works fine for Win32 builds if I point to SDK 7.1.

Thanks,

Scott

[Portaudio] ksguid.lib

Luke Drummond lukedrummond at gmail.com 
Mon Dec 29 23:01:26 EST 2014

Hi Ross

 

It seems the ksuid.lib was last included in SDK 7.1

It is on my system, but for my installation of VS2010, not 2012.

 

I'll keep an eye on that ticket.  Let me know if you need testing.

 

Best

 

Luke

 

On 30 December 2014 at 03:34, Ross Bencina <rossb-lists at audiomulch.com> wrote:

> I've also created a ticket here:

>

 

> https://www.assembla.com/spaces/portaudio/tickets/228-ksguid-lib-linker-issues

>

 

> _______________________________________________

> Portaudio mailing list

> Portaudio at music.columbia.edu

> http://music.columbia.edu/mailman/listinfo/portaudio

 

 

_______________________________________________
Portaudio mailing list
Portaudio <at> music.columbia.edu
http://music.columbia.edu/mailman/listinfo/portaudio
Scott Whitney | 12 Jan 17:09 2015

ASIO errors with CMake using Visual Studio 2013

Hi folks,

 

I’m trying to use CMake to generate the solution and project files to build with Visual Studio 2013.  I have ASIOSDK2 in the hostapi\asio directory per the build instructions.  For “Where is the source code:”, I entered C:\Sandbox\PortAudio_VS2013\portaudio, and “Where to build the binaries:”, I entered C:/Sandbox/PortAudio-output.  When I select “Configure”, for “Specify the generator for this project” as “Visual Studio 12 2013” and select Finish.

 

In the red list of options, I selected PA_USE_ASIO, then clicked Configure again.  I get error messages:

 

Could NOT find ASIOSDK (missing: ASIOSDK_ROOT_DIR ASIOSDK_INCLUDE_DIR)

Configuring done

 

Where should ASIOSDK_ROOT_DIR and ASIOSDK_INCLUDE_DIR be specified to get this configuration to create successfully?  I get the same results if I select “Visual Studio 12 2013 Win64”.

 

Note that I had installed ASIOSDK2 under src/hostapi/asio/ as instructed by the tutorial.

 

Thanks,

 

Scott

 

 

_______________________________________________
Portaudio mailing list
Portaudio <at> music.columbia.edu
http://music.columbia.edu/mailman/listinfo/portaudio

Gmane