Commit graph

2075 commits

Author SHA1 Message Date
Huang-Huang Bao
f44d00424f bluez5: don't clear dynamic node flag from node id in volume changed handler
It causes transport state handler don't emit node removing info.
Fixes #1080.
2021-04-22 07:34:02 +00:00
Jonas Holmberg
ad0d7ef9f2 spa: Fix build without v4l2
libudev_dep was not required if only alsa was enabled.
2021-04-22 07:27:14 +00:00
Huang-Huang Bao
01f2c91b89 bluez5: fix HSP HS profile enumeration
HSP don't supports codec switching.
2021-04-21 08:58:48 +00:00
Huang-Huang Bao
30e4e56852 bluez5: enable HSP HS volume control
It's only enabled for HSP AG previously.
2021-04-21 08:54:10 +00:00
Huang-Huang Bao
f56d08297d bluez5: correct RFCOMM command to set HSP HS volume 2021-04-21 08:54:10 +00:00
Huang-Huang Bao
0dde4f8774 bluez5: cache a2dp volumes activation info
So we don't get a sudden boost on soft volumes when switching profile/codec.
2021-04-21 08:54:10 +00:00
Wim Taymans
5240850bc1 bluez: set device description to the bluez alias
Just like how PulseAudio does it.

Fixes #1064
2021-04-20 16:57:44 +02:00
Wim Taymans
a9b8aa27c1 media-session: improve bluetooth icon name
Move the icon we get from bluez to a separate property, it is not
a good icon to show.
Copy form factor from device to node properties.
Set device.bus in the device properties and copy it to the node
properties.
Use form factor and bus to make a nice icon-name for the node and
device.

Fixes #1064
2021-04-19 13:21:32 +02:00
Wim Taymans
18c4af9add libcamera: fix compilation
Fixes #1068
2021-04-18 20:34:24 +02:00
Huang-Huang Bao
98d1a3cb16
bluez5: improve bluetooth profile descriptions, make them more translatable 2021-04-18 16:53:45 +08:00
Nils Tonnätt
f47a7a8ea3 Rearrange libudev dependency
Make libudev dependency required if v4l2 feature option is set to enabled or
auto, or if alsa dependency is found or enabled through pipewire-alsa or alsa.
2021-04-18 07:58:49 +00:00
Wim Taymans
f95ecf95ba spa: don't overrun the input array
Read one byte less than the size of the buffer so that we still have
room in the buffer to append the 0 byte.
2021-04-17 19:43:55 +02:00
Huang-Huang Bao
edee633f96
bluez5: add property to enable hardware volume control 2021-04-17 19:35:46 +08:00
Huang-Huang Bao
387f7e327f
bluez5: add support for HSP/HFP hardware volume control
Only native backend is fulfilled.
2021-04-17 19:07:35 +08:00
Huang-Huang Bao
80f6ddf526
bluez5: add hardware volume support
Add necessary apis to bluez transport.
Add A2DP(AVRCP) absolute volume support. Source volume can only update to adapter node but not from due to AG nodes don't have route.
Since A2DP/HSP/HFP volume is already percentage itself, it has been mapped to pulseaudio volume then converting to linear volume.
2021-04-17 19:07:35 +08:00
Wim Taymans
f27ad659f8 spa: add property to force VM
Also add PIPEWIRE_VM to force a VM type.
2021-04-16 16:50:34 +02:00
Wim Taymans
ce828af9e1 spa: add cpu method to get the VM type
Make a method to query the VM we are running on.
2021-04-16 16:50:34 +02:00
Wim Taymans
fa3bd6b0e1 channelmix: support more than 19 channels
The channelmatrix was limited to the 19 known channels, leaving
only the first 19 channels usable.

Use the full 64x64 matrix instead and make sure to fill all 64
channels with the identity matrix in the case we need to copy or
distribute the matrix to unknown positions.

See #57
2021-04-16 10:56:24 +02:00
Wim Taymans
9c8a578e21 v4l2: don't select DmaBuf when the type mask is invalid
an invalid data type mask means that the caller did not explicitly
allowed DmaBuf so fall back to memptr or memfd.

Fixes #1054
2021-04-15 20:42:11 +02:00
Wim Taymans
cd79cdfb40 libcamera: use the data type mask to select a type
In alloc_buffers we need to look at the data types mask.
Select DmaBuf when not invalid and the DmaBuf flag is set, otherwise
select memptr.

