Commit graph

5749 commits

Author SHA1 Message Date
Wim Taymans c8fd34a41d metadata: store default-nodes as JSON
Don't just store the id in the metadata but a JSON object with
the node name. This makes it possible to easily introspect the
metadata and also extend the metadata with more fields later.

Instead of matching the metadata id to the global ids we now
have to match it against the name.
2021-03-05 17:37:12 +01:00
Wim Taymans 8d5cc7013d conf: write valid JSON by putting , between keys
Separate keys with , to make a valid json file
2021-03-05 12:40:28 +01:00
Wim Taymans b40397d986 media-session: check metadata before using it
The session manager might be configured without metadata support
so check this before attempting to use the metadata. It's not
really a problem because the default sink/source can only be
changed with the pulseaudio API, which activates metadata.
2021-03-05 10:34:27 +01:00
Wim Taymans 93002ecd11 media-session: remove unused prefix from load/save state
The prefix was used to filter the properties when loading and
saving but since the conversion to the core provided functions, this
feature is not longer available.

It's not exactly a problem, we could implement the filtering ourselves
afterwards but there is little point because we just ignore the unknown
items and never write invalid items.
2021-03-05 09:23:19 +01:00
Wim Taymans e89e87ba94 alsa-seq: generate the same name as a2jmidid
It is more descriptive and more compatible.
If we change Midi-Bridge to a2j, some apps will parse our port names
in a special way, even (catia).
2021-03-04 20:40:07 +01:00
Barnabás Pőcze 3c01cfe8f8 protocol-native: connection: fix errno check condition
The branch should be taken if errno is neither EAGAIN,
nor EWOULDBLOCK.

Previously,

  if (errno != EAGAIN || errno != EWOULDBLOCK)

would be taken for all values of errno if EAGAIN != EWOULDBLOCK.
(Except for the ones that are filtered out before.)

Fix that by changing `||` to `&&`.
2021-03-04 19:18:19 +00:00
Wim Taymans 49846d7550 alsa-seq: only mark hardware ports as terminal/physical
Use the caps of the port to set the right flags on the new port.
We only want to put the terminal/physical flags on ports that look
like hardware ports. Port created by clients should not have this
flag.
2021-03-04 20:16:28 +01:00
Wim Taymans 0ad603375f jack: keep midi ports on the midi-bridge client
Separating them causes problems because there is no actual
client for the resulting ports then.
2021-03-04 18:06:07 +01:00
Wim Taymans d98d947e54 jack: handle "default" server name 2021-03-04 18:02:11 +01:00
Wim Taymans 68f6c75cae 0.3.23 2021-03-04 16:21:21 +01:00
Wim Taymans 1642e5220f media-session: sanitize device names as well
See #827
2021-03-04 12:45:35 +01:00
Wim Taymans 184bdbeb4c alsa-plugin: Implement query_chmaps again
Return a list of our supported channel positions.

Fixes #825
2021-03-04 11:56:28 +01:00
Wim Taymans 28b28ef92c pipewire: align the spa_handle to 8 bytes
See #835
2021-03-04 10:58:35 +01:00
Wim Taymans a4b0b9afe5 build: check for getrandom and sys/random.h
Fixes #833
2021-03-04 10:57:48 +01:00
Wim Taymans 3af768f124 resample: take into account the number of queued input samples
Take the queued input samples into account when calculating the
required input size. This can be 0 when there is still enough
data queued in the input for another period.

Handle 0 read_size in alsa-source and make it push out a 0 buffer,
this will then drain the resampler and make it ask for a new buffer
size. This makes the transition from one period to another more
seamless for the resampler.

Fixes #805
2021-03-04 10:27:44 +01:00
Wim Taymans e15104c5cb alsa: make resync less aggressive 2021-03-04 10:20:08 +01:00
Wim Taymans c135f9c7ee alsa: always set read_size 2021-03-04 10:13:26 +01:00
Jonas Holmberg 29be757598 pipewire-alsa: fix drain for capture
Since pw_stream doesn't call the drained callback after flush for
capture it has to be called explicitly from process.
2021-03-03 19:00:13 +00:00
George Kiagiadakis 1b370f2cad ci: enable building most optional features, so that they are tested 2021-03-03 18:57:48 +00:00
George Kiagiadakis 9168ec4335 backend-hsphfpd: fix compilation 2021-03-03 18:57:48 +00:00
Wim Taymans 67b431cfca rtkit: boost default rt.prio to 88
See #685
2021-03-03 19:56:22 +01:00
Wim Taymans e210c5f21c alsa: include headroom in silence buffers 2021-03-03 17:15:23 +01:00
Wim Taymans a36af57899 alsa: reschedule the timeout based on new quantum
Always reschedule the timeout based on the new quantum. If the
quantum descreased we want to wait some more until the buffer only
has the new quantum of samples left.
2021-03-03 17:01:12 +01:00
Wim Taymans 3bcc59120a alsa: fix timeout adjustment
Only adjust the timeout when the quantum increases so that we end u
with exactly the number of samples of the new quantum.

