OSDN Git Service

Added fd for monitoring when the channel is not congested
authorSrinu Jella <sjella@codeaurora.org>
Tue, 11 Aug 2015 13:46:52 +0000 (19:16 +0530)
committerAndre Eisenbach <eisenbach@google.com>
Fri, 25 Mar 2016 20:10:32 +0000 (13:10 -0700)
Use case:
Skips and Media Audio Loss are Observed During PAN Connection

Steps:
1. Launched Local Music and Media Audio was in Headset.
2. Paired and Connected to other Phone to DUT Over BT Tethering.
3. While  Listening to Media Audio in DUT, Started Watching
   Youtube in other phone.
4. Observed Below Observations During Some 30mins of PAN Connection.

Failure:
Skips and Media Audio Loss are Observed During PAN Connection

Root Cause:
socket monitor thread keeps polling for PAN fd, eventually
it will make the BTU thread also busy, inturn NOCP processing
gets delayed.

Fix:
Add PAN fd for monitoring only when L2CAP channel related to
PAN profile is not congested. It will break loop by checking the
congestion status to put the fd for polling.

Bug: 27852645
Change-Id: I2119c6c86d8e4798e516c512ad7aac7630b85a6a

btif/src/btif_pan.c

index c430c46..4c5b4f1 100644 (file)
@@ -787,8 +787,11 @@ static void btu_exec_tap_fd_read(void *p_param) {
         if (poll(&ufd, 1, 0) <= 0 || IS_EXCEPTION(ufd.revents))
             break;
     }
-    //add fd back to monitor thread
-    btsock_thread_add_fd(pan_pth, fd, 0, SOCK_THREAD_FD_RD, 0);
+
+    if (btpan_cb.flow) {
+        //add fd back to monitor thread when the flow is on
+        btsock_thread_add_fd(pan_pth, fd, 0, SOCK_THREAD_FD_RD, 0);
+    }
 }
 
 static void btif_pan_close_all_conns() {