Commit graph

6005 commits

Author SHA1 Message Date
Wim Taymans
f0ab2bc1db bluez5: pass the route save property around
So that volumes are saved by the session manager.

Fixes  #995
2021-03-30 16:31:17 +02:00
Wim Taymans
dc3bf68aa2 acp: make sure we pass the save flag around
When we set the volume on a port, make sure we also set the save flag
so that the flag is put into the volume changed event and the session
manager can save it.

Fixes #995
2021-03-30 16:06:30 +02:00
Wim Taymans
c50c0b91c5 jack: improve registration callbacks
Pass the type to the alloc function to make things pretier.

Emit the client added only for the first client and the removed
callback for the last client. Things like pavucontrol will make
many nodes with the same name, which we map to the same client,
only when the last node is gone, we emit the client removed.
2021-03-30 12:57:38 +02:00
Wim Taymans
dd6a18d576 pulse-server: handle 0 id as default sink/source as well
Also handle 0 id as the default sink/source

See #756
2021-03-30 10:15:36 +02:00
Wim Taymans
efd52d633f examples: only use memfd_create when defined
See #987
2021-03-30 09:59:07 +02:00
Wim Taymans
5b2b256ecd alsa: initialize reserve array 2021-03-30 09:40:10 +02:00
Wim Taymans
43317f67ba a2dp-source: improve info parsing
Make sure we handle NULL info.
Simplify the property parsing.
2021-03-30 09:24:35 +02:00
Dmitry Sharshakov
e7f2f450ff bluez5: add parameter to use A2DP source as input 2021-03-30 09:21:12 +02:00
Wim Taymans
149471631e alsa: use higher ports for listening
Allocate up to the first 16 ports, use the last 2 ports and free the
first 14 ports.

This ensure our ports are not among the first ports so that port 128
and following are for normal apps, what is usually expected when
PipeWire is not running.

Fixes #951
2021-03-29 17:05:03 +02:00
Wim Taymans
51c700a655 media-session: only save routes with the save flag set
We only want to save the route properties when they were changed
by a user action.
2021-03-29 15:52:31 +02:00
Wim Taymans
f78be58568 stream: Add node.autoconnect stream.properties
If the node.autoconnect property is set in the stream.properties,
ignore the AUTOCONNECT flag value. This makes it possible to
force AUTOCONNECT either way.

See #964
2021-03-29 14:19:34 +02:00
Wim Taymans
ec0b2b8dd7 stream: use PIPEWIRE_AUTOCONNECT env variable
Use the PIPEWIRE_AUTOCONNECT environment variable to set the value
of the NODE_AUTOCONNECT property. This way, you can start any
stream based app with PIPEWIRE_AUTOCONNECT=false to disable
the session manager autoconnect.

See #964
2021-03-29 14:05:25 +02:00
Wim Taymans
3878ad921a pulse-server: handle 0 sink/source name or index as default
Some apps use 0 to get some sort of sink/source info. PulseAudio
likely has a source/sink at index 0 but PipeWire certainly does not.

Asking for 0 source/sink is always because of some hardcoded values
in the app and we can return the default source/sink without causing
any problems for other apps.

See #756
2021-03-29 13:50:37 +02:00
Wim Taymans
80ce2c94ac alsa: add start-delay parameters to sink
The start-delay adds extra silence to the buffer before starting the
playback. The idea is to have more time to adapt to the device
startup and set the timer more accurately.

See #983, #431
2021-03-29 13:20:14 +02:00
Wim Taymans
fda565864c alsa: limit headroom to buffer-size
We can never have more headroom that the total buffer-size so better
clamp this here.
2021-03-29 13:17:01 +02:00
Wim Taymans
30659c5f61 media-session: remove double ;; 2021-03-29 11:41:30 +02:00
Wim Taymans
73f50bb964 improve debug 2021-03-29 11:41:06 +02:00
Wim Taymans
74c6af1c55 jack: handle _port_get_buffer() on foreign ports
Some apps (ardour6) does a port_get_buffer() on a port that is not
its own port. This is not possible in PipeWire so make sure it
simply return NULL instead of crashing.

