[music] If the music app is already open, the music app does not list newly transferred until the music app is closed and reopened.

RESOLVED WORKSFORME

Status

RESOLVED WORKSFORME
6 years ago
3 years ago

People

(Reporter: parul, Unassigned)

Tracking

({regression})

unspecified
ARM
Gonk (Firefox OS)
regression

Firefox Tracking Flags

(blocking-b2g:-, b2g18+, b2g-master unaffected)

Details

Attachments

(7 attachments)

(Reporter)

Description

6 years ago
Test Environment:
Device: unagi phone
Build Identifier: 20130111230201
Update channel: nightly
Git commit info: 2013-11-11 15:13:02 df38c1
Gaia Version: 45a3196a5517
Gecko Version: 8f2ef4998b60

Steps to reproduce:
1. Copy an .ogg format music file on to the phone SD Card.
2. Launch the Music app.
3. Tap on the Playlist button and tap again on Recently Added. 

Actual results:
The .ogg format music file is not listed and cannot be played.

Expected results:
The .ogg format music file should be listed and be able to be played.
Use Case: Music-018 As a user, I want to play music in the formats I already have, so I don't have to convert them.

As per clarification received via email:
-------
Subject: Re: Music: Use case mapping to what is implemented in current builds
Date: Wed, 9 Jan 2013 16:14:43 -0800
From: Chris Lee <clee@mozilla.com>
To: Peter Dolanjski <pdolanjski@mozilla.com>
CC: Marcia Knous <marcia@mozilla.org>, Patryk Adamczyk <padamczyk@mozilla.com>, Chris Double <cdouble@mozilla.com> 

> Question: What are the different file formats supported for music?
MP3, AAC, Vorbis, AMR-NB 

Chris 

-------
Subject: Re: Music: Use case mapping to what is implemented in current builds
Date: Wed, 9 Jan 2013 15:41:06 -0800 (PST)
From: Peter Dolanjski <pdolanjski@mozilla.com>
To: Marcia Knous <marcia@mozilla.org>
CC: Chris Lee <clee@mozilla.com>, Patryk Adamczyk <padamczyk@mozilla.com>,  Chris Double <cdouble@mozilla.com> 

Supported music file formats:
MP3, AAC (wrapped in MP4), Vorbis.  

Peter
(Reporter)

Updated

6 years ago
blocking-b2g: --- → tef?
blocking-basecamp: --- → ?
blocking-kilimanjaro: --- → ?
(Reporter)

Comment 1

6 years ago
Created attachment 701650 [details]
Sample music file in .ogg file format

Updated

6 years ago
blocking-basecamp: ? → ---
blocking-kilimanjaro: ? → ---
tracking-b2g18: --- → ?
Component: Gaia::Music → Video/Audio
Product: Boot2Gecko → Core
QA Contact: mozillamarcia.knous
Version: unspecified → Trunk
Can someone attach a logcat with this bug?

Also - Chris, any ideas on what's going wrong here?
Flags: needinfo?(chris.double)
Keywords: regression, regressionwindow-wanted

Comment 3

6 years ago
Does the file play if you go directly to it in the browser? If so, I'd suspect the music app. If not, I'll investigate.
Flags: needinfo?(chris.double)
Yup, it's playing in the browser just fine. Moving back to the music app then..
Component: Video/Audio → Gaia::Music
Product: Core → Boot2Gecko
QA Contact: mozillamarcia.knous
Version: Trunk → unspecified
Nothing really interesting in the logcat.

Including Doug in case it's a device storage bug.
Confrimed with my b2g test phone (currently beta channel 2013-01-09 f8e15c1774e) has also never.

