Closed Bug 871438 Opened 11 years ago Closed 11 years ago

[bluetooth] Unable to watch video sent to b2g phone via BT

Categories

(Firefox OS Graveyard :: Bluetooth, defect, P1)

x86
Gonk (Firefox OS)
defect

Tracking

(blocking-b2g:leo+, firefox22 wontfix, firefox23 wontfix, firefox24 fixed, b2g18 fixed, b2g18-v1.0.0 wontfix, b2g18-v1.0.1 wontfix)

RESOLVED FIXED
1.1 QE2 (6jun)
blocking-b2g leo+
Tracking Status
firefox22 --- wontfix
firefox23 --- wontfix
firefox24 --- fixed
b2g18 --- fixed
b2g18-v1.0.0 --- wontfix
b2g18-v1.0.1 --- wontfix

People

(Reporter: leo.bugzilla.gecko, Assigned: echou)

References

()

Details

(Whiteboard: [TD-26098][fixed-in-birch])

Attachments

(4 files, 1 obsolete file)

GENERAL Defect Description 
1. Title : Unable to watch video sent to b2g phone via BT
2. Precondition : b2g phone1 paired with b2g phone2
3. Tester's Action : 
  1) Try to send video file via BT to phone1 from phone2 
  2) Cancel the receiving file on phone1 
  3) Try to send same video file via BT to phone1 from phone2 again 
  4) file transfer complete
  5) Click the received file on noti bar
4. Detailed Symptom : Can not see video only black screen appears
5. Expected : video should be played without any problems
6.Reproducibility: Frequency Rate : 100%

Dear Mozilla Team,

when file tranfer is canceled and received again, file header seem to changed.
Please check the cancel process of opp.

Thanks.
Assignee: nobody → shuang
blocking-b2g: --- → leo?
Whiteboard: [TD-26098]
Assignee: shuang → echou
It looks very similar with Bug 851995. Please confirm if this is a dup. If it is, then please close this as a duplicate issue.

Thank you.
Depends on: 851995
Flags: needinfo?(leo.bugzilla.gecko)
Dear Mozilla Team,

I think that Bug 851995 is not related this.

Because file size is increased a little when a opp cancel, so this symtom seems that unnecessary packet is inserted to header during opp cancel and send.

If you try this action, then it is reproduced easily.

