Commit graph

70 commits

Author SHA1 Message Date
Wim Taymans
d603c1086a media-session: (re)schedule rescan after new pending operation
Every time a new operation is started, schedule a rescan. This
ensures that there are no more pending actions before the policy
module scans the nodes.

This has the effect that all devices and nodes are up to data and
ready to be used by policy-node.

Fixes #789
2021-03-08 13:20:02 +01:00
Wim Taymans
1642e5220f media-session: sanitize device names as well
See #827
2021-03-04 12:45:35 +01:00
Wim Taymans
aea79cd79c media-session: sanitize description
Because we use the description as the JACK name, remove the : so
that it looks somewhat ok in more cases.
2021-02-17 13:12:22 +01:00
Wim Taymans
b23e33c99f media-session: only replace : with space for node.nick 2021-02-13 07:17:55 +01:00
Wim Taymans
062911640c media-session: sanitize name and nick
Replace unwanted chars in the name with _. This makes it compatible
with pulseaudio names and avoids problems with regex.
Replace unwanred chars in the nick with ' '. This ensures JACK
clients don't receive ':' in the device names, which cause it to
fail when parsing the ports.

See #714 and #130
2021-02-12 20:47:41 +01:00
Jonas Holmberg
d624ed26f4 media-session: add alsa.reserve property to alsa-monitor 2021-02-09 18:09:33 +00:00
Wim Taymans
739f3b9f7f media-session: disable JACK device by default
It is most likely to fail right now.
2021-02-09 17:37:08 +01:00
Wim Taymans
5e15411af4 alsa-monitor: use max channels on non-ACP devices
Otherwise, they might still negotiate to something less than the
max channels.
2021-02-01 15:16:39 +01:00
Wim Taymans
2c4c78c51e media-session: add alsa.jack-device property to alsa-monitor 2021-01-20 13:48:06 +01:00
Wim Taymans
9b9b85ddbf alsa: put card name in udev monitor event
So that we can use it to construct a good name for the card.

Fixes #524
2021-01-17 11:35:27 +01:00
Wim Taymans
de851018c1 media-session: fall back to card_name for description
Also try to use the alsa.card_name property for the description if
there is nothing else.

Fixes #524
2021-01-13 19:49:24 +01:00
Wim Taymans
fac80e76d2 media-session: add conf file for v4l2 and bluez as well 2021-01-12 20:42:58 +01:00
Wim Taymans
24c7f45118 alsa-monitor: also try card_name as description
See #524
2021-01-11 15:23:59 +01:00
Wim Taymans
b4f359ed77 media-session: ensure unique node names
Fixes #525
2021-01-02 20:07:27 +01:00
Wim Taymans
498b4bd080 media-session: ensure unique device.name
See #525
2021-01-02 20:00:03 +01:00
Wim Taymans
f29bc42b4d media-session: improve conf parsing
Just use parse_string to convert the value.
2020-12-31 10:11:10 +01:00
Wim Taymans
24c68b0067 media-session: add config files
Remove -e and -d options
Manage modules in media-session.conf
Add alsa-monitor.conf that can match node/device properties with
a regex and update properties on it. All previous configuration and
more cane be done with this.
2020-12-30 13:15:08 +01:00
Wim Taymans
d7a2b569e4 alsa-monitor: make no-auto-port/profile instead
auto-port and auto-profile are enabled by default so make a no-auto
version to disable.
2020-12-22 13:12:12 +01:00
Wim Taymans
a8937413e6 acp: add options to disable profile and port switching
See #498
2020-12-22 13:08:14 +01:00
Wim Taymans
bec950440b alsa-monitor: add wildcard to disable hardware-mixers 2020-12-11 10:10:05 +01:00
Wim Taymans
19a67a2da5 media-session: add option to disable hardware volume
See #426
2020-12-01 10:45:24 +01:00
Wim Taymans
81ca70af9b alsa-monitor: avoid crash in release
Only try to release the device when we have a proxy.