Fixes #988
2021-03-29 11:14:37 +02:00
Pauli Virtanen
ef74ef3654 bluez5: use the actual latency in a2dp-source 2021-03-28 14:20:42 +03:00
Pauli Virtanen
b19bd74b22 bluez5: adjust sco-source behavior as a follower
Don't try to drive as a follower, specify latency when AG, and
bump up number of buffers to allow process being called less often.
2021-03-28 14:15:26 +03:00
Pauli Virtanen
eb7df98cd6 pulse-server: minor fix 2021-03-27 21:53:49 +02:00
Wim Taymans
f314119aa9 alsa-plugin: add some checks to avoid using invalid values 2021-03-27 20:44:21 +01:00
Wim Taymans
c85a04fb49 tools: add some check when parsing the profile info
Fail when we can't parse the profile info to avoid using invalid
values.
2021-03-27 20:37:26 +01:00
Wim Taymans
ae22852a9b remove some useless checks
The variable was already dereferenced above and thus can't be NULL
2021-03-27 20:36:43 +01:00
Wim Taymans
e7ca1b474e acp: use the input ports for the input mappings 2021-03-27 20:16:04 +01:00
Wim Taymans
7c819320c7 tests: fix test of array values
Don't assign but test. Also test the right array index..
2021-03-27 20:10:01 +01:00
Wim Taymans
f26c642055 loop: initialize some variables
Just in case the read fails.
2021-03-27 19:23:34 +01:00
Wim Taymans
d81fc9bcb4 introspect: remove impossible case 2021-03-27 18:37:21 +01:00
Wim Taymans
222cffc850 jack: small cleanups and erro checks 2021-03-27 18:33:22 +01:00
Pauli Virtanen
2681b8236b media-session/pulse-server: more error checks + minor fixes 2021-03-27 19:16:19 +02:00
Pauli Virtanen
f330446291 bluez5: better error/malformed input handling
Safer parsing of AT commands, additional null and error checks.
2021-03-27 14:38:31 +00:00
Wim Taymans
f0a2b6d01f core: Always include fcntl
Fixes #833
2021-03-27 12:51:38 +01:00
Pauli Virtanen
54e06d9df0 bluez5: add additional aac encoder options, and implement optional vbr 2021-03-27 11:47:34 +00:00
Huang-Huang Bao
bd7dba617f
bluez5: fix SPA_PROP_bluetoothAudioCodec param prop setting
Remove 'const' from 'codec_id' declaration.
2021-03-27 09:27:33 +08:00
Wim Taymans
eaf3b3a3c9 remote-node: remove the mix from the port
We add the mix in init and remove it again when clearing.

See #973
2021-03-26 21:14:42 +01:00
Wim Taymans
ea5a830c8a global: always remove from the global map
We add the global to the global map to allocate an id. Remove the
global from the map in _destroy() instead of _unregister() to make
sure we always remove the global from the map, even if the global
was not registered.

See #973
2021-03-26 20:49:57 +01:00
George Kiagiadakis
511cb28e17 properties: clear SPA_DICT_FLAG_SORTED when adding/removing items
This allows calling spa_dict_qsort() externally on the dict,
ensuring that lookups will not break when items are added or removed.
2021-03-26 17:00:43 +00:00
Pauli Virtanen
51b0248d09 bluez5: update a2dp codec list when remote endpoints change 2021-03-26 16:59:07 +00:00
Pauli Virtanen
6b5b56bcc7 pulse-server: use transportCodec prop for bluez codec messages 2021-03-26 16:59:07 +00:00
Pauli Virtanen
a552655edc bluez5: add bluetoothAudioCodec property to device
Also make the "codecless" profiles to automatically switch to the codec
profiles.
2021-03-26 16:59:07 +00:00
Pauli Virtanen
6b0cf799c4 spa: add bluetoothAudioCodec property and type 2021-03-26 16:59:07 +00:00
Wim Taymans
e3323f7bca pulse-server: actually handle clearing of metadata
Make sure we also set the metadata back to NULL when the object is
removed.
2021-03-26 16:28:41 +01:00
Wim Taymans
98585e092c pulse-server: handle metadata remove
Also handle the case where metadata is removed. Set the pointer to
the object to NULL. This can happen when the session manager restarts.
2021-03-26 16:04:45 +01:00
Guillaume Desmottes
9690820e63 keys: document PW_KEY_APP_VERSION 2021-03-26 14:22:07 +00:00
Huang-Huang Bao
34c9f24d2a bluez5: autoconnect device profiles on startup
Auto-connect all paired & trusted devices on startup.
Since devices that already connected or powering off would reject the connecting requests, it should be fine with this behavior.
Also reconnect remaining profiles if only partial profiles are connected.
2021-03-26 14:15:55 +00:00
Wim Taymans
4112b34f4d pulse-server: also release and free the dbus name 2021-03-26 15:14:53 +01:00
Wim Taymans
109411bd2b pulse-server: add listener after success
Or else we might have freed the hook while it's still added to the
module.
2021-03-26 15:13:50 +01:00
Wim Taymans
69a8c302b1 media-session: clean up default node names 2021-03-26 15:13:23 +01:00
Wim Taymans
f6356a3441 media-session: handle node destroy during linking
Mark a node as busy linking while we call _create_links. The
_create_links method does a roundtrip and this might cause the node
to be destroyed. Set a flag when we notice this and avoid accessing
the destroyed object.
2021-03-26 13:07:28 +01:00
Wim Taymans
d805253c69 bluez5: don't warn when the services are not available
If oFono or hsphfpd are not installed, just log an info message
that they are not used. The native backend will work fine and we
don't want to log warnings.

See #971
2021-03-26 12:09:43 +01:00