Closed Bug 830551 Opened 11 years ago Closed 11 years ago

[bluetooth] unable to send files to any other device from phone via bluetooth file transfer

Categories

(Firefox OS Graveyard :: General, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(blocking-b2g:tef+, firefox21 wontfix, firefox22 fixed, b2g18 verified, b2g18-v1.0.0 wontfix, b2g18-v1.0.1 verified)

RESOLVED FIXED
blocking-b2g tef+
Tracking Status
firefox21 --- wontfix
firefox22 --- fixed
b2g18 --- verified
b2g18-v1.0.0 --- wontfix
b2g18-v1.0.1 --- verified

People

(Reporter: parul, Assigned: gyeh)

References

Details

(Keywords: regression, Whiteboard: QARegressExclude)

Attachments

(2 files, 4 obsolete files)

Test Environment:
Device: unagi phone
Build Identifier: 20130114073222
Update channel: nightly
Git commit info: 2013-11-11 15:13:02 df38c1
Gaia Version: 45a3196a5517
Gecko Version: 5a367713bfa4

Steps to reproduce:
1. Go to Settings and turn on Bluetooth.
2. Pair the phone with another device, like a laptop.
3. Send a file from the phone to the laptop. 
4. Similarly, pair the phone with another phone and attempt to send a file to the second phone.

Actual results:
Bluetooth file transfer fails immediately with the message "Bluetooth file transfer failed. Check that the Bluetooth settings are correct." (see screenshot attached)
adb logcat so far:
I/GeckoDump(  109): XXX FIXME : Got a mozContentEvent: activity-choice
E/GeckoConsole(  109): Content JS INFO at app://system.gaiamobile.org/js/window_manager.js:1095 in createFrame: %%%%% Launching Bluetooth Transfer as remote (OOP)
I/Gecko   ( 1354): ###################################### forms.js loaded
E/profiler( 1419): Registering start signal
E/GeckoConsole( 1419): [JavaScript Warning: "Unknown property '-moz-align-self'.  Declaration dropped." {file: "resource://gre-resources/ua.css" line: 44}]
I/Gonk    (  109): dbus_func_args_timeout_valist: D-Bus error in GetServiceAttributeValue: org.bluez.Error.Failed (GetServiceAttribute Failed)
E/GeckoConsole( 1354): [JavaScript Warning: "XUL box for p element contained an inline #text child, forcing all its children to be wrapped in a block." {file: "app://bluetooth.gaiamobile.org/transfer.html" line: 0}]

Click on OK on the "Bluetooth file transfer failed" screen. 
adb logcat after that:
E/GeckoConsole( 1127): Content JS WARN at app://gallery.gaiamobile.org/js/gallery.js:1072 in anonymous: share activity error: cancelled
I/Gecko   ( 1354):
I/Gecko   ( 1354): ###!!! [Child][AsyncChannel] Error: Channel closing: too late to send/recv, messages will be lost
I/Gecko   ( 1354):

Expected results:
Bluetooth file transfer should proceed smoothly without an error.
Use Case: Bluetooth-008 As a user, I want to send or receive files and see the progress updated in the notification center so that I know what the current progress is.
Use Case: Music-027 As a user I can share my music via bluetooth file transfer.
Summary: [ → [bluetooth] unable to send files to any other device from phone via bluetooth file transfer
I see this as well using my devices and the latest nightly. I am able to successfully send files from my laptop to the device, but not the other way around.
I can reproduce this bug.

You just need to connect to 2 different devices and send file to both of them, and the second one should fail.
blocking-b2g: tef? → tef+
tracking-b2g18: ? → ---
Whiteboard: [EU_TPE_TRIAGED]
Assignee: nobody → echou
Assignee: echou → nobody
Status: NEW → RESOLVED
blocking-b2g: tef+ → ---
Closed: 11 years ago
Resolution: --- → DUPLICATE
Whiteboard: [EU_TPE_TRIAGED]
This is not a dup of bug 830040 even they failed at the same use case. The problem of Bug 830040 is about the unfriendly UX design. It's hard for users knowing where to send a music file via Bluetooth.
Status: RESOLVED → REOPENED
Resolution: DUPLICATE → ---
Hi Marcia,

(In reply to Marcia Knous [:marcia] from comment #1)
> I see this as well using my devices and the latest nightly. I am able to
> successfully send files from my laptop to the device, but not the other way
> around.

  Which OS were you using? Mac OS, Ubuntu or Windows?

Eric
Component: Gaia::Bluetooth File Transfer → General
QA Contact: wachen
(In reply to Eric Chou [:ericchou] [:echou] from comment #6)
> Hi Marcia,
Hi Eric - I was using Mac, but Parul (filed the bug) was using Windows.

> 
> (In reply to Marcia Knous [:marcia] from comment #1)
> > I see this as well using my devices and the latest nightly. I am able to
> > successfully send files from my laptop to the device, but not the other way
> > around.
> 
>   Which OS were you using? Mac OS, Ubuntu or Windows?
> 
> Eric
(In reply to Marcia Knous [:marcia] from comment #7)
> (In reply to Eric Chou [:ericchou] [:echou] from comment #6)
> > Hi Marcia,
> Hi Eric - I was using Mac, but Parul (filed the bug) was using Windows.
> 
> > 
> > (In reply to Marcia Knous [:marcia] from comment #1)
> > > I see this as well using my devices and the latest nightly. I am able to
> > > successfully send files from my laptop to the device, but not the other way
> > > around.
> > 
> >   Which OS were you using? Mac OS, Ubuntu or Windows?
> > 
> > Eric

Hi Marcia,

According to you comment, a file could be transferred from Mac to Unagi but not from Unagi to Mac, is that right? If it's the case, could you check if "Bluetooth Sharing" is enabled on your Mac? Or try to unpair and then pair again to see if that helps.

Reference link: https://wiki.mozilla.org/B2G/Bluetooth

Eric
Flags: needinfo?(mozillamarcia.knous)
Eric: This is still failing continually for me one of my Mac laptops running 10.8. Pairing and unpairing doesn't seem to work. I can still send files from my computer to the device, but not the other way around. Will try some other machines in the QA lab.

(In reply to Eric Chou [:ericchou] [:echou] from comment #8)
> (In reply to Marcia Knous [:marcia] from comment #7)
> > (In reply to Eric Chou [:ericchou] [:echou] from comment #6)
> > > Hi Marcia,
> > Hi Eric - I was using Mac, but Parul (filed the bug) was using Windows.
> > 
> > > 
> > > (In reply to Marcia Knous [:marcia] from comment #1)
> > > > I see this as well using my devices and the latest nightly. I am able to
> > > > successfully send files from my laptop to the device, but not the other way
> > > > around.
> > > 
> > >   Which OS were you using? Mac OS, Ubuntu or Windows?
> > > 
> > > Eric
> 
> Hi Marcia,
> 
> According to you comment, a file could be transferred from Mac to Unagi but
> not from Unagi to Mac, is that right? If it's the case, could you check if
> "Bluetooth Sharing" is enabled on your Mac? Or try to unpair and then pair
> again to see if that helps.
> 
> Reference link: https://wiki.mozilla.org/B2G/Bluetooth
> 
> Eric
Flags: needinfo?(mozillamarcia.knous)
(In reply to Marcia Knous [:marcia] from comment #9)
> Eric: This is still failing continually for me one of my Mac laptops running
> 10.8. Pairing and unpairing doesn't seem to work. I can still send files
> from my computer to the device, but not the other way around. Will try some
> other machines in the QA lab.
> 

No problem. Thanks for your help, Marcia.

Eric
(In reply to Naoki Hirata :nhirata from comment #11)
> bug 823803 seems related?

I think it might not be related. Marcia was using Mac, which has been tested for a period of time. I also tried but cannot reproduce. I'm going to mark this as qawanted to confirm the symptom.
Keywords: qawanted
Test Environment:
Device: unagi phone
BuildID: 20130206110509
Gecko: 99a16270175d
Gaia: 9f5a4a9f6d32
Update channel: nightly
Git commit info: 2013-02-06 18:52:47 

Able to reproduce with a Unagi phone paired with a Windows 7 laptop.

Steps to reproduce:
1. Go to Settings and turn on Bluetooth.
2. Pair the phone with another device, like a laptop.
3. Send a file from the phone to the laptop. 

Actual results:
Bluetooth file transfer fails immediately with the message "Bluetooth file transfer failed. Check that the Bluetooth settings are correct."
Keywords: qawanted
(In reply to Parul Mathur [:pragmatic] from comment #13)
> Test Environment:
> Device: unagi phone
> BuildID: 20130206110509
> Gecko: 99a16270175d
> Gaia: 9f5a4a9f6d32
> Update channel: nightly
> Git commit info: 2013-02-06 18:52:47 
> 
> Able to reproduce with a Unagi phone paired with a Windows 7 laptop.
> 
> Steps to reproduce:
> 1. Go to Settings and turn on Bluetooth.
> 2. Pair the phone with another device, like a laptop.
> 3. Send a file from the phone to the laptop. 
> 
> Actual results:
> Bluetooth file transfer fails immediately with the message "Bluetooth file
> transfer failed. Check that the Bluetooth settings are correct."

Parul, could you provide hcidump log for us? 

You may need to push hcidump to your unagi, please refer to https://wiki.mozilla.org/B2G/Bluetooth for more detail.
Issue reproduces from Unagi to Unagi:

Steps:
1. Update 2 Unagi devices to Unagi build ID 20130220070204
2. Bluetooth pair and connect both devices to one another.
3. From device A attempt to bluetooth transfer a music file to device B.

Expected:
The music file to transfer from device A to device B via bluetooth.

Actual:
Failed to transfer. In fact on one attempt device B rebooted and a crash report was observed upon finally booting up.

Repro:
3/3

NOTE:

After the unsolicited reboot of device B, transferring of music files via bluetooth worked both from device A to B and from B to A.

Gecko  http://hg.mozilla.org/releases/mozilla-b2g18_v1_0_1/rev/140d06fc3397
Gaia   b8bd76b1110417ef43a39ae28a2eeffbce1eda11
Update Channel: Nightly.(was beta but then ran revertNightly.sh script)
Kernel: Dec 5
Git: 2013-02-20  09:48:07
b8bd76b
Well, I had no luck to reproduce this bug, but I suspect the root cause here is that we didn't send out system message to Bluetooth Transfer app after receiving incorrect response code.
Please help to verify this patch, mlevin.
Assignee: nobody → gyeh
Attachment #716335 - Flags: review?(echou)
Comment on attachment 716335 [details] [diff] [review]
Patch 1(v1): Send file-transfer-complete message after receiving unexpected response code from remote

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

Gina, please check my question and see if we need to modify. Thank you.

::: dom/bluetooth/BluetoothOppManager.cpp
@@ +814,5 @@
>        str += "[OPP] 0x";
>        str += mLastCommand;
>        str += " failed";
>        NS_WARNING(str.get());
> +      FileTransferComplete();

Question: For ObexRequestCode::Abort and ObexRequestCode::PutFinal, how about calling SendDisconnectRequest() here just like what we did for receiving invalid response to ObexRequestCode::Put? Otherwise the remote device may still wait for our Disconnect request. Make sense?

In addition, if my advice is taken, we can refine this part of code since we don't need to check Put/PutFinal separately. :)
Attachment #716335 - Flags: review?(echou)
The checking response code part is refined.
Attachment #716335 - Attachment is obsolete: true
Attachment #716906 - Flags: review?(echou)
Comment on attachment 716906 [details] [diff] [review]
Patch 1(v2): Send file-transfer-complete message after receiving unexpected response code from remote

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

Looks good, but still got two questions. Almost there. ;-)

::: dom/bluetooth/BluetoothOppManager.cpp
@@ +800,5 @@
> +  // Check response code and send out system message as finished if the reponse
> +  // code is somehow incorrect.
> +  switch (mLastCommand) {
> +    case ObexRequestCode::Put:
> +      if (opCode == ObexResponseCode::Continue) break;

Based on this design, when |mLastCommand == ObexRequestCode::Put| and |opCode == ObexResponseCode::Success| are both true, we won't treat it as an error.

@@ +805,5 @@
> +    case ObexRequestCode::PutFinal:
> +    case ObexRequestCode::Abort:
> +    case ObexRequestCode::Disconnect:
> +      if (opCode == ObexResponseCode::Success) break;
> +      SendDisconnectRequest();

I would suggest that we should not call SendDisconnectRequest() again when the failed operation was exactly triggered by sending ObexRequestCode::Disconnect. ;-)
Attachment #716906 - Flags: review?(echou)
We check the response code first. For some requests, (Abort, Put, PutFinal), we'd like to send disconnect request when the response code is something we're not expected and send system message to finish the transfer, too. For other requests like Connect and Disconnect, it's not necessarily to send disconnect request.
Attachment #716906 - Attachment is obsolete: true
Attachment #716977 - Flags: review?(echou)
Attachment #716977 - Flags: review?(echou) → review+
Refine the response code checking part, and also send file-transfer-start in SendFile().
Attachment #716977 - Attachment is obsolete: true
Attachment #717029 - Flags: review?(echou)
Attachment #717029 - Flags: review?(echou) → review+
Try run for 99e34ca77556 is complete.
Detailed breakdown of the results available here:
    https://tbpl.mozilla.org/?tree=Try&rev=99e34ca77556
Results (out of 14 total builds):
    success: 14
Builds (or logs if builds failed) available at:
http://ftp.mozilla.org/pub/mozilla.org/firefox/try-builds/gyeh@mozilla.com-99e34ca77556
Try run for a15fc13ca45a is complete.
Detailed breakdown of the results available here:
    https://tbpl.mozilla.org/?tree=Try&rev=a15fc13ca45a
Results (out of 18 total builds):
    success: 17
    warnings: 1
Builds (or logs if builds failed) available at:
http://ftp.mozilla.org/pub/mozilla.org/firefox/try-builds/gyeh@mozilla.com-a15fc13ca45a
Initial fail to transfer music file from Unagi device B to Unagi device A, after pairing and connecting bluetooth. Had to power cycle bluetooth on both device to get the transfer to succeed.

NOTE: Transfer of a photo from the Gallery on Unagi device A to Unagi device B succeeded after initial pairing and connecting via bluetooth.

Information on both Unagi devices:
Build ID: 20130225070200
Gaia: 5691a16fff8e1403c75ed9d6f3a443b7e58198c6
Gecko: 3a5a27992a75
https://hg.mozilla.org/mozilla-central/rev/924c07c3cb32
Status: REOPENED → RESOLVED
Closed: 11 years ago11 years ago
Resolution: --- → FIXED
mlevin, I followed your step but had no luck to reproduce this issue. Can you try it again and provide more information? Thanks!

Note that Gecko(3a5a27992a75) was used on my unagi.
Gina,

It only reproduced 1 out of 4 tries on the following Unagi:

Build ID: 20130226070204
Kernel Date: Dec 5
Gecko: http://hg.mozilla.org/releases/mozilla-b2g18_v1_0_1/rev/819504e27351
Gaia: 823ae4703347ceb585f5d2de764d9d4138a6e892
Reproducing with hcidump log:

Test Environment:
Device: unagi phone
Build Identifier: 20130227070200
Gaia Version: 26b20494ef6b
Gecko Version: f1e39ce2164b
Update channel: beta
Git commit info: 2013-02-27 10:51:30 

Steps to reproduce:
0. Downloaded hcidump from https://bugzilla.mozilla.org/attachment.cgi?id=701662 and pushed to Unagi phone.

C:\>adb remount
remount succeeded

C:\>adb push hcidump /system/bin
1873 KB/s (119684 bytes in 0.062s)

C:\>adb shell chmod 755 /system/bin/hcidump

C:\>adb shell hcidump --hex -t

1. Go to Settings on phone and turn on Bluetooth.
2. Pair the phone with another device, like a laptop.
3. Send a file from the phone to the laptop. 
4. Similarly, pair the phone with another phone and attempt to send a file to the second phone.

Actual results:
Bluetooth file transfer fails immediately with the message "Bluetooth file transfer failed. Check that the Bluetooth settings are correct." (identical screenshot as attached earlier)

hcidump log:
HCI sniffer - Bluetooth packet analyzer ver 2.0
device: hci0 snap_len: 1504 filter: 0xffffffff
Hi Parul,

Thanks for your information. In order to clarify the root cause, I'd like to confirm the following details with you.

> 1. Go to Settings on phone and turn on Bluetooth.
> 2. Pair the phone with another device, like a laptop.
> 3. Send a file from the phone to the laptop. 

What's the result here? Did you see the banner with a message like "Transfer completed"?
- If yes, can you open the file from the laptop?
- If no, please pull down the status bar and check the transfer progress. Transfer result should be shown before you go to the next step.

For some platforms, like Windows 7, confirmations are required each time whenever receiving a file from remote unless you change the default settings. The transfer fails after timeout if no response getting from the user. (At this time, you shall be able to see a banner with message like "Transfer failed").

> 4. Similarly, pair the phone with another phone and attempt to send a file
> to the second phone.

If the previous transfer is still going on, you will get an error message as you attached immediately. Well, this is my guess and more information is needed here.

> Actual results:
> Bluetooth file transfer fails immediately with the message "Bluetooth file
> transfer failed. Check that the Bluetooth settings are correct." (identical
> screenshot as attached earlier)
> 
> hcidump log:
> HCI sniffer - Bluetooth packet analyzer ver 2.0
> device: hci0 snap_len: 1504 filter: 0xffffffff

I think this is not a full hcidump log during the steps you provided. Can you try it again and attach them here? Thanks for your help.
Nominate as tef+, we need this patch for b2g18 & v1_0_1, or we may not be able to recover from transfer failure. Please see comment 21 for more information.
blocking-b2g: --- → tef?
blocking-b2g: tef? → tef+
Verified fixed on Inari the ability to bluetooth transfer from the Inari to 2 different devices (Motorola Android phone and Leo phone).

Inari Build ID: 20130429070204
Kernel Date: Feb 21
Gecko: http://hg.mozilla.org/releases/mozilla-b2g18_v1_0_1/rev/45aa5ba0ed53
Gaia: cf2d4136f0ebc66039637fdbeb72ed184dfbc0f2

Verified fixed on Leo the ability to bluetooth transfer from the Leo to 2 different devices (Motorola Android phone and Inari phone).

Leo Build ID: 20130426070204
Kernel Date: Mar 15
Gecko: http://hg.mozilla.org/releases/mozilla-b2g18/rev/6c2493de1441
Gaia: c9046a7acef33328977840176ff5574720d2c74c
Marking as QARegressExclude. Can not verify on the firefox22.
Whiteboard: QARegressExclude
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: