Commit graph

5318 commits

Author SHA1 Message Date
Pauli Virtanen
368182d963 bluez5: rework sco i/o + autodetect mtu
Move SCO polling to a single place, and abstract mtu handling.
Autodetect suitable tx packet size based on rx, instead of relying on
the kernel providing correct values.
2021-01-04 19:19:16 +02:00
Wim Taymans
518365e350 pulse-server: fix module arg parsing
Parse the module arguments according to the pulseaudio syntax,
not our own syntax (which requires "" around a , delimter). Fixes
audio.position=FL,FR argument.

See #527
2021-01-04 17:25:28 +01:00
Wim Taymans
776147c125 jack: also find port by aliases
one can also use the aliases to connect ports, qjackctl does this.

Fixes #527
2021-01-03 21:25:55 +01:00
Wim Taymans
134f27a201 alsa: log warning for unhandled formats
When we can't enumerate a single supported format, log a warning with
the supported formats and access.

See #526
2021-01-03 08:52:59 +01:00
Pauli Virtanen
da2fa8a599 bluez5: setting this->transport = NULL should block data thread
Since the data thread accesses the spa_bt_transport, its destroy event
needs to sync with data thread to avoid races.

Also check transport is present in places that need it.
2021-01-03 06:59:00 +01:00
Pauli Virtanen
a5e52c07b1 sco-source: simplify mSBC frame parsing
Simplify mSBC buffer handling and syncing to frame headers to work
on a per-byte basis.

The previous code could terminate with buffer overrun if it encountered
multiple consecutive incomplete packets.
2021-01-03 06:56:03 +01:00
Pauli Virtanen
2760c151bd sco-source: fix bugs in buffer handling
Buffers sent to io should be marked outstanding, also in node_process.
port->current_buffer has to be initialized together with buffer lists.
2021-01-02 23:10:20 +02:00
Wim Taymans
0bf7b07d91 pulse-server: improve warning 2021-01-02 20:37:44 +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
columbarius
e871b761fe examples: only announce SPA_DATA_MemPtr 2021-01-01 21:12:00 +01:00
columbarius
f1ad7e2486 filter: Add mappable dataTypes to SPA_PARAM_BUFFERS_dataType if PW_FILTER_PORT_MAP_BUFFERS is set for inputs
This lets consumer just set SPA_DATA_MemPtr as their supported dataType and will add all by PW_STREAM_MAP_BUFFERS supported dataTypes, which are made available with the MemPtr API to the param
2021-01-01 21:12:00 +01:00
columbarius
9b7aa168cb stream: Add mappable dataTypes to SPA_PARAM_BUFFERS_dataType if
PW_STREAM_MAP_BUFFERS is set for inputs

This lets consumer just set SPA_DATA_MemPtr as their supported dataType
and will add all by PW_STREAM_MAP_BUFFERS supported dataTypes, which
are made available with the MemPtr API to the param
2021-01-01 21:12:00 +01:00
columbarius
016287f8f2 filter: create mappable_dataTypes bitmask 2021-01-01 21:12:00 +01:00
columbarius
51a7690cd1 stream: create mappable_dataTypes bitmask 2021-01-01 21:12:00 +01:00
columbarius
7ad1ee0cec examples: use dataType mask for consumers
Set the dataType mask to MemFd and MemPtr since we implemented the MemPtr API and get MemFd mapped by pipewire.
2021-01-01 21:12:00 +01:00
Pauli Virtanen
4f63db4936 sco-sink: clear port buffers when stopping
Dequeue all buffered data when stopping, so that it won't be output
later when starting next time.
2021-01-01 21:07:15 +01:00
Pauli Virtanen
33be40ac2e sco-sink: fix buffer reuse
When reusing buffers, do it in the same way as the other sinks.
The previous code did not set a valid next buffer for the i/o,
possibly causing it to hang.
2021-01-01 16:08:47 +02:00
Pauli Virtanen
d1b1b84935 sco-sink: don't stop timeouts if more data is needed
The sink timeouts need to continue even if there is currently not enough
data, as otherwise playback will stop.
2021-01-01 15:36:27 +02:00
Wim Taymans
d99ac615b2 conf: remove extra object level
We can parse this without the extra object level.
Use 4 spaces per level
2020-12-31 21:45:36 +01:00
Wim Taymans
d3f314cf82 media-session: remove -p option
Place properties in the config file now.
2020-12-31 21:25:38 +01:00
Wim Taymans
d09cb1f05b json: handle incomplete strings
If we run to the end of the string and the string is not closed,
assume it closed.
2020-12-31 17:16:32 +01:00
Wim Taymans
799bc13c85 json: set state on final bare string
When we run out of chars and are inside a bare string, set our state
so that the next round will continue instead of looping forever.
2020-12-31 17:07:03 +01:00
Wim Taymans
49d11acde0 daemon: rework config parsing
Replace config parsing for something more flexible based on json.
2020-12-31 16:44:35 +01:00
Wim Taymans
1bd90dc666 pipewire-pulse: escape the address string
It can contain special chars
2020-12-31 16:24:26 +01:00
Wim Taymans
0bf1aa8f45 media-session: load properties from config 2020-12-31 13:06:17 +01:00
Wim Taymans
85306917a2 media-session: try to load config from state dir first
First try to load conf from the user config directory and then from
the global config dir. Allows users to copy and modify a custom
config file.
2020-12-31 11:46:54 +01:00
Wim Taymans
20e9ec25be media-session: use simplified syntax
Now sure about this, it looks better but it's less compatible.
2020-12-31 10:19:48 +01:00
Wim Taymans
2fd35488c7 properties: just use the parser in all cases
We can just use the json parser to parse the old key=val
syntax as well now.
2020-12-31 10:12:09 +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
85cb85d440 json: improve parse_string
When doing parse_string on a non-string, copy the charaters
as they are without escaping.
2020-12-31 10:09:40 +01:00
Wim Taymans
49b17bca22 json: relax the parser some more
Allow bare strings with all non-special other chars.
Add # to comment a line till \n
Allow = as separator for keys
Fix end of string handling.

