Skip to content

Conversation

@BluezTestBot
Copy link
Owner

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

In theory avdtp/bap could be changed to use a 'struct io *' instead, but
it's mostly additional complication with no gain since they are using
GLib anyway, and in theory 'struct io *' users shall use the
io_set_ignore_errqueue API instead.

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(-)

tedd-an and others added 4 commits April 8, 2025 14:43
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.
@BluezTestBot
Copy link
Owner Author

CheckPatch
Desc: Run checkpatch.pl script
Duration: 0.25 seconds
Result: PENDING

@BluezTestBot
Copy link
Owner Author

GitLint
Desc: Run gitlint
Duration: 0.23 seconds
Result: PENDING

@BluezTestBot
Copy link
Owner Author

BuildEll
Desc: Build and Install ELL
Duration: 21.00 seconds
Result: PASS

@BluezTestBot
Copy link
Owner Author

BluezMake
Desc: Build BlueZ
Duration: 2613.93 seconds
Result: PASS

@BluezTestBot
Copy link
Owner Author

MakeCheck
Desc: Run Bluez Make Check
Duration: 19.83 seconds
Result: PASS

@BluezTestBot
Copy link
Owner Author

MakeDistcheck
Desc: Run Bluez Make Distcheck
Duration: 198.31 seconds
Result: PASS

@BluezTestBot
Copy link
Owner Author

CheckValgrind
Desc: Run Bluez Make Check with Valgrind
Duration: 274.35 seconds
Result: PASS

@BluezTestBot
Copy link
Owner Author

CheckSmatch
Desc: Run smatch tool with source
Duration: 302.66 seconds
Result: WARNING
Output:

src/shared/bap.c:314:25: warning: array of flexible structuressrc/shared/bap.c: note: in included file:./src/shared/ascs.h:88:25: warning: array of flexible structuressrc/shared/bap.c:314:25: warning: array of flexible structuressrc/shared/bap.c: note: in included file:./src/shared/ascs.h:88:25: warning: array of flexible structuressrc/shared/bap.c:314:25: warning: array of flexible structuressrc/shared/bap.c: note: in included file:./src/shared/ascs.h:88:25: warning: array of flexible structures

@BluezTestBot
Copy link
Owner Author

bluezmakeextell
Desc: Build Bluez with External ELL
Duration: 128.49 seconds
Result: PASS

@BluezTestBot
Copy link
Owner Author

IncrementalBuild
Desc: Incremental build with the patches in the series
Duration: 0.25 seconds
Result: PENDING

@BluezTestBot
Copy link
Owner Author

ScanBuild
Desc: Run Scan Build
Duration: 897.96 seconds
Result: PASS

@github-actions github-actions bot force-pushed the workflow branch 2 times, most recently from bd12bd7 to a65fdba Compare April 9, 2025 14:44
@BluezTestBot BluezTestBot deleted the 951281 branch April 9, 2025 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants