summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2015-02-26packet: Make pa_packet_new() create fixed-size packetsPeter Meerwald2-3/+18
if length exceeds maximum appended size, create a packet of type dynamic instead of type appended this is a preparation to use a separate free-list for packets document semantics of pa_packet_new_*() functions Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2015-02-26packet: Hide internals of pa_packet, introduce pa_packet_data()Peter Meerwald5-24/+50
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2015-02-26tagstruct: Use flist to potentially save calls to malloc()/free()Peter Meerwald1-3/+9
v2: (thanks David Henningson) * fix double assignment of data in pa_tagstruct_new_fixed(), two statements on one line Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2015-02-26tagstruct: Add type _APPENDEDPeter Meerwald1-7/+19
add 128 bytes of storage in each tagstruct that will initially be used; if this storage is exceeded the type changes to _DYNAMIC v3: (thanks David Henningson) * add comments explaining how memory is handled by different tagstruct types v2: (thanks Alexander Patrakov) * replace constant 100 with GROW_TAG_SIZE (the increment in with a dynamic tagstruct grows when extend()ed) Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2015-02-26tagstruct: Get rid of pa_tagstruct_free_data()Peter Meerwald3-17/+6
pa_tagstruct_free_data() is used in only one place to pass data from a tagstruct to a packet this patch is a temporary solution which introduces an extra malloc(); will be resolved shortly... Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2015-02-26tagstruct: Replace dynamic flag with typePeter Meerwald1-7/+9
... in order to prepare for a new type _APPENDED remove the assert() for dynamic in pa_tagstruct_data() as the function makes sense for all tagstruct types (and the returned pointer is const) Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2015-02-26tagstruct: Distinguish pa_tagstruct_new() use casesPeter Meerwald11-57/+70
pa_tagstruct_new() is called either with no data, i.e. (NULL, 0) to create a dynamic tagstruct or with a pointer to fixed data introduce a new function pa_tagstruct_new_fixed() for the latter case Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2015-02-26echo-cancel: fix the obviously-wrong "buffer+=buffer" logicAlexander E. Patrakov1-1/+1
Same bug as in module-loopback, pointed out by Georg Chini in a private email. Signed-off-by: Alexander E. Patrakov <patrakov@gmail.com>
2015-02-23socket-server: add tcp support for systemd socket activationJaska Uimonen1-46/+86
2015-02-23alsa: Don't access pa_sink/source_new_data after done() has been calledTanu Kaskinen2-6/+14
This change doesn't affect behaviour, because accessing boolean fields in the new data was safe even after the done() call, but it was still bad style.
2015-02-23alsa: Fix spelling of officiallyPeter Meerwald2-2/+2
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2015-02-23tagstruct: Refactor writing/reading basic typesTanu Kaskinen1-248/+194
While adding functions for writing and reading pa_bvolume structs, I found myself wondering if I could make it simpler to write and read the basic types that a pa_bvolume consists of, without having to worry about network byte ordering, remembering to call extend() and getting the length and read index adjustments just right. This is what I came up with. There is a functional change too: previously the pa_tagstruct_get_foo() functions didn't modify the read index in case of errors, but now, due to read_tag() modifying the read index at an early stage, the read index gets modified also in case of errors. I have checked the call sites, and I believe there's no code that would rely on the "no read index modification on error" property of the old functions. If reading anything from a tagstruct fails, the whole tagstruct is considered invalid (typically resulting in a protocol error and client connection teardown).
2015-02-16module-loopback: don't use 0 for custom source output message idAlexander E. Patrakov1-1/+1
Message id 0 is PA_SOURCE_OUTPUT_MESSAGE_GET_LATENCY. So, every time PulseAudio sent PA_SOURCE_OUTPUT_MESSAGE_GET_LATENCY message to the loopback source output, it actually hit the SOURCE_OUTPUT_MESSAGE_LATENCY_SNAPSHOT handler instead. As a result, the SOURCE_OUTPUT_MESSAGE_LATENCY_SNAPSHOT handler was called when not intended, the default PA_SOURCE_OUTPUT_MESSAGE_GET_LATENCY handler was not called at all, and the latency was thus evaluated incorrectly. Reported-by: Georg Chini <georg@chini.tk> Signed-off-by: Alexander E. Patrakov <patrakov@gmail.com>
2015-02-16alsa-util: Make two of the warnings "debug" instead of "error"David Henningsson1-2/+2
...because we will later try with plug:* which will probably succeed, so this is not an error. Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2015-02-16alsa-util: No logging when sound card only supports non-interleaved sample ↵Peter Meerwald1-0/+15
format as suggested by https://bugs.freedesktop.org/show_bug.cgi?id=84804 Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2015-02-12Added libsoxr detection and optional build of soxr resampler backend.Andrey Semashev1-0/+6
2015-02-12Enabled libsoxr resampler backend.Andrey Semashev2-4/+33
Added ID and names for the resampler presets and also updated the working sample rate deduction to take the new resampler into account. The initial libsoxr backend version does not variable rate resampling, so it is disabled in this case.
2015-02-12Added libsoxr resampler backend.Andrey Semashev1-0/+167
The new backend supports 3 quality levels: mq, hq and vhq; 16-bit integer and 32-bit float samples. Discussion and quality assessment are here: http://comments.gmane.org/gmane.comp.audio.pulseaudio.general/22158
2015-02-12pacat: State purpose of program depending how it was invokedPeter Meerwald1-5/+11
see https://bugs.freedesktop.org/show_bug.cgi?id=68135 state purpose of paplay/parec/pamon/parecord/pacat when invoked with -h Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2015-02-12context: pa_context_connect() with PA_CONTEXT_NOFAIL should return 0 when ↵Peter Meerwald1-0/+5
waiting for PA on D-Dus see https://bugs.freedesktop.org/show_bug.cgi?id=85011 in case NOAUTOSPAWN is set and no server has been specified, PA starts listening on DBUS for a new server, and the state is PA_CONTEXT_CONNECTING, but pa_context_connect() returns -1; it should return 0. Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2015-02-12dynarray: Add PA_DYNARRAY_FOREACHTanu Kaskinen3-4/+8
The PA_DYNARRAY_FOREACH macro requires that pa_dynarray_get() returns NULL if the index is out of bounds.
2015-02-12dynarray: Add pa_dynarray_remove_by_data()Tanu Kaskinen2-0/+25
2015-02-12dynarray: Add pa_dynarray_remove_by_index()Tanu Kaskinen2-6/+24
Also, remove the talk about "fast" variants of functions that remove entries from an array. Currently there's no need for order-preserving functions, so all functions are "fast".
2015-02-12dynarray: Add pa_dynarray_last()Tanu Kaskinen2-0/+12
2015-02-12Make pa_socket_server_new staticAlexander E. Patrakov2-8/+4
While at it, also remove SOCKET_SERVER_GENERIC, because it is always being overwritten with a specific socket type. Signed-off-by: Alexander E. Patrakov <patrakov@gmail.com>
2015-02-12socket-server: pa_socket_server_new() can't fail, so don't check its return ↵Tanu Kaskinen1-8/+8
value An assertion was already used in pa_socket_server_new_unix(), this makes the TCP variants consistent with that. Even if pa_socket_server_new() could fail, the error handling wasn't good, because there was no "goto fail", meaning that the fd would have been leaked.
2015-02-12alsa: Don't try to use ELD controls with UCMTanu Kaskinen1-0/+6
This fixes a crash that occurred when trying to access non-existent port data. Doing this: pa_alsa_port_data *data = PA_DEVICE_PORT_DATA(port); is not a good idea when using UCM, because in the UCM mode ports don't have any data, so the data pointer points to some random memory.
2015-02-02loopback: Don't push zero-sized block to memblockqGeorg Chini1-1/+1
During my work on module-loopback I found a bug that sometimes crashes pulse when module-loopback is loaded due to pushing a zero-length block into the memblockq. As there is a one-line fix I thought you might want it for 6.0.
2015-02-02build-sys: libwebrtc-util needs libpulsecoreArun Raghavan1-1/+1
2015-01-29alsa-mixer: Make speaker unavailable when Line Out is plugged inDavid Henningsson2-0/+16
ALSA mutes speaker when Line Out is plugged in by default, so we should follow that convention. Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2015-01-29alsa-mixer: Add lineout to surround21 mappingsTanu Kaskinen3-3/+3
This makes the analog-surround-21 mapping consistent with other surround mappings. I'm not sure if this makes any practical difference, though.
2015-01-29module-device-restore: Fix memory leak in read_sink_format_replyDavid Henningsson1-0/+1
This function could sometimes leak a perportentry. Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2015-01-21protocol-native: Disable srbchannel by defaultDavid Henningsson1-2/+2
Recent testing has shown some srbchannel related bugs that indicates that the srbchannel feature is not ready to be enabled by default. Therefore, temporary disable it for the 6.0 release and re-enable it in git master once 6.0 is released. Bugs: https://bugs.freedesktop.org/show_bug.cgi?id=88452 https://bugs.freedesktop.org/show_bug.cgi?id=88167 Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2015-01-14update FSF addresses to FSF web pageOndrej Holecek581-1702/+583
FSF addresses used in PA sources are no longer valid and rpmlint generates numerous warnings during packaging because of this. This patch changes all FSF addresses to FSF web page according to the GPL how-to: https://www.gnu.org/licenses/gpl-howto.en.html Done automatically by sed-ing through sources.
2015-01-13alsa-mixer: Mute headphones and speakers on line out pathDavid Henningsson1-9/+8
When line out path is active, we want to mute speakers for obvious reasons, and headphones to avoid volume spikes. Reported-by: TienFu Chen <tienfu.chen@canonical.com> Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2015-01-13pacmd: add missing 'else' keywordBoris Egorov1-1/+1
See code above for proper behavior. Issue detected by PVS Studio
2015-01-13tunnel: use proper value for pa_source_state switchBoris Egorov1-1/+1
pa_source_state_t can have value PA_SOURCE_INVALID_STATE, not PA_SINK_INVALID_STATE. It happens to be the same here, but it can break sometimes. Issue detected by PVS Studio.
2015-01-13alsa-util: fix parenthesis position in err assignmentBoris Egorov1-1/+1
Issue detected by CppCheck and PVS Studio
2015-01-12svolume.orc: avoid parameter loading undefined behaviourWim Taymans1-1/+3
In some cases, depending on the instruction that performs the load, orc ignores the size of the parameter when loading it for the first time. Explicitly load the parameter into a temp to make sure it is loaded correctly, like we do for the 2ch case. See https://bugzilla.gnome.org/show_bug.cgi?id=742271
2015-01-08memblock: Fix more block ID collisionsDavid Henningsson1-3/+3
Since the srb memblock and the audio data were coming from separate pools, and the base index was per pool, they could actually still collide. This patch changes the base index to be global and atomically incremented. Reported-by: Arun Raghavan <arun@accosted.net> Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2015-01-08pactl: fix getopt indexing for set-*-volumeFelipe Sateler1-4/+4
When pactl is invoked with any options or the -- specifier, optind will be > 1. Therefore using a static 3 value is wrong. Use optind+2 as both offset and count difference. Bug-Debian: http://bugs.debian.org/774810
2015-01-02tunnel-sink-new: Fix stale audio on resumeTanu Kaskinen1-0/+9
I noticed that when resuming the tunnel sink, there was a small amount of previously played audio before the new audio started to play. Normally that probably wouldn't be noticeable, because there would be a few seconds of silence played before suspending the sink due to inactivity, so the unwanted old audio would be just silence, but in my configuration sinks are suspended immediately when there's nothing playing to them, so the glitch becomes audible.
2014-12-29Fix the WhatIsWrongWithSystemWide URLAlexander E. Patrakov1-1/+1
Pavel Machek reported in his blog that our message about the system mode has a dead link in it. And this link is also present in translations. So, I replaced it in the source and fixed all translations using a script: for a in po/*.po ; do msgcat --no-wrap $a | sed 's@http://pulseaudio.org/wiki/WhatIsWrongWithSystemMod @http://pulseaudio.org/wiki/WhatIsWrongWithSystemMode @g' | sed 's@http://pulseaudio.org/wiki/WhatIsWrongWithSystemMode@http://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/WhatIsWrongWithSystemWide/@g' | sed 's@/\.@/ .@g' | sed 's@/,@/ ,@g' | msgcat - > $a.new git add -i # to filter out formatting changes The "/." and "/," replacements are needed so that various terminal emulators don't include the trailing "." or "," into the clickable URL. The resulting patch is attached, just in case, in order to avoid damaging non-ASCII characters. -- Alexander E. Patrakov >From 7dcd197571840e467d688f0f7354253730bbcc15 Mon Sep 17 00:00:00 2001 From: "Alexander E. Patrakov" <patrakov@gmail.com> Date: Sat, 29 Nov 2014 20:56:27 +0500 Subject: [PATCH] Fix the WhatIsWrongWithSystemWide URL Reported by Pavel Machek in http://pavelmachek.livejournal.com/126190.html All translations were also fixed using a script. Signed-off-by: Alexander E. Patrakov <patrakov@gmail.com>
2014-12-22Fix URLs still pointing to the old wikiAlexander E. Patrakov16-27/+27
Signed-off-by: Alexander E. Patrakov <patrakov@gmail.com>
2014-12-19Revert "launch: Disable autospawn by default when systemd daemon support is ↵David Henningsson2-5/+1
enabled." This reverts commit 7276faca72e9696d4891daff139aee52509f43bf. Using the new systemd socket activation for PulseAudio will cause PulseAudio to not have any connection with D-Bus, breaking device reservation protocol, module-jackdbus-detect and module-dbus-protocol. Therefore, autospawn is now still enabled by default even if you build with systemd daemon headers.
2014-12-19card-restore: Fix profile restoring with bluetoothTanu Kaskinen1-0/+34
The bluetooth card is created when the first profile becomes available, which means that the card may have profiles that are not available when the card is initialized. If module-card-restore tries to restore such profile, that will fail, and the card will be initialized with the "off" profile active. This patch modifies module-card-restore so that if follows the profile availability status, and when the saved profile becomes available, it is activated. Additionally, module-card-restore is modified so that it doesn't even try to restore unavailable profiles, when the necessary information is available. In practice there are two existing places where the profile is restored, and only one of those contexts has the necessary information available. Unfortunately, it's the more important context (card creation) where the information is not available. This means that module-card-restore will set the initial profile of a new card even if the profile is unavailable, and this will cause an ugly warning in the log, even though there's nothing abnormal happening. BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=87081
2014-12-19bluez5: Do not suspend on no -> unknown profile transitionsDavid Henningsson1-1/+3
In case a transport is currently disconnected and transitions to idle, that should not count as a "remote hang up" event. Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2014-12-15introspect: Minor documentation fixArun Raghavan1-1/+1
2014-12-10memblock: Initialize mempool object to zeroDavid Henningsson1-2/+1
This fixes a "use of uninitialised value" error in previous memblock commit. Reported-by: Alexander Patrakov <patrakov@gmail.com> Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2014-12-08srbchannel: Check return value of pa_memblock_new_poolDavid Henningsson1-0/+3
In case PA_MEMPOOL_DISABLE is set, pa_memblock_new_pool can return NULL. It does not make sense to set up a srbchannel without a shared memory pool, so just fail in this case. Reported-by: Alexander Patrakov <patrakov@gmail.com> Signed-off-by: David Henningsson <david.henningsson@canonical.com>