See #1054
2021-04-15 20:40:16 +02:00
Wim Taymans
6e0ba50a9c libcamera: use the buffer datatype as the port type
In use buffers we need to respect the buffer data type.
2021-04-15 20:39:12 +02:00
Wim Taymans
036c54b043 Add i18n support for some more user-visible strings 2021-04-15 17:56:40 +02:00
Wim Taymans
c90332a6bf acp: make sure all descriptions are translated 2021-04-15 17:56:40 +02:00
Wim Taymans
09106151d3 acp: use the right profile name and description 2021-04-15 17:56:40 +02:00
Wim Taymans
043178e16b spa: improve i18n method
Make the method names match the fields in the method.
2021-04-15 17:56:40 +02:00
Huang-Huang Bao
d44955a199 a2dp: handle source transport destroy
Fix a use-after-free to transport if node is still running.
This revert part of a75fe69c8e.
2021-04-15 06:59:19 +00:00
Peter Hutterer
3de2d1c99c spa: use meson's install_subdir to install our header files
All files in spa/include are being installed anyway, so to avoid having to
list each file one-by-one let's use meson's install_subdir() to install all
of them in one go.
2021-04-15 06:57:00 +00:00
Peter Hutterer
223f20709d meson: replace join_paths(a, b) with a / b
More readable and from the meson reference manual:
(since 0.49.0) Using the/ operator on strings is equivalent to calling join_paths.
2021-04-15 06:57:00 +00:00
Peter Hutterer
8c369b0a58 spa: install i18n header
Added in 01fe9100e2, fails the ci's
check-missing-headers script
2021-04-15 13:48:25 +10:00
Wim Taymans
3babedec9c acp: get i18n interface from support and use it
Save the i18n interface in a global variable. Make acp use the support
interface when translating strings.
2021-04-14 18:03:46 +02:00
Wim Taymans
7ee23a046c acp: avoid warning for i18n string
spa/plugins/alsa/acp/channelmap.h:466:9: warning: format not a string
literal and no format arguments [-Wformat-security]
  466 |         pa_snprintf(s, l, _("(invalid)"));
2021-04-14 18:03:45 +02:00
Wim Taymans
01fe9100e2 spa: add i18n interface
The interface can be used to get translated strings.
2021-04-14 18:03:45 +02:00
Pauli Virtanen
20e383cea7 v4l2: remove device if inotify reports it's no longer accessible 2021-04-11 16:38:10 +00:00
Pauli Virtanen
bf3b5d4286 alsa: remove device if inotify reports it's no longer accessible
When the session becomes inactive (eg. user on active seat switched),
udev may make devices inaccessible.  In this case, pipewire should give
up the devices and close their open file descriptors.
2021-04-11 16:38:10 +00:00
Pauli Virtanen
277a9a2577 bluez5: retry initial HFP codec selection after a timeout
In case headset fails to reply with AT+BCS to the codec selection
following AT+CMER, try to retry the codec selection, and if it still
fails, assume the headset is configured for CVSD.
2021-04-11 16:34:33 +00:00
Pauli Virtanen
87e06783d1 bluez5: more cleanup on impl_clear
Remove dbus filters and close the dbus connection.  Closing the
connection lets BlueZ to clean up, so we don't call its unregistration
API.
2021-04-10 23:07:51 +03:00
Pauli Virtanen
87aa18edb1 bluez5: free rfcomm when device is freed
Avoids use-after-free if device gets freed before the corresponding
rfcomm.
2021-04-10 15:47:46 +00:00
Huang-Huang Bao
4292e8fe7e
a2dp: set marker bit on AAC header 2021-04-10 04:51:16 +08:00
Huang-Huang Bao
b874362c8e
a2dp: don't reset buffer on EAGAIN
Allow it to resend packet until next port data is received.
2021-04-10 04:50:34 +08:00
Wim Taymans
8251dc11cc spa: add type mappings for F32 and F32OE
so that we can refer to the native float32 format with F32 and the
other endian one with F32OE.
2021-04-09 11:38:54 +02:00
Frédéric Danis
136511fbc8 bluez5: backend-ofono: Enable SCO deferred socket
The incoming SCO socket should be first read to authorize the connection.
2021-04-08 14:18:17 +00:00
Barnabás Pőcze
923d88bd35 spa: support: log-impl: check the return value of strrchr()
Previously, the return value of `strrchr()` was not checked
in `spa_log_impl_logv()` which could cause a segmentation fault
in `snprintf()` if the `file` string argument does not contain
any directory separators ('/').

