Commit graph

1195 commits

Author SHA1 Message Date
Colin Guthrie
ab3502feab device-manager: Keep track as to whether or not the user specifically renamed the device.
If the user has not (via our protocol extension) renamed a device, but it happens to now have
a different name (e.g. module-combine automatically updating the description for us or udev-db
getting better etc.) then make sure we update our cache with this updated version.

If the user has set a name, enforce it's use, even if the description is updated by some other
means (e.g. the user manually editing the proplist or another module doing it for them).
2009-11-11 17:44:27 +00:00
Colin Guthrie
654df0f858 device-manager: No need to check the version after calling read_entry() 2009-11-11 17:44:27 +00:00
Colin Guthrie
996fc1f2e2 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-11-11 17:44:26 +00:00
Colin Guthrie
6e0dde1a7a 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-11-11 17:44:26 +00:00
Colin Guthrie
763de9e7c9 device-manager: Fix the writing of the database when priority doesn't change. 2009-11-11 17:44:26 +00:00
Colin Guthrie
d5dc700913 device-manager: Add extra debug messages 2009-11-11 17:44:26 +00:00
Colin Guthrie
8a5778dcc5 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-11-11 17:44:26 +00:00
Colin Guthrie
45a4d26aca device-manager: Don't notify clients on every subscription (it happens all the time).
Also compare the entries fully before saving.
2009-11-11 17:44:26 +00:00
Colin Guthrie
ff633cbce0 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-11-11 17:44:26 +00:00
Colin Guthrie
055ad89928 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-11-11 17:44:26 +00:00
Colin Guthrie
aa93410115 device-manager: Add a function to dump the database which we do whenever we save it (and on startup) 2009-11-11 17:44:26 +00:00
Colin Guthrie
d9a3131328 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-11-11 17:44:25 +00:00
Colin Guthrie
3072f65958 device-manager: Refactor the routing method to allow the routing of a single stream 2009-11-11 17:44:25 +00:00
Colin Guthrie
888a515a8e device-manager: More sensible names for internal functions 2009-11-11 17:44:25 +00:00
Colin Guthrie
d81fa00c0c device-manager: Reroute the streams on startup and update our cache on enable. 2009-11-11 17:44:25 +00:00
Colin Guthrie
df893f6d72 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-11-11 17:44:25 +00:00
Colin Guthrie
009d087f86 device-manager: Fix the database write mode 2009-11-11 17:44:25 +00:00
Colin Guthrie
6e67653aee device-manager: Some efficiency and safety tweaks 2009-11-11 17:44:25 +00:00
Colin Guthrie
26f1ec7e0e device-manager: Allow the routing component to be turned on via a module argument as well as via protocol extn. 2009-11-11 17:44:25 +00:00
Colin Guthrie
8d3d0d3e0e device-manager: Remove unused variables 2009-11-11 17:44:24 +00:00
Colin Guthrie
5077fe14a3 device-manager: Set the most appropriate sink/source when new streams are created 2009-11-11 17:44:24 +00:00
Colin Guthrie
470b62594f device-manager: Add routing functions that are triggered when sinks/soruces are added/removed. 2009-11-11 17:44:24 +00:00
Colin Guthrie
8c9966740d device-manager: Add a function to get a list of the highest priority device indexes for each role. 2009-11-11 17:44:24 +00:00
Colin Guthrie
d69eba34e2 device-manager: Remove unneeded logic for checking for and (un)loading module-stream-restore. We can co-exist 2009-11-11 17:44:24 +00:00
Colin Guthrie
a0567fb41b 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-11-11 17:44:24 +00:00
Colin Guthrie
fd5a5084d8 device-manager: debug and comments 2009-11-11 17:44:24 +00:00
Colin Guthrie
2b714801c1 device-manager: Fix the freeing of the datum on prefer/defer.
Also fix a log typo
2009-11-11 17:44:24 +00:00
Colin Guthrie
0541028797 device-manager: When a new device is encountered, initialise the priority list to an appropriate value 2009-11-11 17:44:23 +00:00
Colin Guthrie
5e3f1c2363 device-manager: Let subscribed clients know when something changes. 2009-11-11 17:44:23 +00:00
Colin Guthrie
6d4afac194 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-11-11 17:44:23 +00:00
Colin Guthrie
4981268738 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-11-11 17:44:23 +00:00
Colin Guthrie
a9bd1ab69c device-manager: Fix copy+paste code that looped over the tagstruct when not necessary 2009-11-11 17:44:23 +00:00
Colin Guthrie
c1ece6ce85 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-11-11 17:44:23 +00:00
Colin Guthrie
58bc037884 device-manager: Only store and save details for non-monitor sources 2009-11-11 17:44:22 +00:00
Colin Guthrie
276e9534b5 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-11-11 17:44:22 +00:00
Colin Guthrie
b8b28ef57e device-manager: Fix tagstruct description extraction (copy+paste blunder) 2009-11-11 17:44:22 +00:00
Colin Guthrie
0f6ace75c9 device-manager: Add an untested protocol extension.
This is effectively copied from the stream restore extension.
2009-11-11 17:44:22 +00:00
Colin Guthrie
4c68fe7b9f 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-11-11 17:44:22 +00:00
Lennart Poettering
409a9d01cd jack: never try to autoconnect to MIDI ports
Original patch supplied by 'adi'

