Commit graph

5282 commits

Author SHA1 Message Date
Frédéric Danis
677f122f1d bluez5: Split RFComm from spa_bt_transport
RFComm channel should not be part of the spa_bt_transport as this one may
change during HFP connection.
2021-01-12 11:21:55 +01:00
Frédéric Danis
00cce32514 bluez5: Rename backend-hsp-native to backend-native 2021-01-12 11:21:55 +01:00
Wim Taymans
219248d43e connection: guard against NULL 2021-01-12 10:13:02 +01:00
Pauli Virtanen
84ebce147a module-protocol-native: add test for reentering 2021-01-12 10:13:02 +01:00
Pauli Virtanen
23f010541f module-protocol-native: make demarshaling safe vs. reentering
The message structures returned by pw_protocol_native_connection_get_next
point to data that is contained in the buffer of the connection.

The data was invalidated when pw_protocol_native_connection_get_next was
called the next time, which made the connection loop non-reentrant, in
cases where it was re-entered from demarshal callbacks.

Fix this by allocating new buffers when reentering and stashing the old
buffers onto a stack. The returned message structure is also stored on
the stack to make lifetimes to match.
2021-01-12 10:13:02 +01:00
Nicolai Syvertsen
09a690b123 spa-acp-tool: fix set-volume vol argument parse 2021-01-11 22:26:30 +01:00
Wim Taymans
5f66650f7c daemon: don't pass (null) as argument 2021-01-11 20:40:26 +01:00
Wim Taymans
b3f8a4b99b acp: update pcm proplist for UCM as well
Update the properties we get from the pcm handle right before we
close the handle.
Also set properties on the UCM devices.

See #524
2021-01-11 15:39:48 +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
9862560f55 impl-core: avoid destroying the core object
Avoid destroying id 0 and return some errors.

See #560
2021-01-11 13:19:07 +01:00
Wim Taymans
6a9552a4ac acp; fall back to default when profile-set is not accessible 2021-01-11 13:05:11 +01:00
Wim Taymans
ac861a86c0 acp: make it possible to pass properties to test tool
So you can do:

spa-acp-tool -c 1 -p 'device.profile-set=behringer-umc202.conf'
2021-01-11 11:44:13 +01:00
Wim Taymans
878240e30a pw-dump: add simple monitor option (-m) 2021-01-11 10:24:39 +01:00
Wim Taymans
dea4836203 alsa-pcm: always start device
Also start device after writing silence.

Fixes #558
2021-01-11 07:11:09 +01:00
AsciiWolf
c61c988225 Add Czech translations 2021-01-10 21:26:52 +01:00
Wim Taymans
4d15df6f24 bluez5: improve device and node properties
Set form factor, name routes based on form factor.
Improve profile names
Make card and node names like pulseaudio, with bt address in them.
Fill in port type in the route info.

Fixes #544
2021-01-10 20:56:27 +01:00
Jarkko Sakkinen
7aabd50d1e udev: Make Udev optional
In order to further simplify "unprivileged" builds, add "udev" boolean,
which make installing Udev rules optional.

I.e. without requiring any ugly hacks (mktemp -d), an privileged build
capable of running PulseAudio and JACK applications, can be configured
trivially:

meson --prefix=~/.local build
meson configure build -Dsystemd-user-unit-dir=$HOME/.config/systemd/user
meson configure build -Dpipewire-alsa=false
meson configure build -Dudev=false

Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@iki.fi>
2021-01-09 23:42:05 +02:00
Wim Taymans
86576f1e63 bluez5: don't crash when proxy is not created yet
We export a node and get a handle (of type ClientNode). The
session manager then later creates a proxy for the new object. We
can't assume the proxy is created yet when the device emits an
event so check for this.

This is a temporary bandaid. We should likely use get_node() to
create our own proxy for this purpose.

Fixes #552
2021-01-09 20:07:32 +01:00
Pauli Virtanen
d87f838e09 media-session: don't write to freed memory in sm_object_destroy
Unref of node->handle may also free obj, if it was created by
init_object.
2021-01-09 20:37:01 +02:00
Wim Taymans
7ae1ea1420 pulse-server: set default channel_map
Set a default channel map when not otherwise set. Makes pulseeffects
work.
2021-01-09 12:46:00 +01:00
Jarkko Sakkinen
ec9dfe72ff systemd: Add systemd-user-unit-dir override
Add a new build option 'system-user-unit=dir', which can be used to
override the pkg-config default value.

By doing this, it becomes more practical to make a local unprivileged
build of the latest PipeWire:

$ meson --prefix=~/.local build
$ meson configure build -Dpipewire-alsa=false
$ meson configure build -Dsystemd-user-unit-dir=~/.config/systemd/user
$ meson configure build -Dudevrulesdir="`mktemp -d`"
$ ninja -C build install

For a local build enabling ALSA plugins is not plausible.

JACK needs a simple addition to the ~/.profile:

export LD_LIBRARY_PATH=$HOME/.local/lib/x86_64-linux-gnu/pipewire-0.3/jack

Finally, the genuine PulseAudio must be masked and local services
enabled:

systemctl --user enable pipewire.socket
systemctl --user enable pipewire-pulse.socket
systemctl --user mask pulseaudio.service

A sanity check [*] shows that nothing has leaked out of the home
directory (even though at least on my Debian 10 system PolKit still
asks for authorization during the meson build).

Not perfect, but lowers a barrier to run the development version a lot,
as that does not anymore to trash your system.

