pkgsrc-WIP-discuss archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

suggested patch to wip/portaudio



I have looked at the todo file in portaudio that says that the build
fails because ESTRPIPE is undeclared.
patch-av in the audio/alsa-lib package defines the linux specific
errorcode [1] ESTRPIPE as EPIPE in pcm_local.h
So adding

#ifndef ESTRPIPE
#define ESTRPIPE EPIPE
#endif

to src/hostapi/alsa/pa_linux-alsa.c under the header section
builds(not runs) portaudio with the alsa option without error on
netbsd. 

I however see a problem with the way that alsa-lib treats ESTRPIPE on
platforms that doesn't have it defined. According to the alsa pcm
docs [2], the library returns EPIPE under a different condition
than ESTRPIPE but pkgsrc alsa-lib returns EPIPE in both conditions on
systems without ESTRPIPE, I guess this could led to problems. 

example 

error = alsa_pcm_func(..);

if (error == EPIPE) {
        do this;
} 
else if (error == ESTRPIPE) {
        do that;
}

since pkgsrc alsa-lib defines ESTRPIPE and EPIPE as the same thing on
systems with an errno.h without ESTRPIPE "do this" will always be
executed and the ESTRPIPE error is never taken care of.
Maybe this should go into a send-pr.

I hope this could be of use to the maintainer of wip/portaudio and
others.

Niclas Rosenvik

[1] http://linux.die.net/man/3/errno
[2] http://www.alsa-project.org/alsa-doc/alsa-lib/pcm.html#pcm_errors

------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk
_______________________________________________
pkgsrc-wip-discuss mailing list
pkgsrc-wip-discuss%lists.sourceforge.net@localhost
https://lists.sourceforge.net/lists/listinfo/pkgsrc-wip-discuss


Home | Main Index | Thread Index | Old Index