2024-04-19 20:23:56

by Luiz Augusto von Dentz

[permalink] [raw]
Subject: [PATCH BlueZ v2 1/2] client/player: Fix calculation of number of packet

From: Luiz Augusto von Dentz <[email protected]>

The calculation shall attempt to round to number of packets to the
closest integer otherwise it can result in 0 packets to be sent at each
latency.
---
client/player.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/client/player.c b/client/player.c
index 1f56bfd270f6..65f771039258 100644
--- a/client/player.c
+++ b/client/player.c
@@ -63,6 +63,7 @@
#define NSEC_USEC(_t) (_t / 1000L)
#define SEC_USEC(_t) (_t * 1000000L)
#define TS_USEC(_ts) (SEC_USEC((_ts)->tv_sec) + NSEC_USEC((_ts)->tv_nsec))
+#define ROUND_CLOSEST(_x, _y) (((_x) + (_y / 2)) / (_y))

#define EP_SRC_LOCATIONS 0x00000003
#define EP_SNK_LOCATIONS 0x00000003
@@ -5031,8 +5032,9 @@ static bool transport_timer_read(struct io *io, void *user_data)
return false;
}

- /* num of packets = latency (ms) / interval (us) */
- num = (qos.ucast.out.latency * 1000 / qos.ucast.out.interval);
+ /* num of packets = ROUND_CLOSEST(latency (ms) / interval (us)) */
+ num = ROUND_CLOSEST(qos.ucast.out.latency * 1000,
+ qos.ucast.out.interval);

ret = transport_send_seq(transport, transport->fd, num);
if (ret < 0) {
--
2.44.0



2024-04-19 22:27:23

by bluez.test.bot

[permalink] [raw]
Subject: RE: [BlueZ,v2,1/2] client/player: Fix calculation of number of packet

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=846226

---Test result---

Test Summary:
CheckPatch PASS 0.55 seconds
GitLint PASS 0.41 seconds
BuildEll PASS 24.69 seconds
BluezMake PASS 1676.42 seconds
MakeCheck PASS 12.84 seconds
MakeDistcheck PASS 178.48 seconds
CheckValgrind PASS 247.63 seconds
CheckSmatch PASS 353.43 seconds
bluezmakeextell PASS 119.86 seconds
IncrementalBuild PASS 2962.74 seconds
ScanBuild PASS 1017.77 seconds



---
Regards,
Linux Bluetooth

2024-04-22 15:41:25

by patchwork-bot+bluetooth

[permalink] [raw]
Subject: Re: [PATCH BlueZ v2 1/2] client/player: Fix calculation of number of packet

Hello:

This series was applied to bluetooth/bluez.git (master)
by Luiz Augusto von Dentz <[email protected]>:

On Fri, 19 Apr 2024 16:23:40 -0400 you wrote:
> From: Luiz Augusto von Dentz <[email protected]>
>
> The calculation shall attempt to round to number of packets to the
> closest integer otherwise it can result in 0 packets to be sent at each
> latency.
> ---
> client/player.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)

Here is the summary with links:
- [BlueZ,v2,1/2] client/player: Fix calculation of number of packet
https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=92c1c1c36611
- [BlueZ,v2,2/2] client/player: Fix using unicast QoS for broadcast
https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=04153538aaf4

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html