Thanks.
Flags: needinfo?(leo.bugzilla.gecko)
Target Milestone: --- → 1.1 QE2
blocking-b2g: leo? → leo+
Priority: -- → P1
(In reply to leo.bugzilla.gecko from comment #2)
> Dear Mozilla Team,
> 
> I think that Bug 851995 is not related this.
> 
> Because file size is increased a little when a opp cancel, so this symtom
> seems that unnecessary packet is inserted to header during opp cancel and
> send.
> 
> If you try this action, then it is reproduced easily.
> 
> Thanks.

Hi,

I tried your STR and still couldn't reproduce. Here's the step-by-step I tried:

1. Use my HTC Sensation XL to record a video which is 1249838 bytes long.
2. Send the recorded video to my FFOS device via bluetooth.
3. Accept the request (the file size shown on the dialog is 1.19 MB) from my FFOS device, so the transfer begins.
4. Interrupt the transfer.
5. Send the same video from my HTC device again.
6. The request pops up, and the file size shown on the dialog is still 1.19 MB. Accept the request and the transfer begins.
7. Wait until it finishes, use adb to check the file size. It's 1249838 bytes, which is what I expected.

However, the video could not be opened from tapping the notification on notification bar. I would get below error and the black screen like the attached screenshot.

E/GeckoConsole(  946): [JavaScript Warning: "HTTP "Content-Type" of "application/octet-stream" is not supported. Load of media resource blob:5a9f906d-352f-4826-ba79-a42cd8042084 failed." {file: "app://video.gaiamobile.org/view.html" line: 0}]

I followed the same steps and tested with gecko/mozilla-central:gaia/master, the video could be played without any problems. I'll investigate more tomorrow.

= Build info =

Gecko (b2g18, with patch of bug 872238) :
119383:ad04d81b3eeb
user:        Dave Hylands <dhylands@mozilla.com>
date:        Tue May 14 10:44:25 2013 -0700
summary:     Bug 871956 - Fix regression introduced by bug 858416. r=kanru, a=leo+

Gaia (v1-train):

commit f4a59b245ea762eea2e9a30fc136229c0fe6f73f
Author: John Ford <john@johnford.info>
Date:   Thu May 9 14:41:16 2013 -0700
Bug 870548 - Gaia commit information should have the commit time, not authoring time r=fabrice
(cherry picked from commit c9049cb2dc3e6b28670c5575448ca3c7d3d1cbe5)
Dear Mozilla Team,

Can you try to test the same step with leo and leo device?

Thanks.
(In reply to leo.bugzilla.gecko from comment #5)
> Dear Mozilla Team,
> 
> Can you try to test the same step with leo and leo device?
> 
> Thanks.

I got the same result as I mentioned in comment 4 when testing with my Leo device.

I just talked to Dominic to make sure that our Gaia guys know about the black screen issue. He told me that bug 850941 would fix the black screen problem, and Bug 851995 would fix the 'video app won't be launched' problem. Both bugs are leo+ and ready to land, therefore I suggest that we wait for them being merged and see if this problem will still exist.
Dear Mozilla Team,

Ok, I suspect the bug 850941, so I'll check it and let you know.

Thanks.
Attached image opp_extran_byte
Dear Mozilla Team,

I applied patch in bug 850941, but black screen is still appeared and transferred file seem to be broken. 

Onclick BT creates MozActivity With the file name and blob data of the  selected file. Blob data is corrupt (adding extra bytes to the header) Hence it is not able to parse the file.

I have attached the screen shot shows the extra bytes.

Please check the opp process.
Thanks.
I think we need the patch in bug 850542 for that to work.
Dear Mozilla Team,

I found the suspect point as below.

When a transfer canceled and again start transfer, sSentFileLength is added mBodySegmentLength in ServerDataHandler() of BluetoothOppManager.cpp.

if (mWaitingForConfirmationFlag) {
      ReceivingFileConfirmation();
      sSentFileLength += mBodySegmentLength;
      return;
    }

Maybe packet size is increased because mBodySegmentLength is not initialized.
So file type seem to be broken and video file cannot play.

I try to fix this as below,

BluetoothOppManager::AfterFirstPut()
{
  mUpdateProgressCounter = 1;
  .........................
  mSuccessFlag = false;
  mBodySegmentLength=0; //init mBodySegmentLength
} 

After this fix, this bug is not reproduced and opp is working well.

Please review this code and let mo know your opinion.
Thanks.
(In reply to leo.bugzilla.gecko from comment #11)
> Dear Mozilla Team,
> 
> I found the suspect point as below.
> 
> When a transfer canceled and again start transfer, sSentFileLength is added
> mBodySegmentLength in ServerDataHandler() of BluetoothOppManager.cpp.
> 
> if (mWaitingForConfirmationFlag) {
>       ReceivingFileConfirmation();
>       sSentFileLength += mBodySegmentLength;
>       return;
>     }
> 
> Maybe packet size is increased because mBodySegmentLength is not initialized.
> So file type seem to be broken and video file cannot play.
> 
> I try to fix this as below,
> 
> BluetoothOppManager::AfterFirstPut()
> {
>   mUpdateProgressCounter = 1;
>   .........................
>   mSuccessFlag = false;
>   mBodySegmentLength=0; //init mBodySegmentLength
> } 
> 
> After this fix, this bug is not reproduced and opp is working well.
> 
> Please review this code and let mo know your opinion.
> Thanks.

mBodySegmentLength should be assigned in ExtractPacketHeaders() unless the PUT packet does not contain header |Body| or |EndOfBody|. Could you check it for me please? Sniffer log (or hcidump ) helps, too.
I found another problem when trying to reproduce this. Bug 875650.
I found that my STR in comment 4 is slightly different from the STR described by reporter in comment 1. I cancel the transfer session from "receiving device", but the reporter cancels from "sending device".

I retried and found a problem which is filed as bug 875650, however, with current codebase, the user should not be able to send files again if he stops the transferring from "sending device". 

ni? reporter since we need more clues. Could you please attach the video of how you reproduce this? Thanks.
Flags: needinfo?(leo.bugzilla.gecko)
Dear Mozilla Team,

Maybe our b2g versin is different with yours.
My device can restart once stop sending.

I attached the reproduced video file.
Please check it.

Thanks.
Flags: needinfo?(leo.bugzilla.gecko)
Attached video opp_cancel
Thanks, let me try again later.
Hi Leo,

Thanks for the video. It's quite clear and I can confirm the problem.

Like the reporter said in comment 2 and comment 11, when the transferring session was stopped, mBodySegmentLength wouldn't reset to 0. That would impact the next transferring if the first packet of the next transferring doesn't contain header Body or EndOfBody, which would invoke ExtractPacketHeaders() and refresh mBodySegmentLength in the function.

I'll make a patch and get this fixed today. Thanks for all the help.
(In reply to leo.bugzilla.gecko from comment #11)
> Dear Mozilla Team,
> 
> I found the suspect point as below.
> 
> When a transfer canceled and again start transfer, sSentFileLength is added
> mBodySegmentLength in ServerDataHandler() of BluetoothOppManager.cpp.
> 
> if (mWaitingForConfirmationFlag) {
>       ReceivingFileConfirmation();
>       sSentFileLength += mBodySegmentLength;
>       return;
>     }
> 

To be more specific, this is not the right place where the error happened. The error happens in function ConfirmReceivingFile():

  if (aConfirm) {
    StartFileTransfer();
    if (CreateFile()) {
      success = WriteToFile(mBodySegment.get(), mBodySegmentLength);  => here
    }
  }
Comment on attachment 754677 [details] [diff] [review]
patch 1: v1: reset mBodySegmentLength when the transfer session starts

Review of attachment 754677 [details] [diff] [review]:
-----------------------------------------------------------------

Looks good to me :)

::: dom/bluetooth/BluetoothOppManager.cpp
@@ +745,5 @@
>      mReceivedDataBufferOffset = 0;
>  
>      // When we cancel the transfer, delete the file and notify complemention
>      if (mAbortFlag) {
> +      ReplyToPut(mPutFinalFlag, false);

We still need to update value of |sSentFileLength| here.
Attachment #754677 - Flags: review?(gyeh) → review+
* readd sSentFileLength += mBodySegmentLength after offline discussion with gyeh.
Attachment #754677 - Attachment is obsolete: true
https://hg.mozilla.org/projects/birch/rev/aeffa1e56bec
Whiteboard: [TD-26098] → [TD-26098][fixed-in-birch]
Hi Eric,

This patch is working well on Leo device.
Thanks for your help.

Thanks.
https://hg.mozilla.org/mozilla-central/rev/aeffa1e56bec
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Flags: in-moztrap?
Flags: in-moztrap? → in-moztrap+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: