This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Slow transfer rate when sending Notifications to Android (Samsung Galaxy S8)

Hi guys,

We've written a small test on-top of our internal Bluetooth library (glorified wrapper sat on-top of SDK 15.2.0 SD140 6.1.1) on the nRF52840 to send dummy bulk data via notification on a single characteristic.

When we run this test on iOS, we get exactly what we expect, a 30ms connection interval and ~3KB/s.

When we run this test on a fully up-to-date Samsung Galaxy S8 (Android 8.0.0) we observe a 7.5ms connection interval but receive only ~2KB/s, where we would expect at least greater than iOS, ideally much more so.

We perform the test as follows:

  • When notifications are turned on by the nRF Connect App (have also tried LightBlue), we post 4 notifications of 20B each via sd_ble_gatts_hvx().
  • Upon the BLE_GATTS_EVT_HVN_TX_COMPLETE event, we inspect event->evt.gatts_evt.params.hvn_tx_complete.count and post a callback to the nRF scheduler for each sent notification (the scheduler is not busy doing anything else).
  • For each callback, we increment a counter and we post 4 more notifications, we don't care about dropping data as this is a throughput test, we're just trying to keep the internal buffer populated.
  • We transfer continuously for 1 minute then pause execution and inspect the counter.

We verify the connection interval by inspecting p_actual_conn_params in ble_conn_params.c.

Other parameters:

  • Preferred Min Connection Interval 6
  • Preferred Max Connection Interval 100
  • Preferred Salve Latency 1
  • Preferred Supervision Timeout 100

Any suggestion as to why we might be seeing reduced performance on Android vs iOS?

Many thanks

Parents
  • Hi,

    How many packets per connection interval are you seeing?

    What is the value of NRF_SDH_BLE_GAP_DATA_LENGTH, NRF_SDH_BLE_GAP_EVENT_LENGTH and NRF_SDH_BLE_GATT_MAX_MTU_SIZE in sdk_config.h ?

    If you want to see exactly what is happening on-air, I would recommend the nRFSniffer(v2).

  • Thanks Sigurd,

    I'll try the sniffer later on in the week, is there any easy way to confirm packets per interval without using the sniffer?

    NRF_SDH_BLE_GAP_DATA_LENGTH 27
    NRF_SDH_BLE_GAP_EVENT_LENGTH 6

    NRF_SDH_BLE_GATT_MAX_MTU_SIZE 23

    I am limiting the MTU size on purpose as I'm trying to ensure it's not a factor in this test.

  • Hi,

    Scribble said:
    I'll try the sniffer later on in the week, is there any easy way to confirm packets per interval without using the sniffer?

     After one or more notifications are sent, you will get an event BLE_GATTS_EVT_HVN_TX_COMPLETE with count field showing "Number of notification transmissions completed.". But you could get several of these events within the same connection interval, so you would need to e.g. use the app_timer and add some logic to see how often you get these events, and then calculate the numbers of packets that is transmitted within the connection interval. Personally, I use the sniffer for this kind of debugging.

    Scribble said:
    NRF_SDH_BLE_GAP_EVENT_LENGTH 6

     Try to increase this value. Set it to e.g. 320.

Reply
  • Hi,

    Scribble said:
    I'll try the sniffer later on in the week, is there any easy way to confirm packets per interval without using the sniffer?

     After one or more notifications are sent, you will get an event BLE_GATTS_EVT_HVN_TX_COMPLETE with count field showing "Number of notification transmissions completed.". But you could get several of these events within the same connection interval, so you would need to e.g. use the app_timer and add some logic to see how often you get these events, and then calculate the numbers of packets that is transmitted within the connection interval. Personally, I use the sniffer for this kind of debugging.

    Scribble said:
    NRF_SDH_BLE_GAP_EVENT_LENGTH 6

     Try to increase this value. Set it to e.g. 320.

Children
Related