Commit graph

4862 commits

Author SHA1 Message Date
Colin Guthrie
20eedb2416 device-manager: Misc fixes to co-exist with other stream management/routing modules.
* Do not read or set the save_sink/save_source flags. This seems to be for module-stream-restore only...
 * Even if a sink is already set by an earlier module, still move it to the sink we dictate.
2009-10-01 22:12:16 +01:00
Colin Guthrie
3a20cf0b9f device-manager: Misc fixes.
* Fix a s/sink/source/ copy paste issue when dumping the database.
 * Only show priority list when routing is enabled (as the list is not updated if not)
 * Fix a memory access issue when finding the highest priority sinks/sources
 * key name->device name efficiency fix.
 * Silence noisy debug on reorder - it seems to work :)
 * Reroute after reordering.
 * Initialise preferred lists to PA_INVALID_INDEX
2009-10-01 21:30:24 +01:00
Colin Guthrie
b8a6436d4b device-manager: Fix the writing of the database when priority doesn't change. 2009-10-01 20:13:38 +01:00
Colin Guthrie
7633bb8a29 device-manager: Add extra debug messages 2009-10-01 09:08:33 +01:00
Colin Guthrie
f9b2d6500b device-manager: Change the prefer/defer options to a single 'reorder' command.
We put in the devices from the wire into a hashmap and then add all like type device in the database
and then order them based on priority (with the ones specified on the wire always being in that order at
the top of the list.
2009-10-01 09:08:32 +01:00
Colin Guthrie
8977abdc84 device-manager: Don't notify clients on every subscription (it happens all the time).
Also compare the entries fully before saving.
2009-10-01 09:08:32 +01:00
Colin Guthrie
bbf67019df device-manager: Save icon and report current availability over protocol.
This also ensures we let clients know whenver a sink changes in some capacity.
Also correct some debug code.
2009-10-01 09:08:32 +01:00
Colin Guthrie
8b2cc4def3 device-manager: Expose the priority lists in the protocol extension.
Also leave space for 'icon' and 'available' details too, althought currently this info is dummy.
2009-10-01 09:08:32 +01:00
Colin Guthrie
4dedba73a6 device-manager: Add a function to dump the database which we do whenever we save it (and on startup) 2009-10-01 09:08:32 +01:00
Colin Guthrie
1d43230006 device-manager: Reroute streams when they change allowing the media.role to be updated mid-stream.
We do not handle the _EVENT_NEW subscription here as the PA_CORE_HOOK_SINK_INPUT_NEW/PA_CORE_HOOK_SOURCE_OUTPUT_NEW
hook should handle the initial routing.
2009-10-01 09:08:32 +01:00
Colin Guthrie
d3460e3498 device-manager: Refactor the routing method to allow the routing of a single stream 2009-10-01 09:08:32 +01:00
Colin Guthrie
8d0787c1d5 device-manager: More sensible names for internal functions 2009-10-01 09:08:32 +01:00
Colin Guthrie
25f75342d4 device-manager: Reroute the streams on startup and update our cache on enable. 2009-10-01 09:08:31 +01:00
Colin Guthrie
0016b5e265 device-manager: Keep a cache of the highest priority devices for each role.
Rather than querying our database on every new stream, we keep a cache and only update it when a sink/source is added/removed.
2009-10-01 09:08:31 +01:00
Colin Guthrie
ce0b2bdc07 device-manager: Fix the database write mode 2009-10-01 09:08:31 +01:00
Colin Guthrie
1e2d236b99 device-manager: Update exports 2009-10-01 09:08:31 +01:00
Colin Guthrie
9e447978eb device-manager: Some efficiency and safety tweaks 2009-10-01 09:08:31 +01:00
Colin Guthrie
e47f385b09 device-manager: Allow the routing component to be turned on via a module argument as well as via protocol extn. 2009-10-01 09:08:31 +01:00
Colin Guthrie
4fb9dafaf8 device-manager: Remove unused variables 2009-10-01 09:08:31 +01:00
Colin Guthrie
1d04c353ea device-manager: Set the most appropriate sink/source when new streams are created 2009-10-01 09:08:30 +01:00
Colin Guthrie
74c1c27eaa device-manager: Add routing functions that are triggered when sinks/soruces are added/removed. 2009-10-01 09:08:30 +01:00
Colin Guthrie
678d8e963d device-manager: Add a function to get a list of the highest priority device indexes for each role. 2009-10-01 09:08:30 +01:00
Colin Guthrie
ca68105c8f device-manager: Remove unneeded logic for checking for and (un)loading module-stream-restore. We can co-exist 2009-10-01 09:08:30 +01:00
Colin Guthrie
ed8af7c8fd device-manager: Rough framework (slots etc.) for handling routing.
This is incomplete, it just adds the slots in question and assigns noops to them.
Some minor cleanup of types.

Due to the priority of the hooks, it seems we can actually coexist with module-stream restore so
the code to detect and unload it will be removed shortly.
2009-10-01 09:08:30 +01:00
Colin Guthrie
faae33d808 device-manager: debug and comments 2009-10-01 09:08:30 +01:00
Colin Guthrie
e589f38e22 device-manager: Fix the freeing of the datum on prefer/defer.
Also fix a log typo
2009-10-01 09:08:30 +01:00
Colin Guthrie
1802500967 device-manager: When a new device is encountered, initialise the priority list to an appropriate value 2009-10-01 09:08:30 +01:00
Colin Guthrie
a64f0f719f device-manager: Let subscribed clients know when something changes. 2009-10-01 09:08:29 +01:00
Colin Guthrie
f8ec8f382f device-manager: Change the write function to a rename function.
The structure itself will contain various bits of info so exposing this fully to the client is a bad idea.
By keeping to a rename operation we keep what we do store abstracted from the clients.

Also fix some doxy comments.
2009-10-01 09:08:29 +01:00
Colin Guthrie
aebe4787f2 device-manager: Provide a method for prefering/defering a device.
This allows clients to edit the priroity order. What is not yet in place is the initialisation of that priority list
when new devices are detected or the cleaning (remove holes) when devices are removed.

In order to keep the storage transparent I will likely remove the write functionality and replace it with a
simple rename method.

I also still need to expose the priority itself when reading the data.
2009-10-01 09:08:29 +01:00
Colin Guthrie
95f28393ab device-manager: Fix copy+paste code that looped over the tagstruct when not necessary 2009-10-01 09:08:29 +01:00
Colin Guthrie
103897a1e3 device-manager: Provide a way for clients to enable/disable role-based device-priority routing.
The routing logic itself does not yet exist, but the command currently will unload/load module-stream-restore as approriate.
(module-stream-restore would conflict with the role-based priority-routing).
2009-10-01 09:08:29 +01:00
Colin Guthrie
9357bdf4e7 device-manager: Update docs version -> 0.9.19 (predicted) 2009-10-01 09:08:29 +01:00
Colin Guthrie
464e1a8986 device-manager: Fix copy+paste leftover 2009-10-01 09:08:29 +01:00
Colin Guthrie
aa5d56ba75 device-manager: Only store and save details for non-monitor sources 2009-10-01 09:08:28 +01:00
Colin Guthrie
42b30e1aa2 stream-restore: Preventative initialistion to NULL
There is not technically a bug here due to the early return and the knowledge that one of the if blocks
will definitely be run, but this makes sure we don't call free on uninitialised data or do
anything else suitibly daft. Also helps when you copy the code and change it slightly and don't realise
you've left things open...
2009-10-01 09:08:28 +01:00
Colin Guthrie
64979385e0 device-restore: Fix the application of an entry to allow changing the name of devices.
This fixes a few bugs in the copy+pasted implementation of apply_entry()/get_name().
2009-10-01 09:08:28 +01:00
Colin Guthrie
40e97eb698 device-manager: Fix tagstruct description extraction (copy+paste blunder) 2009-10-01 09:08:28 +01:00
Colin Guthrie
70accbbd61 device-manager: Link native protocol library. 2009-10-01 09:08:28 +01:00
Colin Guthrie
0b3b037e22 device-manager: Export device-manager extension functions 2009-10-01 09:08:28 +01:00
Colin Guthrie
93c3c655e4 device-manager: Fix indentation 2009-10-01 09:08:28 +01:00
Colin Guthrie
37e82cec0a device-manager: Add an untested protocol extension.
This is effectively copied from the stream restore extension.
2009-10-01 09:08:28 +01:00
Colin Guthrie
bc869b5b28 device-manager: Add a new module to keep track of the names and descriptions of various sinks.
This will be used as the basis for a queryable system for past and present devices, initially for use in KDE.
Currently all this module does is save lists of sinks/sources and their descriptions, so it needs to
gain a protocol extension to make this queryable.

As things stand it will save the device descriptions of all sinks and restore them if they differ from whats on record.
2009-10-01 09:08:27 +01:00
Lennart Poettering
afd1b6d355 build-sys: bump soname 2009-09-30 03:04:12 +02:00
Lennart Poettering
c622f77cf0 i18n: run make update-po 2009-09-30 02:43:55 +02:00
Lennart Poettering
6a3b51a530 i18n: ad more .c files to POTFILES.in 2009-09-29 23:48:37 +02:00
Lennart Poettering
b8de3bd214 polkit: drop left-over polkit policy file from git tree 2009-09-29 23:48:07 +02:00
Nix
eac566226e Don't refuse to start on systems using GNU stow, graft, STORE et al
There are multiple package management systems out there which implement
packages using symlinks. The recent (otherwise useful) check to ensure that
a re-executed pulseaudio is actually reexecuting itself unfortunately breaks
in the presence of all these packaging systems, because PA_BINARY refers
to its installed location (e.g. /usr/local/bin/pulseaudio), which is a
symlink to the binary (e.g. /usr/local/stow/pulseaudio-0.9.18/bin/pulseaudio),
because /proc/self/exe always contains the canonical path of the executable,
with all symlinks resolved.

(At least one distribution uses a symlink-based packaging system, so
will be forced to apply this locally in any case.)

The fix is simple: canonicalize PA_BINARY before equality-testing. (This
should be completely safe, because the OS does just that when PA_BINARY
is executed.)

The patch is against 0.9.18, but applies without fuzz to current master.
2009-09-29 19:32:25 +02:00
Lennart Poettering
faf113d95b i18n: run make update-po 2009-09-29 19:27:02 +02:00
Lennart Poettering
0c8475789e Merge remote branch 'origin/master-tx' 2009-09-29 19:24:26 +02:00