Commit graph

417 commits

Author SHA1 Message Date
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
995fafa5be alsa-seq: remove the queue for system announce port
The announce messages are not put in a queue so we don't need
to allocate one (and a timer). Without the timer, we avoid wakeups
and consume less power.

See #225
2020-05-06 11:19:46 +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
74665de68e alsa-seq: keep track of last port
Keep track of the last port and only iterate until that port.
2020-03-31 17:52:22 +02:00
Wim Taymans
e6675ff2a8 alsa-seq: unsubscribe when paused/suspended
When we are suspended or paused, unsubscribe from the ports so that
we don't block the hardware devices.

See #225
2020-03-31 12:14:52 +02:00
Wim Taymans
a1846c9780 udev: don't loop forever on errors
When we can't find the v4l2 device id, unref the device and continue
instead of looping forever and consuming all memory.

Fixes #219
2020-03-24 15:54:58 +01: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
ea911f2e3f tweak buffers a little
JACK can handle 2 buffers at most, make the default buffer allocator
allocate 2 buffers when no params are given.
Prefer 2 buffers, it allows some form of async fill/consume
2020-02-19 10:17:00 +01:00
Philipp Zabel
cb1071bce7 alsa-seq: fix seq_open error path
If snd_seq_open fails, do not call snd_seq_close(NULL).
2020-02-07 19:07:14 +01:00
Wim Taymans
1404cb4182 alsa-pcm: add device to object path
Use card id and device in the object path.
2020-02-04 18:01:48 +01:00
Wim Taymans
50ce87df32 node: we are supposed to produce data when != HAVE_DATA
We can produce data whenever the io area status != HAVE_DATA. We
don't need to look for NEED_DATA.
Also recycling buffer happens whenever the status != HAVE_DATA.
2020-02-04 12:59:16 +01:00
Wim Taymans
e7b5bd5e5b alsa: actually place the delay in clock.delay 2020-01-30 19:32:19 +01:00
Wim Taymans
65caf8832c spa: install in versioned directory
So that we can run old and new plugins side by side.
2020-01-29 15:51:41 +01:00
Wim Taymans
82e099ed37 alsa: use the card name in the object.path
The card name (id) can be configured with udev rules to remain
constant based on where the device is plugged in even when there
mulitple of the same devices.
2020-01-29 13:37:35 +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
f391353c7f Make interface types a string
This is more in line with wayland and it allows us to create new
interfaces in modules without having to add anything to the type
enum. It also removes some lookups to map type_id to readable
name in debug.
2019-12-19 13:36:04 +01:00
Wim Taymans
9657486a81 alsa-seq: update duration when slaved as well 2019-12-18 13:27:29 +01:00
Wim Taymans
3131acea46 alsa-seq: close seq device
When we unload, close the seq device again so that the source is
removed from the main loop.
2019-11-28 11:21:41 +01:00
Wim Taymans
feb8dd3a34 Add include of keys.h 2019-11-21 09:34:08 +01:00
Wim Taymans
ac24743b2e the epoll shim should only be used by the system library.
All other places should use the system library to get the right
fds.
2019-11-19 15:16:18 +01:00
Gleb Popov
fd937fa378 On FreeBSD, add dependency on epoll-shim library.
FreeBSD doesn't provide timerfd and eventfd functions. These are implemented in
3rd party library called epoll-shim. Link targets requiring these functions to
this library.
2019-11-19 13:41:40 +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
9ffec214b8 fix includes 2019-10-25 15:01:02 +02:00
Wim Taymans
af73585948 Increase max buffer size 2019-10-24 15:26:59 +02:00
Wim Taymans
f30b4bf506 alsa-seq; remove latency property 2019-10-24 12:48:28 +02:00
Wim Taymans
2fa97daa24 add some constants for max samples 2019-10-24 12:35:00 +02: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
fa25900682 alsa-seq: fix for being a slave 2019-10-22 12:24:04 +02:00
Wim Taymans
e10a74785c pcm: don't complain on Suspend 2019-10-22 12:20:29 +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
2e3608a34f Improve some debug 2019-10-18 21:54:44 +02:00
Wim Taymans
c8ffcaaefe plugins: just check the data pointer
We don't need to look at the data type, we just just be happy when
the data pointer is filled in.
2019-10-16 12:23:42 +02:00
Wim Taymans
b37bf7e068 alsa-seq: ask for more data when consumed 2019-10-16 10:44:40 +02:00
Wim Taymans
fb95e7660a media-session: start the midi bridge from the session 2019-10-02 21:12:42 +02:00
Wim Taymans
0a6ad1adec alsa: only emit PCM device when available
Only emit a PCM device if the device actually has one. Otherwise we
end up with a useless PCM device for a pure midi device.
2019-10-02 21:10:43 +02:00
Wim Taymans
93a2defbb8 alsa-seq: reset buffers 2019-10-02 18:02:40 +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
82ee139f65 spa: improve object properties 2019-10-01 10:04:22 +02:00
Wim Taymans
dc83c10c9a media-session: add device reservation for alsa
Implement the device reservation DBus API.

When we acquire the device name, set our device profile to 'On'. This
adds our sources and sinks to the graph.

When we lose the name, switch back to 'Off' and remove our nodes
again.

Move the session mamager stuff in a directory.

Fixes #191
2019-09-30 21:51:46 +02:00
Wim Taymans
44840c4a55 alsa-seq: add some comments 2019-09-26 15:17:00 +02:00