summaryrefslogtreecommitdiff
path: root/src/modules/module-device-restore.c
Commit message (Collapse)AuthorAgeFilesLines
* module-*-restore: use pa_module_hook_connectDavid Henningsson2015-04-101-35/+8
| | | | | | Refactoring, no functional change. Signed-off-by: David Henningsson <david.henningsson@canonical.com>
* tagstruct: Distinguish pa_tagstruct_new() use casesPeter Meerwald2015-02-261-6/+6
| | | | | | | | | 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>
* module-device-restore: Fix memory leak in read_sink_format_replyDavid Henningsson2015-01-291-0/+1
| | | | | | This function could sometimes leak a perportentry. Signed-off-by: David Henningsson <david.henningsson@canonical.com>
* update FSF addresses to FSF web pageOndrej Holecek2015-01-141-3/+1
| | | | | | | | | 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.
* module-card/device-restore: Do not legacy load an empty entryDavid Henningsson2014-10-281-3/+5
| | | | | | | | | There is no use in trying to load data in legacy format, if we already know that there is no data at all. Also clarify in the debug message whether there is invalid data or no data at all. Signed-off-by: David Henningsson <david.henningsson@canonical.com>
* device-restore: Sync the database on unloadTanu Kaskinen2014-08-181-1/+3
| | | | | If there are unsaved changes, those need to be written to disk before the module is unloaded, otherwise the changes are lost.
* device-restore: log restored mute stateWim Taymans2014-03-261-2/+4
| | | | Log the mute state as it was restored
* modules: Fix resource leak in device-restorePeter Meerwald2013-12-201-0/+1
| | | | | | https://scan7.coverity.com:8443/reports.htm#v10205/p10016/fileInstanceId=8724&defectInstanceId=3728&mergedDefectId=591265 Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
* Use pa_(c)volume_snprint_verbose() everywhereTanu Kaskinen2013-07-091-10/+6
| | | | | | | | All pa_cvolume_snprint(), pa_volume_snprint(), pa_sw_cvolume_snprint_dB() and pa_sw_volume_snprint_dB() calls have been replaced with pa_cvolume_snprint_verbose() and pa_volume_snprint_verbose() calls, making the log output more informative and the code sometimes simpler.
* Remove pa_bool_t and replace it with bool.poljar (Damir Jelić)2013-07-041-70/+70
| | | | | | | | | | | | | | | | | commands used for this (executed from the pulseaudio/src directory): find . -regex '\(.*\.[hc]\|.*\.cc\|.*\.m4\)' -not -name 'macro.h' \ -a -not -name 'reserve.[ch]' -a -not -name 'reserve-monitor.[ch]' \ -a -not -name 'glib-mainloop.c' -a -not -name 'gkt-test.c' \ -a -not -name 'glib-mainloop.c' -a -not -name 'gkt-test.c' \ -a -not -name 'poll-win32.c' -a -not -name 'thread-win32.c' \ -a -not -name 'dllmain.c' -a -not -name 'gconf-helper.c' \ -exec sed -i -e 's/\bpa_bool_t\b/bool/g' \ -e 's/\bTRUE\b/true/g' -e 's/\bFALSE\b/false/g' {} \; and: sed -i -e '181,194!s/\bpa_bool_t\b/bool/' \ -e '181,194!s/\bTRUE\b/true/' -e \ '181,194!s/\bFALSE\b/false/' pulsecore/macro.h
* Whitespace cleanup: Remove all multiple newlinespoljar (Damir Jelić)2013-06-241-4/+0
| | | | | | | | | | | | | | | This patch removes all occurrences of double and triple newlines. Command used for this: find . -type d \( -name ffmpeg \) -prune -o \ -regex '\(.*\.[hc]\|.*\.cc\)' \ -a -not -name 'adrian-aec.*' -a -not \ -name reserve.c -a -not -name 'rtkit.*' \ -exec sed -i -e '/^$/{N;s/^\n$//}' {} \; Two passes were needed to remove triple newlines. The excluded files are mirrored files from external sources.
* idxset: Use pa_free_cb_t instead of pa_free2_cb_tTanu Kaskinen2013-02-161-3/+3
| | | | There were no users for the userdata pointer.
* device-restore: Fix empty argument list declaration.Tanu Kaskinen2012-12-191-2/+2
|
* device-restore: When restoring volume, print the restored volume to the log.Tanu Kaskinen2012-11-041-6/+10
|
* modules: Use PA_IDXSET_FOREACH wherever applicable.Harsh Prateek Bora2012-05-311-3/+3
| | | | Signed-off-by: Harsh Prateek Bora <harsh.bora@linaro.org>
* device-restore: Fix use-after-free error.Colin Guthrie2011-09-051-2/+5
|
* device-restore: Simplify the migration of data to per-port keys.Colin Guthrie2011-09-031-65/+65
| | | | | | | | | | | | Rather than write all the keys out for each port, simply write a 'null' port entry and modify the read code to 'fallback' to this when it cannot find a key. This is needed as the code used when writing the key may not actually have the sink ports available at the time it uses them, and thus can cause a segv. This approach adds some degree of overhead but it's relatively minimal and it can be mitigated by compiling without support for legacy database formats if so desired. Thanks to David Henningsson for pointing out the problem.
* device-restore: Restore volumes on port change.Colin Guthrie2011-08-291-0/+89
| | | | | | | | | This will allow for volumes to be saved separately for e.g. Headphones vs. Speakers. At present it is possible that no volume will be saved for the device prior to the port switch. In this case the volume will not change from the value set under the other port. In an ideal world we would save the volume before switching port, but that would require a new hook.
* device-restore: Split device restore database into two parts.Colin Guthrie2011-08-291-165/+371
| | | | | | | | The device restore saves both the current port for a device, and the volume/mute/formats. The latter three are really related to the device+port, not the device on it's own. Thus we store just the port for a device in one key and the volume/mute/formats under a different key that includes both the device and the port.
* More spelling fixesMaarten Bosmans2011-08-251-1/+1
|
* device-restore: Change the API to include type information (sink vs. source)Colin Guthrie2011-08-181-12/+31
| | | | This changes the API, but as we have not released yet, this is OK.
* Revert "device-restore: Make bools not be bit fields"Arun Raghavan2011-08-181-4/+4
| | | | | | | | | | | | This reverts commit ba163b8b23bcd72c35b028eb0b43c31a6ae1724d. After discussion with Colin, decided that we don't want to do this piecemeal -- need some discussion on the mailing-list and then we should do this across the tree in one fell swoop post 1.0. Conflicts: src/modules/module-device-restore.c
* device-restore: Log invalid sink index while setting formatsArun Raghavan2011-08-151-1/+3
| | | | This makes it easier to catch errors when using 'pactl set-sink-formats'
* device-restore: Set sink format when possibleArun Raghavan2011-08-151-6/+41
| | | | | This implements the actual setting of sink formats when a new sink is added or when the set of available formats changes.
* device-restore: Make bools not be bit fieldsArun Raghavan2011-08-151-3/+3
| | | | | | This makes the pa_bool_t members of userdata not be a single bit field since pa_bool_t can be an int, potentially causing signedness issues in comparisons.
* device-restore: Various fixes for the protocol extension.Colin Guthrie2011-08-091-4/+28
| | | | | | | | * Fix extension API function export list. * Ensure we trigger a subscription event when things change. * Send the index with our subscription events. * Clear out any existing formats when saving. * Call the correct extension command for subscriptions.
* Remove unnecessary #includesMaarten Bosmans2011-06-221-4/+3
|
* database: Support legacy format database entries.Colin Guthrie2011-06-221-53/+137
| | | | | | This adds code to specifically support legacy entries. I kept this code in a separate commit so that it can be (relatively) easily removed at some point in the future.
* device-restore: Add a new protocol extension for device-restore.Colin Guthrie2011-06-221-3/+266
| | | | | | This simply exposes the formats that a device supports via a simple protocol extension that will allow clients to setup what a connected receiver supports format wise.
* database: Convert our use of database files to save in tagstruct format.Colin Guthrie2011-06-221-61/+130
| | | | | | | | | | | | | This has the advantage of allowing versioned updates in the future, thus allowing us to be more user friendly going forward (as opposed to just ignoring entries from old versions). The primary motivation for this, however, is to allow variable length storage in each entry which will be needed for upcoming work. At present this commit will ignore any legacy entries but support for reading and subsequently converting legacy entries will be added shortly.
* Fix up some double spacesMaarten Bosmans2011-03-181-1/+1
|
* Fix typosZhang Wanming2010-12-201-1/+1
|
* sink: volume handling rework, new flat volume logicLennart Poettering2009-08-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | - We now implement a logic where the sink maintains two distinct volumes: the 'reference' volume which is shown to the users, and the 'real' volume, which is configured to the hardware. The latter is configured to the max of all streams. Volume changes on sinks are propagated back to the streams proportional to the reference volume change. Volume changes on sink inputs are forwarded to the sink by 'pushing' the volume if necessary. This renames the old 'virtual_volume' to 'real_volume'. The 'reference_volume' is now the one exposed to users. By this logic the sink volume visible to the user, will always be the "upper" boundary for everything that is played. Saved/restored stream volumes are measured relative to this boundary, the factor here is always < 1.0. - introduce accuracy for sink volumes, similar to the accuracy we already have for source volumes. - other cleanups.
* Merge most of elmarco/rtclock2Lennart Poettering2009-06-221-8/+4
|\ | | | | | | Merge commit 'e4d914c945c13d23b131d7ba75fbdd03cb6d0043'
| * Base mainloop on pa_rtclock_now()Marc-André Lureau2009-06-201-8/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move the mainloop to monotonic based time events. Introduces 4 helper functions: pa_{context,core}_rttime_{new,restart}(), that fill correctly a timeval with the rtclock flag set if the mainloop supports it. Both mainloop-test and mainloop-test-glib works with rt and timeval based time events. PulseAudio and clients should be fully functional. This patch has received several iterations, and this one as been largely untested. Signed-off-by: Marc-André Lureau <marca-andre.lureau@nokia.com>
* | restore: change 'save' flag behaviour to reflect whether an entry shall ↵Lennart Poettering2009-06-221-12/+18
|/ | | | and/or is in the on-disk databases
* device-restore: properly check save_muted flag when storing muted stateLennart Poettering2009-06-181-1/+1
|
* device-restore: save last used port in databaseLennart Poettering2009-06-181-31/+171
|
* database: port restore modules to new database APILennart Poettering2009-05-141-39/+26
|
* core: introduce new 'reference' volume for sinksLennart Poettering2009-04-131-1/+1
| | | | | | | | | | | | | | | The reference volume is to be used as reference volume for stored stream volumes. Previously if a new stream was created the relative volume was taken relatively to the virtual device volume. Due to the flat volume logic this could then be fed back to the virtual device volume. Repeating the whole story over and over would result in a device volume that would go lower, and lower and lower. This patch introduces a 'reference' volume for each sink which stays unmodified by stream volume changes even if flat volumes are used. It is only modified if the sink volumes are modified directly by the user. For further explanations see http://pulseaudio.org/wiki/InternalVolumes
* Use LGPL 2.1 on all files previously using LGPL 2Colin Guthrie2009-03-031-1/+1
|
* make PA_GCC_PACKED and PA_GCC_MALLOC actually workLennart Poettering2009-02-131-2/+2
|
* version all entries in the databaseLennart Poettering2009-02-041-3/+12
|
* add missing usage stringsLennart Poettering2009-01-281-0/+3
|
* don't restore mute/volume when already setLennart Poettering2009-01-211-10/+27
|
* Pass GDBM_NOLOCK to gdbmLennart Poettering2008-12-171-1/+1
| | | | | | | | | | gdbm still uses BSD lockf for locking which is incompatible with NFS. Since we don't need the locking here since the db files in question should never be accessed by more than one process since they are per-home-dir and per-machine we can disable locking without any ill results. This should fix rhbz #471279.
* reduce needlessly large gdbm cache a bitLennart Poettering2008-08-291-0/+5
|
* add a few more gcc warning flags and fix quite a few problems found by doing soLennart Poettering2008-08-191-2/+2
|
* pass force_refresh=FALSE to all volume/mute read invocationsLennart Poettering2008-08-131-4/+4
|
* Modify pa_state_path() to take an additional argument for prepending the ↵Lennart Poettering2008-08-071-5/+5
| | | | machine id to the file name.