Commit graph

2284 commits

Author SHA1 Message Date
Wim Taymans
7e4f99512f v4l2: cast varargs to the right type
The controls have 64 bits but the int varargs expect an int value, which
is not always 64 bits.

See #2400
2022-05-27 13:30:07 +02:00
George Kiagiadakis
bd37d78a8c libcamera: advertise the device.product.name and not some random description
We can override the description with a localized one in the session
manager, instead, like it's done in alsa
2022-05-26 19:18:35 +03:00
Wim Taymans
96472e259f libcamera: return empty controls instead of error 2022-05-26 18:11:06 +02:00
George Kiagiadakis
cd8ac5c1a6 libcamera: add camera location property on nodes 2022-05-26 10:41:02 +00:00
Wim Taymans
9071678643 spa: set port flags on port info 2022-05-26 10:39:31 +02:00
Wim Taymans
16f1d6349d alsa: don't crash on NULL params 2022-05-25 15:33:18 +02:00
Trent Gord
799f4ce0a6 Update 90-pipewire-alsa.rules (ID 9886:0045 is for the Astro A20 Gen2) 2022-05-23 01:19:20 +00:00
Wim Taymans
e1a50a6c1a mixer-dsp: handle input offset
Handle the input buffer offset and clamp the size to maxsize.
2022-05-18 09:24:08 +02:00
Wim Taymans
411b12f59e audioadapter: improve error reporting
Improve the debug_params output.
Always either print the failed filter or that there was no filter.
Print the index of the enumerated failed param or a message when
there are no params.

See #2383
2022-05-17 09:52:48 +02:00
Jonas Holmberg
64c1b62aa8 alsa-pcm: Do not log warning when resync was expected
Log as info instead of warning when alsa sync was expected.
2022-05-11 17:45:27 +02:00
Wim Taymans
a3e10d6023 audioadapter: add some more debug 2022-05-11 15:13:46 +02:00
Wim Taymans
416dec530c audioconvert: debug result code 2022-05-11 14:55:37 +02:00
Wim Taymans
c2dbe1d64d audioconvert: remove props from info
After emiting the node info, remove the properties from the info again
so that we don't accidentally emit them again later, when the
info and properties are out of scope.
2022-05-11 14:51:14 +02:00
Wim Taymans
9d186cf622 alsa-pcm: scale max_error with quantum size
Adjust the max-error between the hardware delay and the quantum. Limit
this between 256 and quantum/2 to make sure we are not too sensitive.
2022-05-11 10:34:27 +02:00
Barnabás Pőcze
f24250da66 spa: bluez: ignore unsupported indicators
Do not emit a warning when a known, but
otherwise unsupported indicator is received.

Fixes wireplumber#253
2022-05-10 12:09:18 +02:00
Wim Taymans
32e957345d audioadapter: don't loop forever
Try 8 times to make progress, if nothing after that, xrun.

A stream that keeps sending 0 sized buffers would otherwise get into
an endless loop.

See #2359
2022-05-06 15:33:28 +02:00
Wim Taymans
ad130d0cd6 audioconvert: fix param counter 2022-05-03 10:41:02 +02:00
Wim Taymans
7b9321dea9 audioconvert: don't forward node results
Don't just always forward node results but use port_enum_param_sync.

