summaryrefslogtreecommitdiffstats
path: root/src/pulsecore/play-memblockq.c
Commit message (Collapse)AuthorAgeFilesLines
* Remove unnecessary #includesMaarten Bosmans2011-06-221-3/+0
|
* core: Add extended stream API to support compressed formatsArun Raghavan2011-05-021-1/+1
| | | | | | | | | | | | | | | This is the beginning of work to support compressed formats natively in PulseAudio. This adds a pa_stream_new_extended() that takes a format structure, sends it to the server (=> protocol extension) and has the server negotiate with the appropropriate sink to figure out what format it should use. This is work in progress, and works only with PCM streams. Actual compressed format support in some sink needs to be implemented, and extensive testing is required. More details on how this is supposed to work is available at: http://pulseaudio.org/wiki/PassthroughSupport
* core: Drop empty gaps in the memblockq when playing data from it.Antti-Ville Jansson2011-04-281-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: 6bd34156b130c07b130de10111a12ef6dab18b52 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
* virtual-sink: Fix a crash when moving the sink to a new master right after ↵Tanu Kaskinen2011-02-261-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | setup. If the virtual sink is moved to a new master right after it has been created, then the virtual sink input's memblockq can be rewound to a negative read index. The data written prior to the move starts from index zero, so after the rewind there's a bit of silence. If the memblockq doesn't have a silence memchunk set, then pa_memblockq_peek() will return zero in such case, and the returned memchunk's memblock pointer will be NULL. That scenario wasn't taken into account in the implementation of sink_input_pop_cb. Setting a silence memchunk for the memblockq solves this problem, because pa_memblock_peek() will now return a valid memblock if the read index happens to point to a hole in the memblockq. I believe this isn't the best possible solution, though. It doesn't really make sense to rewind the sink input's memblockq beyond index 0 in the first place, because now when the stream starts to play to the new master sink, there's some unnecessary silence before the actual data starts. This is a small problem, though, and I don't grok the rewinding system well enough to know how to fix this issue properly. I went through all files that call pa_memblockq_peek() to see if there are more similar bugs. play-memblockq.c was the only one that looked to me like it might be broken in the same way. I didn't try reproducing the bug with play-memblockq.c, though, so I just added a FIXME comment there.
* scache: when playing a sample from the cache make sure not queue them up ↵Lennart Poettering2010-02-211-2/+5
| | | | | | | when the sink is suspended libcanberra already sets the appropriate flags for uncached sample streams, we now need to make sure to set them for cached samples too.
* core: move 'flags' field into 'pa_sink_input_new_data' structure so that ↵Lennart Poettering2009-08-281-1/+1
| | | | hooks can access it
* object: speed up type verification by not relying on strcmp()Lennart Poettering2009-08-211-2/+1
| | | | | | | | | | | | | Instead of using string contents for type identification use the address of a constant string array. This should speed up type verifications a little sind we only need to compare one machine word instead of a full string. Also, this saves a few strings. To make clear that types must be compared via address and not string contents 'type_name' is now called 'type_id'. This also simplifies the macros for declaring and defining public and private subclasses.
* Use LGPL 2.1 on all files previously using LGPL 2Colin Guthrie2009-03-031-1/+1
|
* remove soft volume from pa_sink_input_new_info since it should be handled ↵Lennart Poettering2009-02-041-1/+1
| | | | internally and automatically by the sink input
* make a couple of functions return proper error codesLennart Poettering2009-02-031-1/+1
|
* move flat volume logic into the core. while doing so add n_volume_steps ↵Lennart Poettering2009-01-271-1/+1
| | | | field to sinks/sources
* add new dont_rewind_render flag to allow quick starts of newly created streamsLennart Poettering2009-01-151-1/+1
|
* don't hit an assert if when process_rewind() is called with nbytes=0Lennart Poettering2008-08-041-1/+0
|
* get rid of svn $ keywordsLennart Poettering2008-06-181-2/+0
|
* never hand out more data from a sink input than requested. Otherwise the ↵Lennart Poettering2008-05-271-0/+1
| | | | | | resampler might run for too long and we get a heavy delay/underrun git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@2490 fefdeb5f-60dc-0310-8127-8f9354f1896f
* merge glitch-free branch back into trunkLennart Poettering2008-05-151-37/+80
| | | | git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@2445 fefdeb5f-60dc-0310-8127-8f9354f1896f
* merge 'lennart' branch back into trunk.Lennart Poettering2007-10-281-43/+151
| | | | git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1971 fefdeb5f-60dc-0310-8127-8f9354f1896f
* Add copyright notices to all relevant files. (based on svn log)Pierre Ossman2007-02-131-0/+2
| | | | git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1426 fefdeb5f-60dc-0310-8127-8f9354f1896f
* Huge trailing whitespace cleanup. Let's keep the tree pure from here on,Pierre Ossman2007-01-041-9/+9
| | | | | | | mmmkay? git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1418 fefdeb5f-60dc-0310-8127-8f9354f1896f
* allow hooking into the process of creating playback streams. To implement ↵Lennart Poettering2006-08-131-9/+18
| | | | | | this I modified the pa_sink_input_new() signature to take a pa_sink_input_new_data structure instead of direct arguments. git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1237 fefdeb5f-60dc-0310-8127-8f9354f1896f
* free the memblockq if we decide not to play itLennart Poettering2006-07-291-2/+6
| | | | git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1167 fefdeb5f-60dc-0310-8127-8f9354f1896f
* introduce pa_play_memblockq() which creates a playback stream and passes the ↵Lennart Poettering2006-07-281-0/+113
data from the memblockq to it. after that is done, frees the memblockq git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1161 fefdeb5f-60dc-0310-8127-8f9354f1896f