Commit graph

13604 commits

Author SHA1 Message Date
Wim Taymans
77b23c619e spa: Improve Range/Step code readability
Use min,max,step variables to store the choice values for better
readability.
2025-03-25 11:58:53 +01:00
Wim Taymans
4b3be9cc9b spa: merge Range and Step filter together
They share all of the code and the step just has an extra check for
the step values.
2025-03-25 11:47:28 +01:00
Wim Taymans
b238c9d7a1 pw-cat: improve sndfile file format debug info
Print the endianness, container name and the sample format nicely
instead of dumping the hex values.
2025-03-24 18:49:41 +01:00
Wim Taymans
dda60fb374 pw-cat: prefer AU format when using stdin/stdout
WAV is actually not usable for streaming output by sndfile.

See #4629
2025-03-24 17:54:32 +01:00
Wim Taymans
367e756ebe videoconvert-ffmpeg: remove debug 2025-03-24 11:45:29 +01:00
Wim Taymans
824354f38e videoadapter: sync with audioadapter 2025-03-24 11:45:11 +01:00
Wim Taymans
7e67daa292 audioadapter: negotiate formats from output to input
Try to avoid conversions by taking the output port format and using that
as a filter for the input port format.

Because filtering pods prefer the values of the filter, this will prefer
the output format values and thus avoid conversions.
2025-03-24 11:39:20 +01:00
Wim Taymans
de54cfc475 audioconvert: improve tmp buffer allocation
Use per port allocated memory so that we can easily increase the size
and add more buffers. This is necessary when we add filter-graphs that
require more ports.
2025-03-21 15:18:54 +01:00
Sanchayan Maity
b8d5334462 gst: pipewireformat: Do not use RANGE if values are equal
This fixes assertion from the underlying gst_value_collect_int_range
when using gst_caps_set_simple with range types when the values are
equal.
2025-03-21 16:18:28 +05:30
Pauli Virtanen
6fe1c6d67b alsa: seq: double-check midi client version
Check midi client version after setting it, to see if it was really
successfully set.  Old kernels without UMP don't know about the midi
version fields, so snd_seq_set_client_midi_version() appears to fail
silently there.
2025-03-20 21:39:40 +02:00
Pauli Virtanen
e0938303e6 acp: Sennheiser GSX stereo profile
The card can output at higher sample rates in stereo profile, so add
that.
2025-03-20 12:24:56 +00:00
Robert Mader
2625983a23 systemd: Depend on dbus.service
Solution suggested by Xi Ruoyao.

The dbus user service is required for various features - the summary says:
'dbus (Bluetooth, rt, portal, pw-reserve)'

On session logout the dbus service gets shut down while the Pipewire one
relies on a timeout. If a user logs in again before PW timed out, the
later stays alive but doesn't handle re-connecting to the dbus service
of the new session, breaking the camera portal and potentially other
features.

Thus hard-depend on the dbus service (if enabled at build time) and thus
shut down together with it.
2025-03-20 12:23:22 +00:00
Wim Taymans
923b8b48ec alsa-seq; enable UMP again when we can
It got accidentally disabled for debugging
2025-03-20 12:55:09 +01:00
Wim Taymans
7662a01f85 examples: warn when texture locking fails
New SDL seems to fail when locking YUY2 now.
2025-03-20 11:21:56 +01:00
Wim Taymans
4e0545aa04 videoconvert: get the correct strides
Use ffmpeg to get the right stride for the negotiated format instead of
using a wrong hardcoded value.
2025-03-20 10:57:26 +01:00
Wim Taymans
6f8a814f29 pod: use default value of filter
When using a filter, it makes more sense to use the default value
of the filter as a first attempt.

One case is in adapter when we try to find a passthrough format first. The
audioconverter suggests a default rate of the graph rate but the follower
filters this out for another unrelated default value and passthrough is not
possible (altough it would be because the default value of the filter is
in the supported follower range).