For example,

  ./build/spa/tools/spa-inspect ./build/spa/plugins/alsa/libspa-alsa.so

could run into this problem:

  Program received signal SIGSEGV, Segmentation fault.
  0x00007ffff7f1d505 in __strlen_avx2 () from /usr/lib/libc.so.6
  (gdb) bt
  #0  0x00007ffff7f1d505 in __strlen_avx2 () from /usr/lib/libc.so.6
  #1  0x00007ffff7e29408 in __vfprintf_internal () from /usr/lib/libc.so.6
  #2  0x00007ffff7e3a19a in __vsnprintf_internal () from /usr/lib/libc.so.6
  #3  0x00007ffff7e146f6 in snprintf () from /usr/lib/libc.so.6
  #4  0x0000555555558818 in spa_log_impl_logv (object=<optimized out>, level=SPA_LOG_LEVEL_INFO,
      file=0x7fffffffd4d0 "[I][", line=260, func=0x7ffff7ce8090 "error_node", fmt=<optimized out>,
      args=0x7fffffffd920) at ../spa/include/spa/support/log-impl.h:49
  #5  0x00007ffff7d8c69e in alsa_error_handler (file=<optimized out>, line=<optimized out>,
      function=<optimized out>, err=<optimized out>, fmt=<optimized out>)
      at ../spa/plugins/alsa/acp/alsa-util.c:866
  #6  0x00007ffff7cd6a8f in ?? () from /usr/lib/libasound.so.2
  #7  0x00007ffff7cdb55e in snd_use_case_mgr_open () from /usr/lib/libasound.so.2
  #8  0x00007ffff7d8940f in pa_alsa_ucm_query_profiles (ucm=ucm@entry=0x55555556ba28, card_index=0)
      at ../spa/plugins/alsa/acp/alsa-ucm.c:752
  #9  0x00007ffff7d6e3c2 in acp_card_new (index=0, props=props@entry=0x7fffffffdc50)
      at ../spa/plugins/alsa/acp/acp.c:1508
  #10 0x00007ffff7d29b7a in impl_init (factory=<optimized out>, handle=0x55555556b540,
      info=<optimized out>, support=<optimized out>, n_support=<optimized out>)
      at ../spa/plugins/alsa/alsa-acp-device.c:963
  #11 0x0000555555558429 in inspect_factory (factory=0x7ffff7daefa0 <spa_alsa_acp_device_factory>,
      data=0x7fffffffdcf0) at ../spa/tools/spa-inspect.c:231
  #12 main (argc=<optimized out>, argv=<optimized out>) at ../spa/tools/spa-inspect.c:309

as in that particular case, the filename was returned by libasound,
and it was just "parser.c".

Furthermore, separate the static variable from the rest, and apply
the `const` qualifier to the pointers in the `levels` array.
2021-04-07 15:55:44 +02:00
Pauli Virtanen
026e3882d2 bluez5: remove battery when RFCOMM connection drops
There won't be further battery level updates when RFCOMM connection is
down, so remove the battery then.

Fix minor things with canceling the provider registration.
2021-04-05 15:04:16 +00:00
Dmitry Sharshakov
97b01ed9b0 bluez5: add a property to select default profile 2021-04-04 08:43:09 +00:00
Wim Taymans
9562cd56a2 alsa-seq: tweak port names some more
Remove the client id, it can change and is otherwise not generally
useful. Move the direction with the port.

Fixes #1007
2021-04-01 19:43:28 +02:00
Dmitry Sharshakov
e3f344b3fa bluez5/native: send correct AT+CMER HFP HF command
Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com>
2021-04-01 19:12:49 +03:00
Wim Taymans
b318a9e1d3 support: add right property id 2021-04-01 10:08:47 +02:00
Wim Taymans
339927ac76 spa: allow variable format, rate, channels, size, framerate
Use 0 values to skip adding the values to the format param, which
leaves them variable.
2021-04-01 09:58:08 +02:00
Huang-Huang Bao
63281413bd
a2dp: fix a problem in b9d1b818 2021-03-31 19:33:21 +08:00
Huang-Huang Bao
b9d1b818d5 a2dp: guard against LDAC quality value, add labels for LDAC quality prop info 2021-03-31 11:14:58 +00:00