Now:

 {
   "#": "this is a comment"
   "key": "value",
   "foo": 24
 }

and

  {
    # this is a comment
    key = value
    foo = 24
  }

Parse to the same thing with less clutter.
2020-12-31 10:04:18 +01:00
Pauli Virtanen
c39ba8570e a2dp-sink/source: don't crash if transport went away 2020-12-30 16:34:23 +02: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
Huang-Huang Bao
389a125488
bluez5: fix connecting device with multiple adapters 2020-12-30 06:44:36 +08:00
Wim Taymans
cb8e627b1e media-session: use new properties method to load state 2020-12-29 13:30:04 +01:00
Wim Taymans
923e82df27 properties: Expose _update_string() method
Refactor an internal method and expose as _update_string() to
update an existing properties structure with a string representation.
2020-12-29 13:15:54 +01:00
Huang-Huang Bao
5f561334fb
bluez5: properly handle dbus signals
Fixes pipewire/pipewire#502.

Also move media application creating from filter callback to initialization.
Application object path and endpoint paths only need to be registered once.

Signed-off-by: Huang-Huang Bao <eh5@sokka.cn>
2020-12-29 14:42:15 +08:00
Georges Basile Stavracas Neto
56e2d6a3da filter, stream: Fix error check for DMA-BUF buffers
When a buffer is of type SPA_DATA_DmaBuf, the 'data' field
will be NULL - we instead have to check if the file descriptor
is valid. The current code, however, always checks if the
data is NULL, which gives a false positive for DMA-BUF buffers,
signaling an error when there is none.

Fix that by also checking if the buffer type is MemPtr together
with the NULL check of the 'data' field.
2020-12-28 15:58:38 -03:00
Wim Taymans
4b076549f7 alsa: allow override of channel map 2020-12-28 14:24:59 +01:00
Pauli Virtanen
036c10717d bluez5: refcount transport acquire and release, let it manage fd
Backends don't necessarily allow for opening the same device multiple
times, and it shouldn't be necessary.

Since source and sink are not necessarily both running at the same time,
refcount the transport acquire/release so that it knows to close the fd
only when no source/sink is running.

Let the transport manage the fd lifecycle, also closing it once it is
not needed.

Don't return the fd from acquire(), since each transport is associated
with a single socket fd.
2020-12-28 13:38:41 +01:00
Ihor Kalnytskyi
8942f6b402 launch: avoid autostarting pipewire-pulse systemd units for root
Long story short, this is something pulseaudio has since 2017 [1]. If
pipewire-pulse is aiming to be a drop-in replacement, the same behaviour
is probably expected.

I noticed that without this line I hit some issues with systemd socket
activation. In fact, it does not work properly at all. It probably has
something to do with the fact that pipewire-pulse is started for GDM
session and is somehow propagated down to my own user session.

[1] 24928d6b6f
2020-12-28 13:35:41 +01:00
Jarkko Sakkinen
738d9b7767 Rewrite "Building" section in INSTALL.md
Rephrase steps in "Building" section of INSTALL.md accurately together
with examples. Bunch of steps and concepts were not clearly specified,
e.g. how and when the build options ought to be used.

Finally, explain the role of autogen.sh correctly. It's just for
jhbuild. A more precise build instructions, on the other hand, help a
developer unfamiliar with the build system.

Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@iki.fi>
2020-12-28 13:33:45 +01:00
Jarkko Sakkinen
8406d36e85 autogen.sh: Remove git submodule *
Remove forgotten git submodule commands from autogen.sh.

Fixes: 59bdab94bc ("Drop git submodule structure")
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@iki.fi>
2020-12-28 13:33:45 +01:00
Wim Taymans
c84646b66f acp: add channel to string function
Add a function to convert the channel to a string and use that
instead of the unsafe one.

Fixes #519
2020-12-28 13:27:34 +01:00
Pauli Virtanen
509152108a sco-source: update clock position and duration at correct rate
The clock for sco-source may run at a different rate than the capture
rate. Update its position taking this into account.
2020-12-26 19:45:44 +01:00
Gabriel Ebner
ad9d485d1b gst: set node.name and node.description based on client-name property 2020-12-26 10:11:42 +01:00
Wim Taymans
921aba9edf media-session: fix help
Use enabled and disabled options from the implementation so that we
can parse them in help.
2020-12-25 19:47:34 +01:00
Wim Taymans
f28fb692a4 pw-top: handle io 2020-12-25 16:35:38 +01:00
Wim Taymans
ae8f8b25f6 pw-top: add new tool
Uses ncurses to display all drivers and nodes with their latency,
error count and DSP usage.
2020-12-25 16:33:54 +01:00