Fixes #4619
2025-03-19 17:53:05 +01:00
Wim Taymans
a460842769 netjack2: fix the large midi events offset
The midi events have their large data offsets relative to the start of
the buffer and the large data is at the end of the buffer. Because we
copied it down, right after the events, but we didn't adjust the
offsets, calculate a correction offset when unpacking the events.
2025-03-19 17:53:05 +01:00
Wim Taymans
e3a068de7d netjack2: set correct max midi buffer size
It depends on the negotiated period size, not the graph quantum.
2025-03-19 17:53:05 +01:00
Wim Taymans
3be88eacb8 netjack2: copy large midi events to the end of the buffer
There is no need to keep an extra free byte at the end and it will cause
us to lose a byte when we copy the large midi events down.
2025-03-19 17:53:05 +01:00
Wim Taymans
795e917716 jack: write midi events to end of buffer
There is no need to keep one extra byte at the end of the buffer,
we can write the event up to the last byte.
2025-03-19 17:53:05 +01:00
Wim Taymans
bcde5cbd8a audioconvert: rework the filter-graphs a little
Use a simple free/active linked list for the filter-graphs and insert
the new filters in the right position in the list. Then simply copy the
list to an array for the processing thread.

when reconfiguring, set up all the filters again because the number of
channels might have changed.
2025-03-19 17:53:05 +01:00
Wim Taymans
de2ab7cac9 filter-graph: add support for channel positions
Make it possible to define a channel position in filter-graph.
Use the channel positions to perform the final channelmix.
2025-03-19 17:53:05 +01:00
Wim Taymans
9b2b420cf5 spa: we need ALSA >= 1.2.11 for snd_seq_ump_ev_clear() 2025-03-19 17:53:05 +01:00
Wim Taymans
91806ff747 netjack: handle overflow in midi buffer append 2025-03-19 17:53:05 +01:00
Wim Taymans
33584dae1d ump: handle sysex from UMP to MIDI1 better
SysEx in UMP can span multiple packets. In MIDI1 we can't split them up
into multiple events so we need to collect the complete sysex and then
write out the event.

Fixes SysEx writes to ALSA seq by running the event encoder until a
valid packet is completed.

Also fixes split MIDI1 packets in the JACK API when going through the
tunnel or via netjack.
2025-03-19 17:53:05 +01:00
Wim Taymans
ada2146692 jack-tunnel: improve port names
Prefix midi port names with midi_ and number ports from 1 instead
of 0.
2025-03-19 17:53:05 +01:00
Wim Taymans
a241495eaf jack-tunnel: support passing port names to link
Add jack.connect-audio and jack.connect-midi to specify an array of port
names to link to instead of the default phyisical ports.

Also actually fixes linking the midi ports correctly.
2025-03-19 17:53:05 +01:00
Wim Taymans
74035f0a34 rtp-sdp: format ptime in the C locale
Don't place locale dependent strings in the SDP.

Fixes #4615
2025-03-19 17:53:04 +01:00
Wim Taymans
21e9fdf8ad conf: add a jack-tunnel config snippet
The minimal config might want to enable JACK as a backend so add
an example config for this.
2025-03-19 17:53:04 +01:00
Sanchayan Maity
d329dac6ba gst: Do not use video only info for SPA_PARAM_BUFFERS_blocks
We mistakenly used video only info for setting SPA_PARAM_BUFFERS_blocks,
which would be completely incorrect for audio.

Fixes 6c9ada270.
2025-03-14 12:41:38 +00:00
Wim Taymans
4ffa82b590 jack: add another node name fallback
Use the object-path as a fallback name for the node.
2025-03-14 13:28:48 +01:00
Wim Taymans
4e421e0012 audioadapter: return error code from set_param 2025-03-14 13:26:21 +01:00
Wim Taymans
f1ed12fc8d audioconvert: PortConfig only needs channels and position 2025-03-14 13:25:45 +01:00
Wim Taymans
f0e09ae363 filter-graph: make the filter-graph ports dynamic
When parsing the graph, parse the input and output port names into
a separate string array. This was we can keep them around when
setting up the graph.