Avoids duplicate param results in pw-dump for ports.
2022-05-03 10:10:09 +02:00
Wim Taymans
94dd797aa5 audioconvert: remove unused port param 2022-05-03 10:10:09 +02:00
Pauli Virtanen
6ccb939267 bluez5: use lc3plus.h instead of lc3.h
The file name "lc3.h" in the ETSI LC3plus package may conflict with the
actual LC3 codec, so try to find a file "lc3plus.h" instead.  Also try
to find a pkg-config dependency for it first (in which case use lc3.h,
assuming it's in different directory).  This can be fine tuned, if
something starts to package that library.
2022-05-03 00:29:47 +03:00
Pauli Virtanen
7f67dedac6 bluez5: fix lc3plus initial bitrate 2022-05-02 23:14:45 +03:00
Pauli Virtanen
9e59a56894 bluez5: add LC3plus A2DP vendor codec
Implement codec plugin for the LC3plus codec, supporting the LC3plus
encoder/decoder from Fraunhofer.
2022-05-01 15:09:00 +03:00
Pauli Virtanen
d28394173a bluez5: add LC3plus A2DP vendor codec caps
From the specification
https://www.iis.fraunhofer.de/en/ff/amm/communication/lc3.html
2022-05-01 00:27:05 +03:00
Pauli Virtanen
f9850ca4f8 bluez5: use bigger decode buffer in a2dp-source
LC3plus expands 509 bytes input -> 7680 bytes output, which is bigger
than current decode buffer.

Make the decode buffer bigger, and put it on heap, not stack.
2022-05-01 00:27:05 +03:00
Pauli Virtanen
9ad53d9d19 bluez5: a2dp-source should not stop on codec decode failures
A2DP source should continue trying to decode, even if garbled data is
received.
2022-04-30 23:43:10 +03:00
Pauli Virtanen
3d4eafcb0f bluez5: allow codecs to produce multiple packets from same data
Codecs may need to fragment a single encoder frame across multiple
packets that are sent consecutively.

Allow codec->encode() to set need_flush=NEED_FLUSH_FRAGMENT, so that
sink should immediately call start_encode + encode with NULL input data,
to produce the next packet.

Previously, other return values than need_flush=1 were unused, so no
need to bump codec ABI for this.
2022-04-30 23:43:10 +03:00
Wim Taymans
b7845bd702 alsa: scale buffer with frame_scale
Make the alsa buffer a little larger when we scaled the samplerate,
like for DSD. This allows us to go all the way up to the quantum
limit.
2022-04-28 13:04:39 +02:00
Wim Taymans
c48a4bc166 pw-cat: fix DSF playback again
Make the DSD buffers a little bigger because we scale down the rate.
Read an interleaved number of samples to fill one quantum.
2022-04-28 12:32:08 +02:00
Wim Taymans
9e3b784b34 bluez5: use reallocarray 2022-04-27 09:27:32 +02:00
Pauli Virtanen
689e2d0cc9 bluez5: clear codec switch flag on device connnection change
Codec switch flag should be cleared on device connection status change,
to deal with codec_switched() callback not being called if device is
suddenly disconnected.
2022-04-25 21:28:39 +03:00
Pauli Virtanen
3be019d7a8 bluez5: stop running codec switch on disconnect
When device is disconnected, running codec switches are not meaningful,
and should be stopped.

The codec switch callback may also trigger A2DP profile switch, which
may reconnect the device. Fix it so this does not happen.

See #2334
2022-04-25 20:15:37 +03:00
Dennis D
08e7ac6239 Update spa/plugins/bluez5/bluez-hardware.conf
Fixes https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/2291
2022-04-23 19:53:24 +00:00
Wim Taymans
5a023c8c84 alsa: fix argument type for Long
Fixes #2271
2022-04-21 22:13:16 +02:00
Wim Taymans
e353999028 channelmix: use average for center and LFE
Stops the LFE from clipping.
2022-04-20 16:09:39 +02:00
Wim Taymans
d0886a16a2 resample: limit buffer input size to input maxsize
And not the output buffer maxsize.
2022-04-19 19:58:41 +02:00
Wim Taymans
96286fb8b1 resample: use a -1 buffer size to drain
Use the special -1 buffer size to start the drain so that we can
also handle 0 buffer sizes.
2022-04-19 18:28:59 +02:00
Wim Taymans
7b225708e9 test: getopt_long returns an int
./spa/plugins/alsa/test-timer.c: In function ‘main’:
../spa/plugins/alsa/test-timer.c:224:79: warning: comparison is always true due to limited range of data type [-Wtype-limits]
  224 |         while ((c = getopt_long(argc, argv, "hD:f:r:c:", long_options, NULL)) != -1) {
      |
2022-04-19 16:48:27 +02:00
Quentin Wenger
d2250e9d1c Cleanup argument names in methods and events interfaces: object/data, 2nd pass. 2022-04-18 07:49:35 +00:00
Wim Taymans
164361484f channelmix: tweak defaults a little.
Increase the FC filter frequency to 12KHz for better dialogs. This
filter is only applied when making the FC from FRONT channels so that
we keep the high frequency signal on the FRONT mostly.
Increase LFE filter frequency to make slightly more bass.
Disable widen filter by default.
Update config files with the correct defaults.
2022-04-12 12:04:55 +02:00
Wim Taymans
66e4334c92 channelmix: reuse more functions
Make some copy/vol functions and reuse them.
Reuse the 2->3p1 upmix code, tweak it a little to that the widen
param is always used.
2022-04-12 11:54:27 +02:00
Wim Taymans
e12e4295cf channelmix: only filter FC and LFE when upmixed
When we have an original source with LFE and FC, don't try to mix
it but pass it unmodified.

Fixes #2280
2022-04-12 11:51:01 +02:00
Wim Taymans
1547e5fd2b alsa: limit the buffer-size to quantum-limit * 4
We don't actually need to allocate the largest possible buffer. A buffer
that is near 4 times the quantum-limit is more than enough.

See #1995
2022-04-07 16:01:48 +02:00
Wim Taymans
54f6f9293e channelmix: upmix disabled also disables FC and LFE generation
Don't generate FC and LFE when upmix is disabled.

Fixes #2266
2022-04-04 09:08:54 +02:00
Wim Taymans
2922b0e108 channelmix: make PSD the default again
We can't have a default that simply copies channels, that's just
wrong. So we enable PSD again.

PSD does a good job of moving the ambient sound to the back. It's
subtle and almost stereo like but it's better than plain stereo.

The stereo widen has been reduced to make it more like the simple
upmixing.

People that previously wanted the copy-channels-experience had to
manually enable this in pulseaudio so it's not too much to ask
to manually switch the algoritm to simple. I think this is a better
default.

Fixes #861
See #2219
2022-04-01 11:50:57 +02:00
Wim Taymans
1bf1497855 spa: mode dll to utils 2022-03-30 17:22:26 +02:00
Wim Taymans
7e227c5c6a fmtconvert: we support U16 format as well 2022-03-30 17:11:51 +02:00
Wim Taymans
2f5bba112f spa: Improve PropInfo fields
The PropInfo either has a registered id (and then also a name from the
type-info) or a custom name as a string.
In all cases, the description contains a free form text that clarifies
the property.

Use the description in the stream controls name.
2022-03-30 17:09:08 +02:00
Wim Taymans
5547f9a1b9 resample: take rate scale property into account as well 2022-03-29 17:51:03 +02:00
Wim Taymans
74da804e97 move some debug to fastpath 2022-03-28 16:25:00 +02:00
Wim Taymans
0d6fca5bba audioconvert: add queued samples as delay
The delay of the resampler also includes the queued samples on the
input port.
2022-03-28 14:56:29 +02:00