http://pulseaudio.org/ticket/669
2009-11-11 05:26:56 +01:00
Lennart Poettering
3b25302554 alsa: disable timer-based scheduling inside a VM
In virtual machines sound card clocks and OS scheduling tend to become
unreliable, adding various 'uneven' latencies. The adaptive algorithm
that handles drop-outs does not handle it this well: in contrast to
drop-outs on real machines that are evenly distributed, small and can
easily be encountered via the adpative algorithms, drop-outs in VMs tend
to happen abruptly, and massively, which is not easy to counter.

This patch simply disables timer based scheduling in VMs reverting to
classic IO based scheduling. This should help make PA perform better in
VMs.

https://bugzilla.redhat.com/show_bug.cgi?id=532775
2009-11-11 05:26:36 +01:00
Lennart Poettering
b47a9e7ea4 alsa: introduce more standard path names 2009-11-11 05:17:52 +01:00
Lennart Poettering
ab573f2e06 alsa: cover 'Analog Output' control
http://pulseaudio.org/ticket/702
2009-11-11 05:17:39 +01:00
Lennart Poettering
4323c9f22f alsa: create a seperate mixer path for Speaker elements
On some cards line-out is independant of Sepaker and it is a good idea
to cover that so that they can independantly be activated.

https://bugzilla.redhat.com/show_bug.cgi?id=520884
2009-11-11 05:17:32 +01:00
Lennart Poettering
8a26fbf863 alsa: leave other headphone control enabled if possible 2009-11-11 05:17:26 +01:00
Lennart Poettering
08d0654867 alsa: lower priority for Headphone2 path 2009-11-11 05:17:19 +01:00
Lennart Poettering
18018b3ff3 alsa: cover Input Source:AUX IN
As seen on some HDA chips:

https://bugzilla.redhat.com/attachment.cgi?id=359804
2009-11-11 05:17:12 +01:00
Lennart Poettering
d711caa38c alsa: cover Headphone2 mixer element
As seen on some drivers:

https://bugzilla.redhat.com/show_bug.cgi?id=498612
2009-11-11 05:17:06 +01:00
Lennart Poettering
82d7b75528 alsa: cover 'Digital Input Source' element
As used by some HDA devices:

https://bugzilla.redhat.com/attachment.cgi?id=365290
2009-11-11 05:17:00 +01:00
Lennart Poettering
6fad76558d alsa: cover Mic Jack Mode element
As used by some HDA chips:

https://bugzilla.redhat.com/attachment.cgi?id=366816
2009-11-11 05:16:53 +01:00
Lennart Poettering
70da8d65d4 bluetooth: do not hand out access to devices that are not fully configured yet 2009-11-11 05:15:40 +01:00