Commit graph

5232 commits

Author SHA1 Message Date
Wim Taymans
18b5199d44 alsa: add read/write access mode
Add support for read/write access mode when mmap is not available.

See #526
2021-01-05 17:48:09 +01:00
Wim Taymans
c430b1de58 jack: move monitor ports after playback ports
Enumerate monitor ports after their playback ports, like how
jack does this.

See #527
2021-01-05 15:38:52 +01:00
Arnaud Ferraris
0d6ba3a032 alsa-acp-device: make sure EnumRoute is updated on profile change
When using UCM profiles, ports can have different priorities between 
profiles, meaning EnumRoute should be updated too.
2021-01-05 14:34:43 +00:00
Arnaud Ferraris
a39bfa4995 acp: make sure each port's priority is updated when switching profiles
UCM profiles can use the same ports, but with different priorities. One 
good example is a phone, having an earpiece and a speaker:
- the default profile will put a higher priority on the speaker
- the "voice call" profile will put a higher priority on the earpiece

When switching to the "voice call" profile, we want pipewire to take 
into account the priority change, so that the earpiece gets the highest 
priority and is selected by default.

As the ports have the same name in both profiles, we have a single 
instance of each port in memory, and therefore need to trigger a port 
update when the profile is changed, so that the priority set by the new 
profile is used.

Moreover, the UCM code updates only the priority inside the 
`pa_device_port` structure, so this commit also makes sure we reflect 
this value into the `acp_port` structure when enabling a device.
2021-01-05 14:34:43 +00:00
Wim Taymans
b2b45abe01 0.3.19 2021-01-05 13:39:10 +01:00
Wim Taymans
87292432b7 alsa: add option to configure period-size
api.alsa.period-size can be set to something else than 1024 with
this config option.
2021-01-05 12:44:10 +01:00
Wim Taymans
bad9a36a84 rtkit: set nice-level to -11 by defaukt
To mimic pulseaudio.
2021-01-05 12:33:41 +01:00
Wim Taymans
62065ac263 acp: update to latest 2021-01-05 10:08:31 +01:00
Wim Taymans
962bf4d897 media-session: clean proxy and handle in destroy
After we called destroy on the handle and proxy we should not
try to access them anymore so we set them to NULL.

See #534
2021-01-05 10:05:30 +01:00
Pauli Virtanen
307d62484c sco-source: don't crash in do_stop if transport disappeared 2021-01-05 00:31:36 +02:00
Pauli Virtanen
b76bcdc70d pulse-server: NULL means default only if id==INVALID
The default values also only apply for sources/sinks which have
defaults.
2021-01-04 23:54:48 +02:00
Nicolai Syvertsen
7a82be3361 pw-top: Fallback to app name if no node name/desc exists 2021-01-04 19:26:44 +00:00
Pauli Virtanen
5a22d0bfca bluez5: delay SCO transport releases in case they get reacquired
SCO socket connect may fail with ECONNABORTED if it is done too soon
after previous close. To avoid this in cases where nodes are toggled
between stopped/started rapidly, postpone release until the transport
has remained unused for a time. Since this behavior appears common to
multiple SCO backends, do it for all SCO backends.
2021-01-04 20:37:25 +02:00
Pauli Virtanen
073217ae63 bluez5: remove mtu hardcoding
Hardcoding MTU is no longer necessary with the reworked SCO i/o, which
guesses suitable write sizes based on rx.
2021-01-04 19:19:16 +02:00
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