Takashi Iwai [Wed, 15 Oct 2008 10:18:23 +0000 (12:18 +0200)]
pulse - Fix capture problem
In pulse_start(), pa_stream_trigger() may return NULL for the capture
stream, and this caused -EIO error.
Allow now pa_stream_trigger() returning NULL.
pulse - Start PA event loop after we have created the context
We shouldn't be passing the main loop object to the pa_context while
that loop is running and not locked. Push the main loop startup after we
created the main loop.
Remove our own poll handler implementation entirely
Neither pcm_pulse.c nor ctl_pulse.c is using our poll handler implementation
anymore, so let's get rid of the common parts previously used by them, too
Use PA_STREAM_EARLY_REQUESTS if PA knows it. PA >= 0.9.12 learned this flag
which will make the buffering more similar to traditional fragment/period-based
scheduling. Instead of delaying buffer fillup until the latest moment possible
this will cause fillups much earlier.
This is useful for compatibility for broken ALSA clients that don't care about
'readability' of the ALSA fd but instead schedule audio via usleep() or a
similar call. (One exampler being mplayer)
Make sure the pa_context is disconnected when we unref it. This is also done
implicitly when the last reference to the pa_context is dropped, but that might
be later then expected in case someone else took a reference on our object. To
make sure that the pa_context will than not make any call into our code,
disconnect it explicitly.
Since quite a while (2 years or so) PulsAudio doesn't require SIGPIPE anymore
to be set to SIG_IGN. Since resetting this was incredibly ugly in the first
place it is now time to get rid of this.
The PulseAudio plugin was horrible mix-up of different indenting styles even in
the same files. Indenting by 4, by 2, by 8 characters, sometimes with tabs,
sometimes with spaces. To fix this chaos I ran all files through "indent -kr
-i8". Hopefully future patches will follow kernel style indenting too.
Takashi Iwai [Tue, 26 Aug 2008 15:06:43 +0000 (17:06 +0200)]
Fix build with recent ffmpeg
Add a check of pkgconfig libavcodec in configure script.
Since the header file was moved to <libavcodec/*>, its location has
to be checked in configure, too.
When playing very short streams, the pulse plugin needs call
pa_stream_trigger() in snd_pcm_start() to make sure the stream is
actually started, in addition to uncorking the stream.
Some sanity checks in pcm_pulse.c with assert() causes the program to
abort unexpectedly when the pulseaudio daemon is dead. This is
suboptimal. Examples:
https://bugzilla.novell.com/show_bug.cgi?id=409532
Sjoerd Simons [Tue, 13 May 2008 12:16:06 +0000 (14:16 +0200)]
pulse - Change to hook load_if_running
Unfortunately some more testing revealed some issues with it,
specifically if pulse is running your complete config is replaced the bits in
the on_pulse_is_running directive. Which might not be what one actually wants :)
I couldn't find a proper solution for this. So i've changed the code to
optionally load config files. Just like the load hook does. Actually i just
optionally call the snd_config_hook_load function, but that's not actually in
the alsa API....
Also it now decides pulse is running as soon as the authorizing step begins
(just after the actually connection is setup), which should save some
round-trips and overhead.
The attached patch extends the alsa pulse plugin set with a alsa
configuration hook. Allowing one to specify some configuration parameters
that only come into effect when pulseaudio is running.
For example a configution file like:
@hooks [ {
func on_pulse_is_running
pcm.!default { type pulse }
ctl.!default { type pulse }
}
]
will redirect the default alsa pcm and ctl to pulse iff pulse is running.
(Assuming you defined the hook function correctly ofcourse)
This is usefull for distributions that don't want to force their users to
switch completely to pulseaudio, but have things a bit more dynamic :)
The solutions isn't optimal though. It will mean that every program loading
accessing alsa will try to make an (extra) connection to pulse to decide what
to do. But i think it's the best we can do for now (or at least that i can do
with my minimal knowledge of alsa).
A nicer solution would be a way to always specify the pulse plugin as default
and have a sort of fallback for when that fails.
The Maemo DSP plugin checks for D-Bus in configure.in and then makes a bold assumption that this means it should use a proprietary resource manager available only on a specific proprietary platform.
Attaching a patch to add --enable-maemo-resource-manager configure flag that enables the resource manager if set and if D-Bus is present.
Ignore hint sections defined by hand.
Those are heplful to get listed in various places, such as aplay -L
ALSA bug#3834:
https://bugtrack.alsa-project.org/alsa-bug/view.php?id=3834
Takashi Iwai [Fri, 14 Dec 2007 14:25:46 +0000 (15:25 +0100)]
PulseAudio plugin: report XRUN state back to application
From: Lennart Poettering <mznyfn@0pointer.de>
It adds support to report back XRUN to the application if one
happens. This is required to make some applications work on top of the
pulse plugin. One being XMMS, which checks if a song finished to play
by waiting for an XRUN (yes, I don't argue that XMMS shouldn't do
that, but nonetheless it is a good thing if XRUNs are reported
properly.)
Takashi Iwai [Mon, 26 Nov 2007 10:02:24 +0000 (11:02 +0100)]
Use different buffer metrics in the PulseAudio plugin
It increases the "pre-buffering level" (i.e. start threshold) to the
full buffer size minus one period. This makes PA work a little bit
more like normal audio devices, and makes a few drop outs go away for
software which uses very small period sizes.
It also increases the initial maximum buffer size, which allows a
small overcommit. That's not really an issue, but cleaner nonetheless
so I smuggled it into this patch.
Also reported in the ALSA BTS:
https://bugtrack.alsa-project.org/alsa-bug/view.php?id=3578
Takashi Iwai [Mon, 29 Oct 2007 10:07:01 +0000 (11:07 +0100)]
Fix unexpected assert with pulse plugin
This patch fixes the unexpected assert call at calling snd_pcm_hw_params
in PREPARED state. Since multiple hw_params calls are allowed, the pulse
plugin shouldn't call assert.
Takashi Iwai [Thu, 24 May 2007 13:28:22 +0000 (15:28 +0200)]
Enable link with external libspeex
- Add --with-speex configure option to specify the build of speex rate
plugin. As default, it's linked to external library. If not available,
defaults to builtin code.
- Show build conditions at the end of configure script
- Use AS_HELP_TEXT()
I'm attaching an updated version of my resampler plugin. It fixes a few
minor issues and it adds support for fixed-point processing (just add
-DFIXED_POINT to the build). Let me know if there's any problem.
Pierre Ossman [Wed, 7 Mar 2007 14:52:05 +0000 (15:52 +0100)]
Improve parameter constraints in alsa-pulse
Remove parameter constraints where we actually have none. Also, restrict
total buffer size to 4 MB as current versions of the PulseAudio server
will refuse streams larger than that.
Takashi Iwai [Tue, 20 Feb 2007 11:43:58 +0000 (12:43 +0100)]
Add livavcodec resampler plugin
Add a new pcm_rate plugin, "lavcrate", that uses the resampling
filter from libavcodec. It should provide high performance and
good output quality.
Add a documentation file for lavcrate.
Update autoconf and automake to build lavcrate.