Commit graph

187 commits

Author SHA1 Message Date
Wim Taymans
ddfb310087 alsa-pcm: improve recover from suspended state debug 2020-11-26 09:24:57 +01:00
Wim Taymans
b055b9de25 alsa: Make sure we handle errors in close
When a device is removed, close() will error. Warn about this but
continue closing our other things including marking the device
as closed so that we don't try to close it again later.

Fixes #413
2020-11-25 12:37:51 +01:00
Wim Taymans
c1ea63fa7a alsa-pcm: try to recover in all cases
Even if we can't get the current status, still try to recover the
device.

See #347
2020-10-22 09:16:45 +02:00
Wim Taymans
9dfd261c71 add some more debug info 2020-09-25 17:01:52 +02:00
Wim Taymans
1bf6dead10 alsa: add option to force a samplerate 2020-09-16 15:14:26 +02:00
Wim Taymans
8332d3e3ed alsa: don't change the resampler delay value
Don't change the resampler delay value, we need it to make sure
we keep samples around for the next round. With small period sizes,
we set the delay to 0 and mess up the resampler and cause dropouts
and clicking.

Fixes #287
2020-09-15 13:22:41 +02:00
Wim Taymans
2b0b44edc0 alsa: add option do use chmap from alsa, disable by default
This should be more in line with what PulseAudio does and so lead
to less surprises.

See #289
2020-09-14 20:19:44 +02:00
Wim Taymans
ca5836cdf4 alsa: fix delay parameter
We need to keep twice the delay of samples around. Fixes capture
with resampling.
2020-07-27 16:22:17 +02:00
Wim Taymans
8f3771a56c alsa-pcm: also follow resampler insize when resampling
Use the input size of the resampler as the amount of samples to
read when we are resampling.
2020-07-27 15:57:27 +02:00
Wim Taymans
1ee8944a2a alsa: improve debug 2020-07-01 13:16:37 +02:00
Wim Taymans
8168dfdbc1 alsa-pcm: allow setting number of channels
Allow passing the number of channels when creating a device to
restrict the negotiated channels.
2020-07-01 12:54:27 +02:00
Wim Taymans
267eabaf69 alsa: add default channel map when not given 2020-07-01 12:46:03 +02:00
Wim Taymans
f65d71dd5b alsa: support planar formats 2020-07-01 11:43:25 +02:00
Wim Taymans
d2bd076a97 alsa: close output handler to avoid a leak 2020-06-02 17:13:26 +02:00
Wim Taymans
8dcd6c4417 improve debug 2020-05-09 19:21:55 +02:00
Wim Taymans
1ca7713057 implement NEAREST flag
when the NEAREST flag is set and the param could not be completely
set, set_param should return 1 to indicate this.
2020-05-08 17:52:30 +02:00
Wim Taymans
b53cc6feb8 improve debug
Log device name and stream direction
Don't log xrun errors in alsa, we signal the xrun signal, which should
take care of logging if any.
Log quantum in xrun.
ratelimit xrun messages.
2020-05-08 12:13:59 +02:00
Wim Taymans
aafd1e7298 improve debug
Improve log so that debug level 3 gives a reasonably readable overview
of what is going on.
2020-04-22 12:47:18 +02:00
Wim Taymans
441fdb2333 alsa: fix buffer recycle
We only set the OUT flag when we put the buffer on an io area and
might need to recycle later.
Before placing the output buffer into the io area, recycle any
buffer that might be left in there.
Only emit the ready callback when we have some data queued.
2020-03-19 13:12:49 +01:00
Wim Taymans
949dba7bfc fmt-ops: flesh out avx optimizations 2020-03-17 17:27:47 +01:00
Wim Taymans
72d70b0f48 Add and fix some more warnings
Fixes #216
2020-03-17 11:37:56 +01:00
Wim Taymans
cb7bfdf98a sprinkly SPA_LIKELY/UNLIKELY around 2020-03-16 12:52:28 +01:00
Wim Taymans
9613f16caf alsa-pcm: ignore error after recover
If we get an error after receovering, ignore it and assume we filled
the buffer completely. We need to do this or otherwise we stop the
timer and audio stops.
2020-03-12 10:52:52 +01:00
Wim Taymans
d8bac82e72 improve logging
Remove some harmless warnings from the log
Remove some excessive info logging
2020-02-21 11:09:34 +01:00
Wim Taymans
a528189d26 slave -> follower
We use master/follower terminology everywhere.
2020-02-21 10:47:32 +01:00
Wim Taymans
e7b5bd5e5b alsa: actually place the delay in clock.delay 2020-01-30 19:32:19 +01:00
George Kiagiadakis
0c63d045ee alsa-pcm: call reuse_buffers when resetting the state of the buffers
This allows the upstream node to put buffers back to its pool in case
they were left around in the ready list locally when the alsa-pcm-sink
was last paused.

Fixes #203
2020-01-14 11:28:04 +00:00
Wim Taymans
c14881fbe2 Respect the rate from the position as the default 2020-01-09 16:43:08 +01:00
Wim Taymans
d94019ccd2 io: Add current video frame size to position
Add some padding, tweak some padding
Remove count in the clock, it's useless
For video frames we will want to use metadata to place
this on individual buffers.
2019-10-29 14:08:40 +01:00
Wim Taymans
9f4df5ee40 alsa: add some debug, tweak resync 2019-10-23 16:26:35 +02:00
Wim Taymans
5383782336 alsa: Disable rate matching for the same card
Add a clock name to the clock, remove the old api/clock_id. This makes
it easier to add descriptive names

Place the alsa card number in the clock name.

Check the clock name of the master clock and if it matches our own
clock, disable rate matching.
2019-10-23 16:04:03 +02:00
Wim Taymans
ff96165035 Improve debug 2019-10-22 13:06:20 +02:00
Wim Taymans
116676e149 node: add active flag for rate match
Add flags to the rate match io area
Add flag to activate/deactivate rate match
Set active flag in rate match when slaved
Update rate before starting resample
2019-10-21 10:13:56 +02:00
Wim Taymans
f5b9862a89 alsa: tweak xrun recovery
Don't try to resync right after a xrun.
Init the dll after reslaving.
2019-10-18 22:53:02 +02:00
Wim Taymans
6e0ffb0c47 flags: change flag macros
SPA_FLAG_CHECK -> SPA_FLAG_IS_SET
SPA_FLAG_UNSET -> SPA_FLAG_CLEAR
Add SPA_FLAG_UPDATE
2019-10-02 18:00:42 +02:00
Wim Taymans
197d2b15b6 alsa-pcm: small cleanups 2019-09-24 17:23:01 +02:00
Wim Taymans
db341a6450 improve properties on node and port
Rename some alsa filenames.
2019-09-23 20:51:34 +02:00
Renamed from spa/plugins/alsa/alsa-utils.c (Browse further)