In browser playback works, but the Music app doesn't list local ogg or opus files. I does list the one mp3 file I copied over.
I just test the owl - ogg.ogg file and It works well on 1/14 unagi build.
Keywords: qawanted
(In reply to Randy Lin [:rlin] from comment #7)
> I just test the owl - ogg.ogg file and It works well on 1/14 unagi build.

Not working for me on 1/14. Explain to me how you tested it.
Keywords: qawanted

Updated

6 years ago
Flags: needinfo?(rlin)
Oops, my confirmation in #6 was incorrect. All the ogg files I had on the device were Ogg Opus (not recognized, although the same parser code will work for those) not Ogg Vorbis. The Music app lists and plays the .ogg files I copied over.

Comment 10

6 years ago
I tested this on an Otoro built with m/nightly gecko branch and it picked up the attached ogg file in the music app and played fine.

Comment 11

6 years ago
I tried with the m/master branch and the ogg file also played in the music app. I do not that in both branches the ogg file doesn't appear in the front screen of the music app. I went to the "recently added" playlist to see it. I'm not sure what the selection criteria is for it to appear on that first music app screen.
(In reply to Jason Smith [:jsmith] from comment #8)
> (In reply to Randy Lin [:rlin] from comment #7)
> > I just test the owl - ogg.ogg file and It works well on 1/14 unagi build.
> 
> Not working for me on 1/14. Explain to me how you tested it.

Just use unagi_2013-01-14_eng.zip nightly build, It also plays well on this version.
Flags: needinfo?(rlin)
(In reply to Randy Lin [:rlin] from comment #12)
> (In reply to Jason Smith [:jsmith] from comment #8)
> > (In reply to Randy Lin [:rlin] from comment #7)
> > > I just test the owl - ogg.ogg file and It works well on 1/14 unagi build.
> > 
> > Not working for me on 1/14. Explain to me how you tested it.
> 
> Just use unagi_2013-01-14_eng.zip nightly build, It also plays well on this
> version.

Oh. I'm actually testing on the user build for 1/14.

Comment 14

6 years ago
I also cannot reproduce this issue by using the release build of 1/14.

And I think it's better to change the title of this bug, it sounds like the attached ogg file is not listed in Music app, not because of Music app cannot play an ogg file.

Updated

6 years ago
Summary: [music] Music App does not list and does not play .ogg file format → [music] Music App does not list some .ogg file format
Keywords: qawanted
blocking-b2g: tef? → -
tracking-b2g18: ? → +
I tried testing this using the 1-28 nightly and I do see the file being added to recently added and I am able to play it. I did send the file via Bluetooth rather than adding it to the SD card.

Parul - Can you try testing this again to see if you get the same results? I will do the same.
(Reporter)

Comment 16

6 years ago
Test Environment:
Device: unagi phone
Build Identifier: 20130204070201
Gaia Version: b277f372f097c
Gecko Version: 450fd3b8496b
Update channel: nightly
Git commit info: 2013-02-01 13:43:40 

Scenario #1
Steps to reproduce:
1. Copy an .ogg format music file on to the phone SD Card. (Codec: Vorbis Container: Ogg)
2. Launch the Music app.
3. Tap on the Playlist button and tap again on Recently Added. 

Actual results:
The .ogg format music file is listed under the Recently Added playlist and can be played.

Scenario #2
Steps to reproduce:
1. Pair a bluetooth device with the phone, such a laptop.
2. Transfer via bluetooth the same .ogg format music file. Codec: Vorbis Container: Ogg)
3. Tap on the notification message when the bluetooth transfer is complete. 

Actual results:
An error message is displayed "Can not open unknown media type". (see screenshot attached)

adb logcat:
I/Gecko   (  488): ###################################### forms.js loaded
E/GeckoConsole(  488): [JavaScript Warning: "Expected pseudo-element but found '-moz-placeholder'.  Ruleset ignored due to bad selector." {file: "app://settings.gaiamobile.org/shared/style/input_areas.css" line: 39}]
E/GeckoConsole(  488): [JavaScript Error: "SyntaxError: JSON.parse: unexpected character" {file: "app://settings.gaiamobile.org/js/icc_menu.js" line: 13}]
E/profiler(  515): Registering start signal
E/GeckoConsole(  515): [JavaScript Warning: "Unknown property '-moz-align-self'.  Declaration dropped." {file: "resource://gre-resources/ua.css" line: 44}]
E/GeckoConsole(  109): [JavaScript Warning: "XUL box for p element contained an inline #text child, forcing all its children to be wrapped in a block." {file: "app://system.gaiamobile.org/index.html" line: 0}]
W/AudioFlinger(  118): Thread AudioOut_1 cannot connect to the power manager service
E/GeckoConsole(  109): [JavaScript Warning: "Invalid URI. Load of media resource  failed." {file: "app://system.gaiamobile.org/index.html" line: 0}]

Scenario #2 (continued)
Steps to reproduce:
4. Launch the Music app. The .ogg format music file is not listed under the Recently Added playlist.
5. Reboot the phone. 
6. Launch the Music app. A scan of the SD Card is triggered.

Actual results:
The .ogg format music file is listed under the Recently Added playlist.
(Reporter)

Comment 17

6 years ago
Created attachment 710468 [details]
Error message: Cannot open media type
Parul, can you try this again, but before you transfer the file, can you verify that the music app is quit out of?  ie please go into the task manager via long tapping on the home button and closing the music app.  I think you may be running into bug 836783
Flags: needinfo?(parul)
to note, I am unable to reproduce this issue on 2/25 build.
(Reporter)

Comment 20

6 years ago
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 

Scenario #2
Steps to reproduce:
1. Ensure Music App is closed. (Long tap on Home button.)
2. Pair a bluetooth device with the phone, such a laptop. (I have a Windows 7 laptop.)
3. Transfer via bluetooth an .ogg format music file. (Codec: Vorbis Container: Ogg)
3. Tap on the notification message when the bluetooth transfer is complete. 

Actual results:
An error message is displayed "Can not open unknown media type". (identical screenshot attached earlier)

adb logcat:
I/ONCRPC  (  115): Setup RPC Call for task 40332468
I/ONCRPC  (  115): oncrpc_xdr_call_msg_start: Prog: 30000012, Ver: 00040001, Proc: 00000028
I/ONCRPC  (  115): xdr_std_msg_send_call: Sent Xid: 17b, Prog: 30
000012, Ver: 00040001, Proc: 00000028
I/ONCRPC  (  115): xdr_std_msg_send_call: Received Reply Xid: 17b, Prog: 30000012, Ver: 00040001, Proc: 00000028
E/rmt_storage(  129): write_log_file: [MyTag]open: fd=-1
E/rmt_storage(  129): block rmt_storage client thread
I/ONCRPC  (  115): rpc_handle_rpc_call: for Xid: 4c5, Prog: 31000000, Vers: fc37ad5c, Proc: 00000012
I/ONCRPC  (  115): rpc_handle_rpc_call: Find Status: 0 Xid: 4c5
I/ONCRPC  (  115): oncrpc_proxy_handle_cmd_rpc_call: Dispatching xid: 4c5
W/AudioFlinger(  117): Thread AudioOut_1 cannot connect to the power manager service
I/GeckoDump(  108): XXX FIXME : Got a mozContentEvent: desktop-notification-click
I/ONCRPC  (  115): rpc_handle_rpc_call: for Xid: 4d6, Prog: 31000003, Vers: cf0d42a3, Proc: 00000003
I/ONCRPC  (  115): rpc_handle_rpc_call: Find Status: 0 Xid: 4d6
I/ONCRPC  (  115): oncrpc_proxy_handle_cmd_rpc_call: Dispatching xid: 4d6
E/profiler(  791): Registering start signal
I/Gecko   (  791): ###################################### forms.js loaded
I/Gecko   (  791): ############################### browserElementPanning.js loaded
I/Gecko   (  791): ######################## BrowserElementChildPreload.js loaded
E/memalloc(  108): /dev/pmem: No more pmem available
W/AudioFlinger(  117): Thread AudioOut_1 cannot connect to the power manager service


Scenario #2 (continued)
Steps to reproduce:
4. Launch the Music app.

Actual results:
The .ogg format music file is listed under the Recently Added playlist.
Flags: needinfo?(parul)
After speaking with parul, it turns out that the not listing issue is tracked under bug 836783 and the error message is tracked under bug 838898.  Closing this bug out as a duplicate.
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 836783

Updated

6 years ago
Keywords: qawanted, regressionwindow-wanted
Reopening since this is more of a supported method of file transfer.  This still occurs for music app; you have to reopen the app in order for the music app to see the music file.

Gallery is not affected for some reason.
Status: RESOLVED → REOPENED
Resolution: DUPLICATE → ---
Not able to replicate this issue in 

Gaia - 82e6fd4b52223a8bcec0c78fc0b4aa4d0b1be0e0
Gecko - e78450af0f9fc6368f028bbc28c9190e902de497
BuildId - 20130708231158
Device - Unagi

Please check if the issue is still valid? Thanks
Flags: needinfo?(nhirata.bugzilla)
STR: 
1. connect device to another device via BT
2. launch music app
3. from the other device, transfer music via bluetooth
4. on the b2g device, accept the transfer
5. search the music app for the newly added song.

Expected: new song is added
Actual: new song is not added.

Note: the original bug is in reference to not seeing the music.  The reason why is the scanning occurs on music app first launch and BT does not scan.  ADB was decided not to be supported method of transfer thus this is not a duplicate bug of bug 836783  Bluetooth is supported, hence this bug was reopened.
Flags: needinfo?(nhirata.bugzilla)
Summary: [music] Music App does not list some .ogg file format → [music] If the music app is already open, the music app does not list newly transferred until the music app is closed and reopened.
(In reply to Naoki Hirata :nhirata (please use needinfo instead of cc) from comment #24)
> STR: 
> 1. connect device to another device via BT
> 2. launch music app
> 3. from the other device, transfer music via bluetooth
> 4. on the b2g device, accept the transfer
> 5. search the music app for the newly added song.
> 
> Expected: new song is added
> Actual: new song is not added.
> 
> Note: the original bug is in reference to not seeing the music.  The reason
> why is the scanning occurs on music app first launch and BT does not scan. 
> ADB was decided not to be supported method of transfer thus this is not a
> duplicate bug of bug 836783  Bluetooth is supported, hence this bug was
> reopened.

Thanks Naoki. I am able to replicate the issue in Music and Gallery app with the steps provided. Looking into the issue. Thanks
Assignee: nobody → pdahiya
Here are the findings so far:
Looks like mediadb.js is the central place where any changes to device storage are captured. All three media apps i.e video app (for video), gallery app (for photo), music app register with mediaDB.js during each app's initialization. MediadB.js sets up call handlers for each of the media types with DeviceStorage via stmt here: 
https://github.com/mozilla-b2g/gaia/blob/master/shared/js/mediadb.js#L535

So, the mediaDB.js change handlers are not getting invoked for media types photo and music, while the change handler is invoked for media type video. 
At this point, I am not sure where this "file change on device storage" is triggered from when the media file gets stored in /downloads/bluetooth. and what is causing this triggering only for video files and not for audio/photos.

Could be an issue at underlying gecko layer for device storage, not sure. will continue investigating.
In dom/devicestorage/nsDeviceStorage.cpp, DeviceStorageFile::Write generates created and modified, and DeviceStorageFile::Remove generates deleted events.

Any file I/O which bypasses these will not get events generated. I think that the camera may do something different. I think it uses device storage to create the file, but does the IO itself. We may need to add a helper so that the camera can trigger appropriate events.

It looks like Bluetooth may bypass DeviceStorageFile as well (and directly uses DeviceStorageFile->mFile), so it probably needs to use a helper to trigger device storage events as well.
Depends on: 897239
Tested again on latest m-c gecko build and still facing the issue with images/music types , i am not getting change notification. 
As suggested by Dave, here are the logs from Gecko layer

07-24 03:21:36.535 I/Gecko   ( 1475): DSF (parent) NotifyAboutFileChange: mStorageType 'videos' mStorageName 'sdcard' mRootDir '' mPath 'downloads/bluetooth/AndroidInSpace.
240p.mp4' mFile->GetPath '/mnt/sdcard/downloads/bluetooth/AndroidInSpace.240p.mp4'
07-24 03:21:36.535 I/Gecko   ( 1871): DSF (child) about to send change: mStorageType 'videos' mStorageName 'sdcard' mRootDir '' mPath 'downloads/bluetooth/AndroidInSpace.24
0p.mp4' mFile->GetPath '/mnt/sdcard/downloads/bluetooth/AndroidInSpace.240p.mp4'


The above logs at gecko layer are only visible in the case when video is transferred from mac to unagi device.

The logs are not seen from gecko layer, when image is transferred. So looks like the NotifyAboutFileChange at devicestorage layer is not getting triggered for images/music.
Created attachment 781176 [details] [diff] [review]
Patch having debug log statements in gecko layer
Created attachment 781179 [details]
Gecko logs

Hi Dave, 

I have attached the git diff with print statements inside gecko as a patch and gecko logs to the bug.

Thanks
So I tried transferring music, photos and videos, and all of them showed up in their respective apps.

When I tried to transfer the .ogg file attached to this bug, it did not show up.

I saw this in the log:

DSF (parent) Punam:Inside Bluetooth Oppn Manager-NotifyAboutFileChange: mStorageType 'videos' mStorageName 'sdcard' mRootDir '' mPath 'Download/Bluetooth/bug-830191.ogg' mFile->GetPath '/mnt/sdcard/Download/Bluetooth/bug-830191.ogg'

So what's happening, is that the .ogg extension can be used to store both music or video. Currently, the storage type is being selected based on the extension, and the .ogg extension gets found as video before being found as music.

One solution would be to always save the file using the sdcard type, and then when sending the notification, send it to each of the types which accepts a given extension.

I would move the notification from the bluetooth code into the device storage code, since it knows about the extension to type mapping.

This would also allow software watching the sdcard storage type to receive notifications about other types (since sdcard accepts any file type).
Created attachment 782651 [details]
Image that doesn't show in gallery app on after bluetooth transfer

Image file with jpeg extension that doesn't show in gallery app after received via Bluetooth transfer.
I tried transferring attachment 782651 [details] and it showed up in Gallery immediately.

This is running master on my unagi.
Here's the consistent pattern seen on below build on my unagi device when files are transferred via Bluetooth from mac

Environment:

m-c Gecko - d40bd3626f5c50dc141128bac2877036c9b897b5
Gaia master - adc94dd96cc417f2c3961b0176c2f2b2d96b9abe
BuildId - 20130724123036
Device - Unagi
space left on sdcard - 117 MB

Small size media (music, photo, video) files < 35 KB when received via Bluetooth doesn't trigger change notification inside Gecko.
As a result if the respective app (Music, Gallery, Video) is open in background, the file doesn't show in the app. Only closing and reopening respective app triggers scan, and shows the file.

Media files in bigger sizes successfully triggers change notification for music, video and photos and if the app is open in background, the file shows up in the app immediately.

As per #c33 the above behavior is not replicable on Dave's phone, will try testing with the exact build from Dave.

I agree with findings in https://bugzilla.mozilla.org/show_bug.cgi?id=830191#c31 that .ogg Music files are triggering notification with wrong storage type that is video
and that's why not showing up in music app. The fix as suggested is on Gecko side, so d-assigning myself for gecko developer to pick it up.
Assignee: pdahiya → nobody
Tested with the build from Dave and the small media files received on unagi devices from Macbook via Bluetooth, are not showing up in respective app. Opened bug https://bugzilla.mozilla.org/show_bug.cgi?id=899711 for tracking this issue.

Comment 36

3 years ago
Does this still happen? We've fixed a lot of media scanning bugs sine the last comment here. Thanks for looking!
Keywords: qawanted
I try to verify this issue via two .ogg file, one is less than 35 KB, one is more than 35KB and the bug can't be repro on latest build of Flame KK v2.5 and Aries KK v2.5 by the following STR.

STR:
1. Ensure Music App is closed. (Long tap on Home button.)
2. Pair a bluetooth device with the phone.
3. Transfer via bluetooth an .ogg format music file. (Codec: Vorbis Container: Ogg)
3. Tap on the notification message when the bluetooth transfer is complete. 

Actual results: The .ogg format music file can be listed under the Recently Added playlist and be able to be played.
See attachments: logcat_0313.txt, Aries_KK v2.5.3gp.
Reproduce rate: 0/10.

Device: Aries KK 2.5(pass)
Build ID               20151025085903
Gaia Revision          1c6628ed1e40575e5ec3669ab6ef389d4ebeea65
Gaia Date              2015-10-23 17:01:43
Gecko Revision         https://hg.mozilla.org/mozilla-central/rev/d53a52b39a95dced722cca90ac74529b66dd5253
Gecko Version          44.0a1
Device Name            aries
Firmware(Release)      4.4.2
Firmware(Incremental)  eng.worker.20151025.081846
Firmware Date          Sun Oct 25 08:18:54 UTC 2015
Bootloader             s1

Device: Flame KK 2.5(pass)
Build ID               20151025150204
Gaia Revision          1c6628ed1e40575e5ec3669ab6ef389d4ebeea65
Gaia Date              2015-10-23 17:01:43
Gecko Revision         https://hg.mozilla.org/mozilla-central/rev/d53a52b39a95dced722cca90ac74529b66dd5253
Gecko Version          44.0a1
Device Name            flame
Firmware(Release)      4.4.2
Firmware(Incremental)  eng.cltbld.20151025.201952
Firmware Date          Sun Oct 25 20:20:05 EDT 2015
Firmware Version       v18D v4
Bootloader             L1TC000118D0
Created attachment 8678713 [details]
logcat_0313.txt
Created attachment 8678714 [details]
Aries_KK v2.5.3gp
QA Whiteboard: [MGSEI-Triage+]
status-b2g-master: --- → unaffected
Keywords: qawanted
Closing based on results in Comment 37. Thanks for checking!
Status: REOPENED → RESOLVED
Last Resolved: 6 years ago3 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.