Fixes #310
2020-09-28 18:23:23 +02:00
Wim Taymans
3f844f7b09 media-session: make the same node name as PulseAudio
Fixes #299
2020-09-22 12:59:13 +02:00
Wim Taymans
cf2c32f0a9 alsa: rework device reservation
Always try to first reserve the device name and then start the probing
so that we can be sure that the device is not in use.
2020-09-21 15:23:36 +02:00
Arun Raghavan
272624fe83 alsa-monitor: Don't ignore device reservation failure
We were ignoring the reservation status, which is incorrect as we might
not have succeeded in grabbing the device.
2020-09-19 11:02:04 +00:00
Arun Raghavan
2acfa0ee10 alsa-monitor: Lower our device reservation priority
For now, let's lower our priority in device reservation below that of
PulseAudio (which currently uses a priority of 0), so that it takes
priority while contending for the same device.
2020-09-19 11:02:04 +00:00
Wim Taymans
e71936f870 Improve naming
master -> driving
priority_master -> priority_driver
segment_master -> segment_owner
2020-08-06 13:49:33 +02:00
Wim Taymans
66816580bc alsa: improve configuration of NICK 2020-08-03 18:16:53 +02:00
Wim Taymans
79937676a4 alsa: add profile description in node description 2020-08-03 16:28:09 +02:00
Wim Taymans
8e6b276d51 alsa-monitor: parse device events
Parse the device events and set the Props from the ObjectConfig
as the Props param on the node.
This propagates the software volume from the device to the
node.
2020-07-06 17:26:01 +02:00
Wim Taymans
0bbc25e3e2 media-session: add option to enable acp device 2020-07-06 12:51:38 +02:00
Wim Taymans
1612f5e4d2 alsa-acp: Add libacp based card device
libacp is a port and wrapper around the pulseaudio card profile code.
It uses a set of templates for construct a card profile and mixer port
settings. It also has support for UCM when available for the hardware.
2020-07-06 12:20:09 +02:00
Wim Taymans
ed31ca30cd media-session: improve cleanup of objects
Don't try to use the proxy destroy event to destroy the objects.
It is not called automatically anymore, only when we call
pw_proxy_destroy() ourselves.

Destroy the proxy objects when we destroy the session managed
object instead, either when the global is removed or when we
explicitly call _destroy()

Add an object free signal to clean up final resources after the
proxies have been destroyed, like closing libraries.

Track and destroy our link proxies.
2020-06-04 17:41:01 +02:00
Wim Taymans
bf483242eb alsa-monitor: don't use NULL device reserve 2020-05-28 18:03:27 +02:00
Wim Taymans
d22cb01c6e alsa-monitor: remove listener after destroy
The destroy event will free all the nodes of the device.
2020-05-08 17:08:53 +02:00
Wim Taymans
5e99e7da49 alsa-monitor: remove timeout in destroy 2020-04-29 17:12:22 +02:00
Wim Taymans
d3634aca7e media-session: rework device reservation
Monitor the device reservation objects and mark the device available.
Don't select nodes from devices that are not available.
Acquire the device reservation when a device starts.
Release the device reservation when we suspend the device again.
2020-02-19 18:15:57 +01:00
Wim Taymans
f792c3f536 fix some segfaults 2020-01-16 16:47:01 +01:00
Wim Taymans
c624ca7591 alsa-monitor: don't crash when dbus connection failed 2020-01-14 10:53:12 +01:00
Wim Taymans
96d4ec3207 use defined key for factory.name 2020-01-09 09:46:04 +01:00
Wim Taymans
b312e77385 Make simple node policy
Make it possible to run the session manager without endpoint
modules. Add a simple node policy that links nodes.

Move the session-manager implementation and startup of the
endpoint monitors to a separate module.

Handle async set_param on the device
2020-01-07 17:19:09 +01:00
Wim Taymans
f391353c7f Make interface types a string
This is more in line with wayland and it allows us to create new
interfaces in modules without having to add anything to the type
enum. It also removes some lookups to map type_id to readable
name in debug.
2019-12-19 13:36:04 +01:00
Wim Taymans
147f488514 media-session: improve cleanup 2019-12-18 12:15:03 +01:00
Wim Taymans
05f93cd750 media-session: improve cleanup 2019-12-17 10:47:31 +01:00
Wim Taymans
f06fc5a62b media-session: add sync_update
Add method to only emit the update event when all actions up to
the sync point completed.

Update the available bits on NODES/PORTS/STREAMS/ENDPOINTS
2019-12-16 13:38:16 +01:00
Wim Taymans
1317ca140c pass spa_dict around as config
Don't pass pw_properties around when we simply need to pass around
config info, only use pw_properties when used to construct an object
that keeps the properties.
2019-12-13 11:26:05 +01:00
Wim Taymans
f1eb5f6046 pw_device_proxy -> pw_device 2019-12-11 15:00:41 +01:00
Wim Taymans
d70a47b7fe move proxy implementations in their own file
Rearrange headers
2019-12-11 10:58:51 +01:00
Wim Taymans
8ea78c2e3f pw_core -> pw_context
The proxy API is the one that we would like to expose for applications
and the other API is used internally when implementing modules or
factories.

The current pw_core object is really a context for all objects so
name it that way. It also makes it possible to rename pw_core_proxy
to pw_proxy later.
2019-12-10 18:19:56 +01:00
Wim Taymans
125fcb5660 session-manager: remove obsolte _set_id
media-session: Wait for devices to appear and be bound before setting
the profile on the device. Then wait for all the nodes to appear
before attempting the create endpoints on the device.
2019-11-29 13:34:09 +01:00