BLE Host is only able to receive one packet per interval #1342
Labels
No labels
bazel
bluetooth
board settings
boot_stage2
bug
build
c++
can't reproduce
clang
clib-interface
cmsis
code cleanliness
code size
compiler version issues
cyw43_driver
debug
discussion
documentation
duplicate
dynamic_clock
elf2uf2
enhancement
errata
filesystem
flash layout
floating point
FreeRTOS
hardware_adc
hardware_claim
hardware_clocks
hardware_dma
hardware_exception
hardware_flash
hardware_gpio
hardware_i2c
hardware_irq
hardware_pio
hardware_pwm
hardware_rcp
hardware_rtc
hardware_spi
hardware_sync
hardware_uart
hardware_vreg
hardware_watchdog
hardware_xosc
help wanted
host
IAR
installation
invalid
linker scripts
lto
lwip
mbedtls
missing API
needs reporter detail
networking
newlib
newlib-multicore
non-c
non-cmake
non-gcc
openocd
orphan PR
OS integration
pico_async_context
pico_base
pico_binary_info
pico_flash
picolibc
pico_lwip
pico_malloc
pico_multicore
pico_printf
pico_runtime
pico_stdio
pico_stdio_usb
pico_sync
pico_time
pico_util
pioasm
port
question
review
review2
rtos interop
runtime init
static library
svd
test
tinyusb
vscode
wifi integration
wontfix
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gh-raspberrypi/pico-sdk#1342
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I currently have two pico ws, one configured as a HOG Host, and one configured as a HOG Device, using code very similar to the hog keyboard hog host examples.
If i connect the device over bluetooth from a PC, i can get to poll rate around 850hz or so, which suggests that multiple packets are being sent per connection interval. However, if i instead connect to the HOG host running on a pico w, i end up with a poll rate of around 32hz, which lines up with the default 30ms connection interval.
If I then add the following line to the HOG host, I can lower the connection interval to the minimum 7.5ms, and I do end up seeing a poll rate of around 130hz or so, which also lines up with the 7.5ms connection interval.
gap_set_connection_parameters(0x0060, 0x0030, 0x06, 0x06, 0, 0x0048, 2, 0x0030);I also ran BTStack locally on my PC using the libusb port, and found that that did get to around 850hz as well, so it does appear to just be an issue with the pico w port specifically.
My eventual goal is to use this to allow a user to create a usb adapter for a bluetooth controller i am working on that can then be plugged into a console, hence the need for a very low latency.
You'll have to provide more context about the code you're running. What method are you using polling, background or are you using an rtos? Do you have any code that demonstrates a problem. Note that we're not actually bluetooth experts here so your report is assuming lots of prior knowledge. I don't know what "interval" you're referring to for example. Unless you can clarify what you're reporting in a way I can investigate a problem you're unlikely to get any help.
Fair call, ill throw together a simplified repo that has an example for both sides of the pico. Ill admit I also don't really have much knowledge on the matter either, this was just what i gleamed after some experimentation with some of the btstack options, and some research.
From what i understand, BLE has a concept of a connection interval, which both sides of the connection agree on, and then the host will send out a packet each time the interval is hit. This can be configured but there is a lower limit of 7.5ms. It sounds like however you can sent multiple packets within this interval, which is how devices can update faster than 7.5ms.
I have essentially taken the hog_keyboard_demo and just have it sending data as often as possible, and with a PC (either using the linux bluetooth stack or btstack via libusb) it seems to be able to update at ~1ms or so, which suggests that this side of the equation is able to send out multiple packets per interval. I even left this side at the default connection interval of 30ms, so it is sending multiple packets per interval.
I then took the hog_host_demo and added a line to print out how often it receives data. It appears that
GATTSERVICE_SUBEVENT_HID_REPORTis only ever fired once per connection interval here, so by default i only seem to get one report every 30ms. I can adjust the connection interval withgap_set_connection_parametersand if i lower it to the minimum 7.5ms value, then i also noted that I would get reports every 7.5ms.I am using the background method, on both the device and the host.
Ok, thanks for adding some context. Examples (or modifications to existing examples) would be useful. In the background mode, we get an interrupt via a gpio to tell us there might be work to do (cyw43_gpio_irq_handler). This ends up in a call to cyw43_poll_func. We ask the chip if there's any work to do (cyw43_ll_bt_has_work) and call cyw43_bluetooth_hci_process which signals that a btstack data source has work to do. BTstack calls hci_transport_cyw43_process which keeps reading hci commands. So if the chip thinks there's nothing to do or there are no hci commands to read we won't try and "receive" anything. I would avoid debugging via logging as it's likely to affect timings. Probably best to use a logic analyser to work out what's going on.
@peterharperuk if there are more than one ACL packet stored in the cyw43 ring buffer, will all of them get processed in a row until it's empty? or does this require another interrrupt via the GPIO line?
@mringwal I think it should yes. hci_transport_cyw43_process keeps reading hci commands until there's no data (or an error). It's possible this loop is faulty somehow. It should perhaps keep going while cyw43_ll_bt_has_work is true. It might be worth debugging this area (without using printf).
https://gist.github.com/sanjay900/fe87afaad7474707459718d0945da759
Here is my gamepad implementation, i am currently testing by just sending a random value to an axis on each tick, which I can then use tools like
evhzon linux to test with. For the pico receiver, the standard hog_host_demo is enough to demonstrate the problem, simply just printing the milliseconds since the last GATTSERVICE_SUBEVENT_HID_REPORT is enough to show the issue (I was actually testing this with a program that would redirect the inputs directly to USB hid and testing with evhz, so I was not dealing with printf delays on that front)You can listen to the LE_CONNECTION_COMPLETE event to get an idea of what the current interval is. I added this to the hog example locally just to work out what the current interval even was.
If you do just want to see the actual project i am testing with, it is at https://github.com/sanjay900/Ardwiino
@sanjay900 Could you run gatt_streamer_server on one pico and le_streamer_client on the other. le_streamer_client should be configured to use TEST_MODE_ENABLE_NOTIFICATIONS - so it's only receiving. As the demo prints the throughput, we can check how many packets are sent per interval.
I still don't see how only a single packet could get received in a connection interval. The sender in peripheral role will send as long as the central allows it to send and the central will keep the connection event open until it's buffers overflow. event with controller to host flow control, we should get a least a few packets per conn interval.
Let me just build both of those and i will give it a try
Hmm, doesn't seem to be working right, here are the logs from the le_streamer_client
And from the gatt_streamer_server:
@peterharperuk did anybody complain about all pico w using the same BD ADDR? In @sanjay900's logs, both have 43:43:A2:12:1F:AC - the first 6 hex digits indicate the used controller, a 4343A2.
I don't remember exactly, but BTstack avoids connections to devices with the same BD ADDR, as that allows for some sneaky security hacks.
@sanjay900 Thanks for trying. I can check myself tomorrow or Friday.
It does however seem like something is broken with updating the connection parameters, as commenting out
gap_request_connection_parameter_update(con_handle, 12, 12, 0, 0x0048);is enough to make it run. I actually found this myself too when i was looking for ways to increase my connection interval, but just assumed i was doing something wrong when it hung.@peterharperuk
Do you want this raised as a separate issue, or just kept here? I have no idea where that problem lies as it is just something i have found by testing.
@mringwal here is the output with that line commented out
@mringwal
I know there are fixes for that in the develop branch, and I also had that thought myself but i ran my hid code with the develop branch and didn't really find it affected anything.
To run these examples I just pulled the pico-examples repo down for running these tests, which grabbed the currently released SDK which doesn't have the fix for BT addresses.
Yes 43:43:A2:12:1F:AC is the default btstack address (hardcoded in the infineon firmware to always be the same). I have a fix on develop that makes sure the btstack address is +1 the wifi mac address.
However I still haven't got to the bottom of why this issue is happening. I was unsure if it was because the OTP had not been set in the factory or if we had devices with duplicate addresses. @sanjay900 I would appreciate it if I could see the lines that say something like this for both the devices you have...
what defines do i need to set to make those lines show up?
@peterharperuk I can get the outputs for one of them now, and ill hook up a UART to the other one tomorrow. If it helps i can test the other ones i have as well?
@sanjay900 thanks. It seems that OTP is set in your device, but for some reason the bt device address is not set. This is isn't the case with the devices I have suggesting something has changed in the factory.
@sanjay900 good idea to skip the conn param update. With 30 ms and about 6.5 kB/s, we end up with 200 bytes per connection interval, which would indicate a single packet with 200 bytes (if DLE is supported and I think it is).
@mringwal Out of curiosity, any idea why the conn param update breaks things?
I figured id try running the
le_streamer_clienton my pc using the libusb port, with a pico w running thegatt_streamer_server, and got this result:Here are the results if i run the
gatt_streamer_serveron my pc with the libusb port and thele_streamer_clienton my pico w:Interestingly, even when running the
gatt_streamer_serveron my pc with the libusb port, I still needed to comment out the conn param line for the connection to work@peterharperuk not sure if you still need this but heres that line from the other pico:
I was wrong i did only buy just these two.
If there is anything else i can provide let me know
Well, the controllers seem to fail in synchronizing the change. You can try to use slave latency = 4 with the connection interval = 15 ms, too.
Minor update: I've repeated the test with le_streamer_client on Pico W and gatt_streamer_server on my Mac with an USB CSR8510 dongle and as able to get a air trace using our Raccoon nRF5x sniffer.
I get the same (low) throughput. Interestingly, as the CSR8510 does not support DLE, the 200 bytes test packets are split into several smaller packets over the air. Still, only one of these packets are send per connection interval. The packets indicate that the peripheral (CSR8510) always has data to send, but the central (pico_w) does not/cannot receive it. While not impossible, I cannot imagine that the CYW43 can only receive this 200 bytes per connection interval. Quick test replacing the pico_w/cyw43439 with a CYW20704 on my Mac, I get 25 kB/s as well.
My hypothesis here is that they get stuck in the CYW43 on the Pico W. Will review the code a bit more to see if we can more details on this.
Thanks for looking into it :)
To get deeper, I've reviewed the code (no issues there) and toggled a GPIO while in a) hci_transport_cyw43_process, b) cyw43_bluetooth_hci_read, and c) the processing in BTstack. Please see attached traces.
When testing against a CYW20704, I did get 66 kB/s when sending 200 byte packets. With lower packet sizes, the throughput goes down. One fact is that the CYW20704 has 8 buffers for LE ACL packets. If we receive them faster than we can read the with the RP2040, this could be a bottleneck.
@peterharperuk : in the traces for smaller packet sizes, hci_transport_cyw43_process is entered, but cyw43_bluetooth_hci_read seems to report no data to read. I don't know what to make of that.
@sanjay900 : what's your project requirements? Is it pico<->pico only? You can 'play' with the connection interval and the packet size (e.g. sending multiple reports in one packet if you don't need to comply to a standard). You could also try to use Bluetooth Classic HID to see if that works better for your case.
I still don't know what's really going on. One idea would be to ask Infineon if they can increase the number of LE ACL buffers (right not 8 x 251 ~ 2 kB are used and the Controller should have way more memory). e.g. 16 buffers? :0) this might help. I've also tried shorted connection intervals and in one session just got broken links while in another, it worked as expected with the same hardware on my table.
traces.zip
@mringwal If i can i would like to stick with something HID based, as my goal is for my game controller to still work with a PC normally, and then for the pico <-> pico bit to be only necessary if a user would like to use their controller on a game console.
I originally tried bluetooth classic but it seems that had a lower latency even with just a PC when i tried that originally, but i didn't actually change any settings from the defaults in the classic examples.
@sanjay900 In that case, I would suggest to try the Classic HID examples :)
Ill give that a go again tomorrow and see if i can work out a way to get them working at a decent speed.
it seems going to classic HID cuts the poll rate to around 374hz with a pc, though thats just using the default hid example, are there things i can tweak there to get a lower latency out of it?
Well, that's one report every 3 ms. isn't that good enough? :)
you can compare to same code with libusb.
See it would be if BLE wasn't giving me 850hz haha
These controllers are being used for rhythm games so the lower the better really
Is it possible to ask infineon if they have any idea whats going on / if they can increase the number of LE ACL buffers?
Hi
What about this: the problem only happens when receiving on the Pico W. If you receive HOG from your PC it's fine, right?
In this case, you could provide a separate mode for Pico W <-> Pico W communication. Instead of sending a single report in single packet, you could add a second 'Burst HOG Service' where multiple reports are send in a single packet (up to 250 bytes..). By that, you should be able to send even more reports per second than previously.
best
Matthias
ill see if i can figure out how to do that and give it a go, are there any examples of doing anything remotely similar to this?
nothing that contains the logic, but the gatt_streamer_server and le_streamer_client show how to send data as fast as possible. You only need the notifications on the server side.
For your use case, you can follow le streamer and try to check if the streamer service is available. If yes, you use that. If not, you use the existing hog client as before.
If someone can summarise the problem and question we need to ask, I can send something to Infineon.
Ok, let me try.
When trying to send many small packets (e.g. HID reports over GATT), the CYW43439 receives less than expected - the connection interval isn't fully used even when using the minimal connection interval of 7.5 ms. An air trace shows that CYW43439 in Central role ends the connection event.
Our hypothesis here is that we cannot get the packets out of the Controller via the shared bus fast enough which causes all incoming ACL buffers to get full. When sending larger data, we can achieve optimal throughput. From HCI log, it looks like there are current 8 ACL LE buffers of 251 bytes. Is there any RAM left to increase the numbers of buffers, e.g. to double the numbers of buffers to validate this hypothesis?
@mringwal thanks for that
@peterharperuk thank you, have you had a chance to send any comms to infineon yet?
No - I'll do it now.
Thank you
Would you guys be able to test this updated firmware? https://github.com/peterharperuk/cyw43-driver/tree/Updated_BLE_ACL_Config
Please just use this for testing. It seems faster to me but I'm not sure how to test for your use case. You will have to go into pico-sdk/lib/cyw43-driver and checkout the Updated_BLE_ACL_Config branch from my repo. In debug on boot it should say the following...
BT FW download, version = CYW4343A2_001.003.016.0058.0000_Generic_SDIO_37MHz_wlbga_BU_dl_signed + Updated BLE ACL Config
They say it "has host_claim_host_to_device_count, host_to_device_count and device_to_host_count updated value to 16 (from default value 8)."
I used this version of the firmware but unfortunately it does not appear to have fixed the problem.
@sanjay900 Could you provide some measurements? If you're using the HOG device/host: how man HID reports are sent/received per connection interval? how many bytes are in one report?
Would you have a packet log with the test firmware?
Well, I might have now. BTstack was using a max ce length of 0xffff and while nobody really knows what this value is used for, it looks like 0xffff causes a disconnect, while all other values are ok.
Could you update to the current BTstack develop branch (which uses max ce length = 0) and verify that the conn param update works now?
With HOG device/host, it is still just one packet per interval. I don't really have a easy way to get a packet log, but there are 27 bytes per report.
Thanks, that's a start. Which connection interval is this? And how many packets do you get per conn interval on the PC with the same connection interval?
@mringwal Can confirm, using the latest develop branch did fix the conn param update. With that, i set my transmitter to request a 7.5ms interval with a latency of 0.
For testing, i have just been emulating a gamepad, and assigning a random value to the joystick, and this then ends up sending out a new report as often as possible. With the hog/host, i have then been emulating a usb gamepad and feeding all bluetooth inputs directly to it.
For HOG device/host, i end up with a average poll rate of 129hz or so, which ends up being close to around 1 packet per 7.5ms interval
For HOG device/pc, i end up with an average poll rate of around 750hz, which ends up being just over 5 and a half packets per interval
Did you check if 7.5 ms connection interval was used in both cases?
Yeah, i have the firmware printing out the connection params
And if the connection interval is different with the HOG host, than the poll rate also suffers with the exact relationship youd expect for a single packet per interval
@mringwal were there possibly any settings in
btstack_config.hthat i should play around with with the new firmware?@sanjay900 No, there aren't. I'd need to get an air trace to confirm that it's still the central side that slows down, then the question is why. I was busy with other stuff though.
@peterharperuk should this be in 1.5.1 milestone?
@mringwal have you had a chance to grab an air trace? Sorry that i can't help there i don't have the tools for that myself
@kilograham No - it shouldn't be on 1.5.1
@sanjay900 Sorry, nope, was busy otherwise.
How urgent is this for your project? Could you use a custom solution, e.g. sending multiple reports in a single notification to get full throughput if the connection is between two Pico Ws for the time being.
It's unclear what exactly is causing this (stack, interface to controller, controller itself, radio link). The air trace might narrow this a bit down.
Yeah for the moment I'll do something custom, was just curious if you'd had
any time to look into it or not
On Tue, 13 Jun 2023, 9:19 pm Matthias Ringwald, @.***>
wrote:
@sanjay900 I'm glad to hear. The nice folks at Raspberry will get to this as well, but there's the 1.5.1 release upcoming now - I've heard :)
Nice, good to hear they will get to it at some point
@mringwal Back on April 12, you said
Have you resolved whether DLE is supported? The documentation for the BlueKitchen stack says "Don't Know" for DLE support for the CYW43439. The file
pico-examples/pico_w/bt/config/btstack_config.hdoes not contain#define ENABLE_LE_DATA_LENGTH_EXTENSIONbut the BlueKitchen btstack/port/raspi/btstack_config.h directory does. Is there some work to do to enable DLE that requires calling the HCI commands thatENABLE_LE_DATA_LENGTH_EXTENSIONenables?@rppicomidi The 43439 supports DLE. I have a HCI trace which contains a LE Data Length Change to 251 bytes, which indicates that DLE has been activated for that connection.
You are correct that
pico-examples/pico_w/bt/config/btstack_config.hdoes not definesENABLE_LE_DATA_LENGTH_EXTENSION, which is needed for DLE. To enable DLE, you can add it to btstack_config.h yourself.@peterharperuk could you add
ENABLE_LE_DATA_LENGTH_EXTENSIONto the default configuration in the pico-examples repo?Yes - I have raised this so I don't forget https://github.com/raspberrypi/pico-examples/issues/406
@mringwal @peterharperuk Thank you!
@mringwal
how exactly would one send more than one report in a single notification?
I've setup a test environment with a CSR8510 as Peripheral connected to my Mac and the Pico W with the CYW43439 in Central role.
The CSR8510 is an older Bluetooth v4.0 USB Bluetooth dongle, which does not support DLE or 2M-PHY, but is able to send the max amount of PDUs per connection interval (hence, it's trustworthy from my side).
The Peripheral is sending GATT notifications of 20 bytes, similar to the HID reports in the original issue, the Central only receives the Notifications.
With the new firmware, I got 500-900 packets per second, depending on the connection interval (30ms, 15ms, 7.5ms). With 15 m I got 850 and with 7.5 ms even 900 packets.
This is a reasonable number of packets per interval, and clearly more than one packet per interval.
@sanjay900 Could you try to repeat this with the firmware @peterharperuk posted above https://github.com/raspberrypi/pico-sdk/issues/1342#issuecomment-1541775040 and use the same settings for GATT Streamer as well as LE Streamer client?
Thanks @mringwal. Is the new firmware behaving better than the current release firmware?
@peterharperuk To be honest, I didn't go back. As mentioned in the support case, more buffers doesn't hurt. Would it help if repeat the same test with the firmware from master?
Should I replace the UF2 on the currently hosted on the datasheets site with an updated one?
@aallan The firmware was for debug / test purposes only. We would need an official release from Infineon
@mringwal I would like to know how the current firmware is behaving before we spend time getting a new official version of the firmware.
@peterharperuk I see. I'll re-run the same tests with the other firmware then.
Just so i can be sure, what are you using for your
btstack_config.h?@sanjay900 btstack_config.h is was not modified.
@peterharperuk As expected/feared, I get pretty much the same throughput values with the firmware on master/v1.0.1
@sanjay900 btw. I'm using the 'poll' version of the Pico run loop variants. Please use that as well to minimize the differences.
I wonder if it's dle related, as I was able to replicate your results, so I went back to hid, and it seems that with a report size of 20 things work, but with a report size of 28 I get limited to the interval again. I'll play around with this more tomorrow, and I'm happy to just shorten my report size and call it a day but it's an interesting result nonetheless.
That also explains why I didn't see this before when I tested previously - I did not shorten test data to 20 bytes when I tried this last time.
@mringwal if you use a test_data size of 28, do you see a reduced rate?
@sanjay900 Thanks for the feedback. When you play around a bit more, I'd be interested what's the smallest size where it slows down. Just enabling DLE doesn't cause an issue, right?
If we can find a clear test case, we can report it back.
I haven't tried 28, but that would requires DLE which is not supported by the CSR8510. I'll need/can use a different dongle then.
20 bytes appears to be the magic number, anything higher and i get limited to the interval
As for a test case, this works perfectly. settting
test_datato 20 results in a rate of around 15 kB/s, while with it set to 21, the rate drops to 1.5kB/s.I used two pico ws, and I kept the server running, all i did was change
test_dataon the client, everything else stayed the same.@mringwal Im just glad you somehow picked 20 bytes and that just happend to be the fix haha, don't think i would have figured this out as that wasn't even a consideration on my mind! Weird though that its 20 bytes and not 27, that means something else is at play here i guess.
Also, i can confirm that the run loop doesn't matter, i was replicating these results on the
threadsafe-backgroundvariant as well.I just redesigned all my HID reports to be within 20 bytes and now im getting >850hz between the two picos haha, awesome.
@sanjay900 Glad we found this workaround for you. The limit is 20 bytes as there's a 3 byte ATT header for notifications and a 4 byte header for L2CAP, so the ACL packet will be 27 bytes, which is the maximum packet size without DLE.
I'll probably re-run the tests with 21 bytes payload tomorrow. If that becomes slow, as in your tests, we might have something to show Infineon.
@mringwal that makes sense, i figured there were headers in play. It was kinda good cause it gave me an excuse to do some things more properly, so now im sending 7 byte reports instead of 28 byte ones lol.
I've tested this again without DLE. The issues shows there as well. Throughput drops from 11 kB/s to 0.7 kB/s when increasing from 20 to 21 bytes. I would have tolerated up to half the throughput (as two packets have to be sent over the air), but the air trace shows that only one 28-byte packet is sends as a 27 bytes and a 1 byte packet is sent per connection interval.
Good to have it replicated,.and in a way that's easy to demonstrate
On Fri, 21 Jul 2023, 1:59 am Matthias Ringwald, @.***>
wrote:
Any updates?
No. The issue is still open against the wifi vendor.
Any update on this bug ? is there an ETA ? ty!
Also would appreciate an update on this
It requires firmware changes which I think means it's unlikely to happen.
thanks @peterharperuk
IIRC, Infineon should fix it, correct ?
And also, without this fix, there is no possible workaround, correct ?
ty.
@ricardoquesada how does this affect your project?
From going through the comments, I'm not able to fully summarize the issue:
It would be nice to test what happens to e.g. 40 byte packets that have to get split into two almost full packets.
@mringwal
TBH, I don't fully understand this bug.
Some Bluepad32 users reported that some packets are "delayed" (or "lost") when using Pico W. But this bug does not appear on ESP32.
By packets I mean HID reports from Gamepad controllers.... (not sure whether they were BLE or BR/EDR packets... I have to double-check it).
My understanding is that as soon as the packet arrives to HCI, it sends it to BTstack, and BTstack sends it to Bluepad32... and there is no "buffer manipulation": no copies of buffers, not a pool of buffers, etc...
So, Bluepad32 receives the packet "directly" from the "wire".
So, users were concerned with why some packets were "delayed".
A user did some investigation and found this bug. I looked at it and seems similar to what the users noticed.
@mringwal what is DLE ? and how can I test it ?
(I don't have the test equipment with me ATM, but I can try it in about 2 weeks)
@ricardoquesada No Bluetooth HCI ACL packets (e.g. HID) have been harmed / lost!
This issue is about a significant drop in throughput, but no data is getting lost on the receiving side. You would "just" get less HID reports. There might be a question about what the game controller does if it cannot send as fast as it likes. In any case, this behaviour is 100% deterministic and not sporadic.
(DLE is Data Length Extension, which allows to send packets larger than 27 bytes (23 usable for ATT PDUs -> 20 bytes payload for notification)).
@mringwal
got it. I"ll try to reproduce it locally with some BLE controllers, with some HCI dumps (in case it helps).
but IIUC, there nothing that we can do in BTstack/Pico SDK to mitigate the bug, correct?
(e.g: Tell the gamepad controller to not send packets bigger than 20 bytes, or similar)
For context: this seems to be an important bug for Bluepad32 users. Bluepad32 is used mostly to interface with robots and/or retro gaming consoles, and a 500ms in delay heavily affects the usability.
@ricardoquesada No, there's not much you could do. Please try to reproduce, I don't think this explains your delays. Even with this issue, the Controller can receive one ACL packet per connection interval of 7.5-15 ms, so that's way below 500 ms and no problem to control stuff.
@mringwal ty. I"ll do that.
(TBH, I don't recall the delay the users reported... perhaps 500ms is too much... in any case, I'll do my own testings and report my findings here... in about two weeks once I got home)
(better late than never...)
I think I figured it outWhen there is a connected device and Pico is in "scanning mode", then it will delivered the packets from the connected device with some delaysHowever, when I stop "scanning mode", the packets from the connected device don't have any kind of delayIndeed, disabling scanning mode seems to have more throughput, but the latency increases like ~0.5 when scanning is disabled (?)... But when I re-enable it it does not improve the latency.
I'll attach relevant logs later today.
update:
I have HCI dump working
oudated:
side question: how do I capture/print the HCI packets on Pico ?
Like this ? (it is in my notes, but I don't see any HCI packet on UART)
If the CYW4343 needs to scan for device it reduces the time it can use for the ACL connection, so it's recommended to turn of scanning once you're connected.
@mringwal yes, thanks. At this point I'm sure what is triggering the bug.
Need to do more tests (had a very week last week, hopefully tomorrow I'll be able to continue with the tests)