[*]  find / -name "*pipewire*" \! -path "/home/*"  \! -path "/var/lib/flatpak/*" 2> /dev/null

Signed-off-by: Jarkko Sakkinen <jarkko@suppilovahvero.lan>
2021-01-09 12:11:22 +01:00
Pauli Virtanen
7ca568db86 bluez5: don't crash if validate_config fails
transport->device_link has to be set when transport->device is not NULL
2021-01-09 12:08:47 +01:00
Sebastian Apel
cbea225abd Improved workaround (v3): adapt processing of mSBC to handle bogus 'all-zero' packets (see #549) 2021-01-09 10:21:45 +00:00
Wim Taymans
540011f1e3 test-resample: fix unit test
Caller should not have to resubmit old samples anymore.

Fixes #551
2021-01-09 10:55:51 +01:00
Wim Taymans
0c2b4df8e5 alsa: implement _delay to get smoother timestamps
Fixes #536
2021-01-09 10:50:39 +01:00
Wim Taymans
d1f9966a77 resample: implement methods we now call 2021-01-08 17:43:13 +01:00
Wim Taymans
f94d2e7da5 pulse-server: use rate match to read from ringbuffer
Use the rate match io are to read the exact amount of samples we
need for this cycle from the ringbuffer. We can then request lower
latency.

There will also be less buffering in the audioconverter, which makes
our timestamps more accurate.
2021-01-08 17:22:15 +01:00
Wim Taymans
3f0cadfa00 alsa: use rate_match to read exactly what we need
Use the rate match from the resampler to get the exact amount
of samples we need to provide in this cycle.
2021-01-08 16:55:24 +01:00
Wim Taymans
03430da64a stream: notify about port IO areas as well 2021-01-08 16:52:42 +01:00
Wim Taymans
7f007b6bca resample: tweak the resampler to keep delay number of samples
Instead of requiring the upstream node to resubmit the delayed
samples, keep the samples ourselves. The benefit is probably too
small to measure but it simplifies things a lot.
2021-01-08 16:35:26 +01:00
Wim Taymans
84eed9ef6f pw-cat: use none as default latency for record
Don't force the record latency to the large latency we use for playback
(100ms) but set it to none, which means use defaults.
2021-01-08 16:30:57 +01:00
Wim Taymans
7e9ab8b457 resample: first resample the data, then apply the new rate
Else we might not have enough input samples for the new rate.
2021-01-08 13:17:06 +01:00
Wim Taymans
4440ede41c bluez5: add SBC XQ support with a config option 2021-01-08 13:00:44 +01:00
Wim Taymans
860389492b a2dp: fix size check 2021-01-08 12:54:43 +01:00
Wim Taymans
9a03f8769e pw-cli: handle unquoted strings
Use parse_string for everything else to use it as a string value.
Make it possible to use short name for the param.

so now you can do:

pw-cli set-param 55 Props '{ channelVolumes: [ 0.3, 0.3 ], channelMap: [ FR,FL ] }'
2021-01-08 12:23:02 +01:00
Rafael Kraut
4340f84776 fix: update some typos in README.md 2021-01-08 10:11:21 +00:00
Wim Taymans
1084306f4d disable i18n stuff, something doesn't work on bots 2021-01-08 11:04:03 +01:00
Wim Taymans
e9c7a3bb4a po: add missing file 2021-01-08 10:59:28 +01:00
Wim Taymans
ef6bb2195a pw-dump: dump all objects
Dump all objects, not only the ones for which we have a class.
2021-01-08 10:51:37 +01:00
Wim Taymans
3c2794dcc9 add i18n support 2021-01-08 10:26:46 +01:00
Fran Diéguez
a47e3584d3 Add Galician translations 2021-01-08 09:43:19 +01:00
Wim Taymans
e91fbd2721 bluez5: Implement routes
Implement routes on the device. This makes it possible for the
session manager to restore the device volumes.
Use validate_config to get the negotiated channels for the route
volumes.
2021-01-07 18:10:22 +01:00
Wim Taymans
5bb7a0f573 a2dp-codecs: add settings to codec init function
To make it possible to add extra config options in init.
Also add a method to update settings in a codec.
2021-01-07 17:39:39 +01:00
Wim Taymans
deb3fa1d9b media-session: handle device events
The object config event should set props on the object.
2021-01-07 17:30:10 +01:00
Wim Taymans
ece8a95c29 bluez5: improve a2dp codec api
Pass dict to select_config to influence the selection
Make a method to validate a config.
Add spa_dict to the codec to pass more info around.
2021-01-07 17:28:49 +01:00
Wim Taymans
1ca3998b41 alsa: remove unused field 2021-01-07 17:27:36 +01:00
Wim Taymans
e61f571e22 Revert "Update of a2dp-codec-sbc.c to achieve SBC XQ quality in dual channel, with fall back to standard Joint Stereo mode"
This reverts commit 4e1cbef687.

This needs some more work
2021-01-07 14:58:36 +01:00
JP Guillemin
b17db2cebc bluez5: add SBC XQ readme 2021-01-07 09:54:16 +01:00
JP Guillemin
4e1cbef687 Update of a2dp-codec-sbc.c to achieve SBC XQ quality in dual channel, with fall back to standard Joint Stereo mode 2021-01-07 09:39:05 +01:00
Pauli Virtanen
a81158f3d5 bluez5: after registering a2dp profiles, connect them to connected devices
After registering a2dp profiles on startup, call
org.bluez.Device1.ConnectProfile on already connected devices, if
applicable.
2021-01-06 17:36:34 +02:00