No description
Find a file
Antti-Ville Jansson 495c1ed236 core: Drop empty gaps in the memblockq when playing data from it.
It's possible that the memblockq of a sink input is rewound to a negative read
index if the sink input is moved between sinks shortly after its creation. When
this happens, pa_memblockq_peek() returns a memchunk whose 'memblock' field is
NULL and whose 'length' field indicates the length of the gap caused by the
negative read index. This will trigger an assert in play-memblockq.c.

If the memblockq had a silence memchunk, pa_memblockq_peek() would return
silence for the duration of the gap and the assert would be avoided. However,
this approach would prevent the sink input from being drained and is thus not
possible. Instead, we handle the aforementioned situation by dropping the gap
indicated by the 'length' field of the memchunk and by peeking the actual data
that comes after the gap.

This scenario seems to be quite rare in everyday use, but it causes a severe
bug in the handheld world. The assert can be triggered e.g. by loading two null
sinks, playing a sample from the cache to one of them and then moving the
created sink input between the two sinks. The rewinds done by the null sinks
seem to be quite long (I don't know if this is normal behaviour or something
fishy in module-null-sink).

See also:

    6bd34156b1
    virtual-sink: Fix a crash when moving the sink to a new master right after setup.

    https://tango.0pointer.de/pipermail/pulseaudio-discuss/2011-February/009105.html

Reproduce:

This problem can be reproduced with the following script:

SAMPLE_PATH="/usr/share/sounds/alsa/"
SAMPLE="Front_Left"

pactl remove-sample $SAMPLE 2> /dev/null
pactl upload-sample $SAMPLE_PATH$SAMPLE.wav

mod1=`pactl load-module module-null-sink sink_name=null1`
mod2=`pactl load-module module-null-sink sink_name=null2`

pactl play-sample $SAMPLE null1

input=`pactl list | grep "Sink Input #" | tail -n 1 | cut -d# -f2`

echo "Sample $SAMPLE playing as Sink Input #$input"

pactl move-sink-input $input null2
pactl move-sink-input $input null1

pactl unload-module $mod1
pactl unload-module $mod2
2011-04-28 14:05:42 +01:00
doxygen doxygen: add rtclock.h to documentation 2009-09-11 01:49:39 +02:00
m4 echo-cancel: orc-ify some bits for optimisation 2010-09-23 17:17:03 +05:30
man build: Use silent rules for generating files 2011-03-11 11:49:43 +00:00
po po: Remove files no longer in the tree (and which didn't have any translations anyway). 2011-03-24 22:25:05 +00:00
src core: Drop empty gaps in the memblockq when playing data from it. 2011-04-28 14:05:42 +01:00
vala vala: More vala fixes 2011-04-18 10:31:51 +02:00
.gitignore .gitignore: add .tarball-version 2011-03-29 21:15:02 +01:00
.mailmap add a .mailmap file for git shortlog 2009-02-04 22:41:45 +01:00
autogen.sh remove remaining $ 2008-06-18 22:38:32 +02:00
bootstrap.sh Solaris: bootstrap portability 2009-08-22 00:58:53 +02:00
configure.ac build-sys: Make -isysroot and -mmacosx-version-min configurable 2011-04-23 18:23:38 +01:00
git-version-gen build-sys: Include the .version file in the distribution tarball 2010-12-05 15:59:13 +00:00
GPL * rename "LICENSE" to "LGPL" 2006-04-20 12:33:00 +00:00
LGPL * rename "LICENSE" to "LGPL" 2006-04-20 12:33:00 +00:00
libpulse-browse.pc.in version: Drop the micro version number 2010-11-28 15:56:20 +00:00
libpulse-mainloop-glib.pc.in version: Drop the micro version number 2010-11-28 15:56:20 +00:00
libpulse-simple.pc.in version: Drop the micro version number 2010-11-28 15:56:20 +00:00
libpulse.pc.in version: Drop the micro version number 2010-11-28 15:56:20 +00:00
LICENSE echo-cancel: Add alternative echo-cancellation implementation 2010-09-07 15:12:12 +05:30
Makefile.am vala: Fix path error in the last commit. 2011-03-26 12:42:43 +00:00
orc.mak build: Simplify Orc-related make rules 2011-02-01 11:51:46 +05:30
PROTOCOL sink-input: Add volume_writable to pa_sink_input. 2011-03-29 21:18:06 +01:00
pulseaudio-text.svg merge 'lennart' branch back into trunk. 2007-10-28 19:13:50 +00:00
pulseaudio.svg Add PulseAudio logo to tree. 2006-08-28 06:25:41 +00:00
README Add a small README with the new git URLs and stuff 2008-06-18 00:34:14 +02:00
todo remove remaining $ 2008-06-18 22:38:32 +02:00

PULSEAUDIO SOUND SERVER

WEB SITE:
	http://pulseaudio.org/

GIT:
	git://git.0pointer.de/pulseaudio.git

GITWEB:
	http://git.0pointer.de/?p=pulseaudio.git;a=summary

MAILING LIST:
	https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss

GIT COMMITS MAILING LIST:
	https://tango.0pointer.de/mailman/listinfo/pulseaudio-commits

TRAC TICKET CHANGES MAILING LIST:
	https://tango.0pointer.de/mailman/listinfo/pulseaudio-tickets

IRC:
	#pulseaudio on irc.freenode.org

CIA:
	http://cia.navi.cx/stats/project/polypaudio

FRESHMEAT:
	http://freshmeat.net/projects/pulseaudio/

OHLOH:
	http://www.ohloh.net/projects/4038

AUTHORS:
	Several