Suppose we are handling a quantum of 1024, we wake up with 1024
samples in the device, we now notice a quantum of 8192 and will pull
in the 8192 samples, we then have 1024 + 8192 samples in the buffer.
Schedule a timeout for 1024 samples so that we end up in the timout
with 8192 samples in the device.
2021-03-03 16:55:40 +01:00
Wim Taymans 052bc85dad jack: ship our own jack headers and build against them 2021-03-03 15:54:48 +01:00
Wim Taymans 8981e11c53 alsa: various improvements
Remove some magic constants that are not needed anymore with the
headroom.
Clamp the error to some reasonable value so that we don't adjust the
rate too much but still apply all of the correction calculated by the
dll.
Remove the bandwidth adjustment.
Also update the matching and resample fields when we reassign the
node to a new driver. This could cause the new follower to not activate
the adaptive resampler and get out of sync.
2021-03-03 15:40:10 +01:00
Wim Taymans c8804c3d6d context: make a new node.max-latency property
node.latency also influences the pipeline latency in that it can
push the latency above the default value.
node.max-latency, instead, is only used to clamp the final latency
of the pipeline.
2021-03-03 13:27:48 +01:00
Pauli Virtanen 4389e44903 bluez5: emit props change events only if values actually changed
This may avoid infinite loops if parameters are being set based on events
sent by parameter changes. It's also what alsa-acp devices do, so bluez5
should follow.
2021-03-02 23:46:27 +02:00
Pauli Virtanen 302282ef59 bluez5: set channel information for hfp/hsp transports
Fixes volume problems.
2021-03-02 22:20:44 +02:00
jasker5183 04a13471fb Update issue.md 2021-03-02 19:37:02 +00:00
jasker5183 c32c532e2a Update bluetooth issue.md 2021-03-02 19:33:59 +00:00
Arnaud Ferraris 8b97416417 json: add integer parsing functions
While most numeric values used in pipewire are floating-point values, it 
can still be useful to be able to directly parse integer values.
2021-03-02 18:06:55 +01:00
Huang-Huang Bao 97cc27600a bluez5: add missing function defination 2021-03-02 14:08:14 +00:00
Wim Taymans 0aadc0450d alsa: implement poll_descriptors
In there we can evaluate the poll fd and make sure it blocks or not
in the following poll based on the buffer filled levels. Some API
is very sensitive about this, it seems.

Fixes #433
2021-03-02 15:03:27 +01:00
Wim Taymans a57d3e4dae Revert "context: set max-quantum to 4096 by default"
This reverts commit 293d9b3c5d.

The root cause of this might now be fixed.

See #724
2021-03-02 10:46:24 +01:00
Frédéric Danis 0e2a153bd3 bluez5: Start only one backend at a time for HSP/HFP
This will prevent to run the different backends concurrently.

The native backend will only register to BlueZ if neither oFono nor
hsphfpd are running. If one of them starts, the native backend will be
unregistered and the corresponding backend will register to its daemon.
2021-03-02 09:43:16 +00:00
Wim Taymans 1dfa36d77b alsa: reconfigure max latency based on buffer size
We can't ever support a latency larger than half the buffer size.
Take a fourth of the buffer size to have some extre headroom.

See #724
2021-03-02 10:34:41 +01:00
Wim Taymans 00d8d1472d channelmix: fix 7.1 to quad downmix 2021-03-01 19:51:14 +01:00
Wim Taymans 00e52ec167 resample: in drain, feed silence in all channels 2021-03-01 18:09:24 +01:00
Wim Taymans 5ae286702e audioconvert: make sure we update the flags
When we get a param update, update with the new flags.
2021-03-01 17:01:46 +01:00
Wim Taymans 157d423246 bluez5: remove stray route param field
This info is also in the classes field.
2021-03-01 16:55:16 +01:00
Wim Taymans e19263140a pulse-server: improve module handling
Make a registry of modules
Assign an unique number to each module with the MODULE_FLAG bit set
so that we can also enumerate them
Implement enumerating our internally loaded modules
Implement unloading of the module using the module id
Move module-null-sink into a separate file
Use Audio/Sink if no other media.class was given, so that it works
just like the pulseaudio module
Enable linger=true in all cases.
2021-03-01 14:57:28 +01:00
Wim Taymans 15e6a825f2 pulse-server: don't read past the end of the string 2021-03-01 13:56:10 +01:00
Wim Taymans 9662bc96ab null-audio-sink: support and prefer planar F32P
It's easier to convert to and also the native format for the converter
so that it can operate in passthrough mode without any copies.
2021-02-26 21:15:14 +01:00
Wim Taymans d5d8150e05 fmtconvert: prefer planar formats when possible
It's easier to convert to and from.
2021-02-26 21:14:35 +01:00
Wim Taymans 50437029a3 channelmix: improve debug, add passthrough state 2021-02-26 21:12:11 +01:00
Wim Taymans 80a543e043 adapter: improve error message
Make sure we debug the result code that is returned.
2021-02-26 20:45:25 +01:00
Wim Taymans e2181c582d audioconvert: fix channel remapping some more
See #461
2021-02-26 18:40:04 +01:00
Ivan 08445d2c4a docs: Fit systemd services into one command for convenience
... also added some information about enabling pipewire-media-session.service
2021-02-25 20:23:32 +00:00
Wim Taymans f7d756460e alsa: add option to use device channel map instead of default
See #461
2021-02-25 21:16:16 +01:00