Jonas Holmberg
0ccad38df1
alsa-pcm: Fix target calculation
...
Use threshold instead of last_threshold so that early wakeup is detected
in handle_capture() when duration changes.
2021-01-28 16:18:35 +00:00
Jonas Holmberg
30848ada6b
alsa-pcm: Change resync warning to info
...
Do not print a warning when a client with custom latency disconnects.
2021-01-26 15:46:23 +01:00
Wim Taymans
73896bfa83
alsa: rework batch handling a bit
...
By default, use a 512 period for batch and use 512 headroom
Add a property to disable special batch handling.
2021-01-21 17:14:51 +01:00
Wim Taymans
02295c5e2b
alsa: call prepare again but ignore EBUSY
...
Not calling _prepare can cause problems on my card. So call it
again but ignore -EBUSY.
2021-01-15 18:42:35 +01:00
Wim Taymans
376436fc2c
alsa: remove snd_pcm_prepare() call, it is not needed
...
set_hw_params already called _prepare for us and calling it twice
might cause trouble in some drivers.
See #580
2021-01-15 16:12:42 +01:00
Wim Taymans
482f96a644
alsa: add option to disable mmap access mode
2021-01-15 15:44:22 +01:00
Wim Taymans
2ff4615e53
alsa: prefer planar formats
...
They are easier to convert
2021-01-15 15:18:39 +01:00
Wim Taymans
7347b5ef05
alsa: add api.alsa.headroom setting
...
Can be used to tweak the extra distance kept between the hardware
and software pointers when reading and writing.
See #289
2021-01-14 17:10:05 +01:00
Wim Taymans
dea4836203
alsa-pcm: always start device
...
Also start device after writing silence.
Fixes #558
2021-01-11 07:11:09 +01:00
Wim Taymans
7f007b6bca
resample: tweak the resampler to keep delay number of samples
...
Instead of requiring the upstream node to resubmit the delayed
samples, keep the samples ourselves. The benefit is probably too
small to measure but it simplifies things a lot.
2021-01-08 16:35:26 +01:00
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
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
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
Wim Taymans
4b076549f7
alsa: allow override of channel map
2020-12-28 14:24:59 +01:00
Wim Taymans
c81fe38285
alsa-pcm: limit channels to MAX
...
We don't support more than MAX channels
See #507
2020-12-23 20:07:51 +01:00
Walter Lozano
9f766dd708
alsa: add warning in case of partial read/write
...
Currently alsa_read and alsa_write assumes that all the frames committed
using snd_pcm_mmap_commit are read or written, which is probably true.
However, as it could be some corner cases add a warning to notice this
fact.
Signed-off-by: Walter Lozano <walter.lozano@collabora.com>
2020-12-20 00:23:52 -03:00
Wim Taymans
d71259a02c
alsa: handle batch devices
...
For batch devices that are not usb devices, lower the period and
add an extra period of heardoom to avoid xruns.
See !330
2020-12-11 17:38:27 +01:00
Wim Taymans
7768a87a0b
alsa: make it possible to fix format
2020-12-09 20:33:57 +01:00
Wim Taymans
4e7be858e4
node: Add ParamBegin/End
...
Use these commands to mark the begin and end of a series of Param
enumerations and configuration, like when doing format negotiation. The
idea is that the device can remain open while we do this.
Use this in adapter when negotiating a format.
2020-12-09 17:10:52 +01:00
Wim Taymans
ec77979890
alsa-pcm: default to max channels
...
When nothing else is specified, suggest the max number of channels
for a device.
See #467
2020-12-09 12:10:13 +01:00
Wim Taymans
d776a0917d
alsa: refactor dll code
2020-12-09 12:09:40 +01:00
Wim Taymans
136fc028a5
prefer S24 over S16 formats
...
Prefer the higher quality over performance.
Fixes #457
2020-12-06 10:37:40 +01:00
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