Instead of setting up the graph right after loading it, do the graph
setup when we activate the graph. This makes it possible to pass the
input channels to the filter-graph and let it create the right amount of
plugins and ouput channels.

When setting up the graphs in the audioconverter, pass the current
number of channels as the input to the graph and keep track of the
channels that each filter produces.

This way we can also load a custom upmix or downmix graph, for example.
2025-03-14 10:10:18 +01:00
Wim Taymans
76619eaa1d audioconvert: fix the filter-graph samplerate
The filter graph runs before or after the resampler depending on the
direction of the conversion.
2025-03-14 10:03:44 +01:00
Pauli Virtanen
bd3a8b594f spa: acp: indicate ALSA UCM profile errors in UIs
Add "[ALSA UCM error]" to the end of card description, to indicate
something is wrong.
2025-03-13 21:25:55 +00:00
Pauli Virtanen
4338189f76 spa: acp: allow also too few channels in SplitPCM configs
GoXLR Mini has different numbers of channels actually available (21, 23,
or 25) depending on its firmware/etc, but its UCM profile specifies
always 23. The count can then be bigger or smaller than what is actually
available.

Fail a bit more gracefully in the case of too few channels: create all
the split devices specified by the profile. The channels that aren't
actually available in HW just won't get routed anywhere.

ALSA upstream IIUC is saying that the channel counts should be fixed, so
spew warnings that say the UCM profiles are wrong if they look wrong.
2025-03-13 21:25:55 +00:00
Sanchayan Maity
6c9ada270b gst: Fix handling of video planar formats
Tiled formats are not tested and supported yet.
2025-03-13 18:53:23 +05:30
sunyuechi
60981494d6 Add x86 CPU check in meson.build for clang build fix
have_avx = cc.has_argument(avx_args)

gcc generates an error when AVX is unsupported, whereas clang only
produces a warning.

Thus, using Clang on the RISC-V platform incorrectly enables AVX file
compilation, leading to build failures.
2025-03-12 20:49:26 +00:00
Frédéric Danis
1af1fc846c bluez5: backend-native: Add volume support to HFP HF
The volume synchronization could be done even if there's no audio link
and so no transport opened.

This patch allows to send the Speaker (AT+VGS) and Microphone (AT+VGM)
commands at the end of the SLC. And to exchange volume updates using the
telephony DBus interface, even without a transport.
2025-03-12 11:01:50 +01:00
Wim Taymans
48a32e4ced loop: remove return from function returning void
Fixes #4603
2025-03-11 16:34:28 +01:00
Wim Taymans
6598938f12 doc: update MIDI doc 2025-03-11 16:31:08 +01:00
Wim Taymans
8e8306cad8 doc: link to the protocol message documentation 2025-03-11 16:26:06 +01:00
Wim Taymans
b997ff8ac1 devolpment is 1.5.0 2025-03-11 15:14:03 +01:00
Wim Taymans
bf3c7aa6e1 alsa-seq: fix UMP output
We need to set the UMP flag, which is done with
snd_seq_ev_set_ump_data() to make it output the midi data.
2025-03-11 13:29:38 +01:00
Wim Taymans
ff08c28b62 alsa-seq: avoid uninitialized warning 2025-03-11 12:33:08 +01:00
Wim Taymans
badd8691bd audioconvert: remove some unused fields 2025-03-11 11:52:52 +01:00
Wim Taymans
d43fb09ea1 audioconvert: configure resample channels correctly
Depending on the direction of the conversion, we run the resampler
before or after the channelmix. This means we need to use the channel
count before or after the channelmixer instead of always using the
channels after channelmixing.

Fixes #4595
2025-03-11 11:50:48 +01:00
Pauli Virtanen
a503244c10 spa: avoid casting between snd_seq_event_t & snd_seq_ump_event_t
Although the two structs have same initial sequence, it's not really
correct to cast between their pointers. Alsa-lib also does this only
internally, but not in API.
2025-03-10 18:12:54 +00:00
Pauli Virtanen
fd5bd5ca6e spa: fix ALSA UMP support detection in meson 2025-03-10 18:12:54 +00:00