Parent: 956b277f8da6803efeb6ba52b4edfa8839faea7f
Author: Pauli Virtanen <pav@iki.fi>
Committer: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Date: 2025-04-09 17:07:10
Tree: fd7eb4470556255472e2dc58c9116f5989a88106
shared/io: add watcher to be used with TX timestamping Add special implementation of fd watcher GSource for audio use. For audio use cases, sound server may turn on TX timestamping on a socket that we are watching. In this case, we shall not consider the TX timestamping POLLERR as a socket error condition, nor read the TX timestamps. When TX timestamps appear in errqueue, switch from fd poll wait to polling the fd at regular intervals. This is because unread errqueue causes poll() to wake up immediately, so the mainloop cannot block on that, and we have to use a timer instead with some reasonable timeout for the use case. This rate limits wakeups on new TX timestamps we aren't going to read, and also avoids the busy looping if timestamping was left on but errqueue is not flushed. Kernel does not provide any way for user applications to disable wakeup on POLLERR currently. Note that even with epoll() POLLET it still wakes up on every timestamp. Implement this only for io-glib; it is only needed for audio use cases that anyway are using glib, so add a glib-specific API for it in addition to the 'struct io *' one. Uses features from GLib 2.36 (from 2013) so update configure.ac also.
Diffstat
| M | acinclude.m4 | | | 4 | ++- - |
| M | configure.ac | | | 2 | +- |
| M | src/shared/io-ell.c | | | 12 | ++++++++++++ |
| M | src/shared/io-glib.c | | | 185 | ++++++++++++++++++++++++++++++++++++++++- |
| M | src/shared/io-mainloop.c | | | 12 | ++++++++++++ |
| M | src/shared/io.h | | | 5 | +++++ |
6 files changed, 216 insertions(+), 4 deletions(-)