-
Notifications
You must be signed in to change notification settings - Fork 0
[PW_SID:951281] [BlueZ,1/3] shared/io: add watcher to be used with TX timestamping #2770
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This patch adds workflow files for ci:
[sync.yml]
- runs every 30 mins.
- sync repo with upstream repo and rebase workflow branch to tip of
master.
- creates PR after reading patches from patchwork.kernel.org
[ci.yml]
- Tests the following checks:
- checkpatch
- gitlint
- make
- make check
[code_scan.yml]
- Static code checker: Coverity and Clang
- Coverity: Submit the result to the coverity website
- Clang Code Scan: Send email with result file to the internal team
To simplify the history, new change will amend to this patch without
creating new patch.
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.
Use io_add_err_watch to avoid considering TX timestamps as errors in the transport io channel.
Use io_add_err_watch to avoid considering TX timestamps as errors in the transport io channel.
|
CheckPatch |
|
GitLint |
|
BuildEll |
|
BluezMake |
|
MakeCheck |
|
MakeDistcheck |
|
CheckValgrind |
|
CheckSmatch |
|
bluezmakeextell |
|
IncrementalBuild |
|
ScanBuild |
bd12bd7 to
a65fdba
Compare
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.
Notes:
v2:
- Remove io-glib.h. Pass void * for GIOChannel *, which is how
it needs to be if it's in io.h as requested.
- Adjust API a bit
acinclude.m4 | 4 +-
configure.ac | 2 +-
src/shared/io-ell.c | 12 +++
src/shared/io-glib.c | 185 ++++++++++++++++++++++++++++++++++++++-
src/shared/io-mainloop.c | 12 +++
src/shared/io.h | 5 ++
6 files changed, 216 insertions(+), 4 deletions(-)