Closed Bug 855647 Opened 11 years ago Closed 11 years ago

[Music] support opus in ogg

Categories

(Firefox OS Graveyard :: Gaia::Music, defect)

x86_64
Linux
defect
Not set
normal

Tracking

(blocking-b2g:-, b2g18+ fixed, b2g18-v1.0.1 affected, relnote-b2g 1.1.0)

VERIFIED FIXED
blocking-b2g -
Tracking Status
b2g18 + fixed
b2g18-v1.0.1 --- affected
relnote-b2g --- 1.1.0

People

(Reporter: rlin, Assigned: derf)

Details

(Keywords: feature)

Attachments

(3 files)

Attached video sample opus in ogg file
The mediaRecorder would record in opus format, but it seems music app can't parsing the opus in ogg music files.
logs. 
03-27 19:14:18.777 E/GeckoConsole(  547): Content JS WARN at app://music.gaiamobile.org/shared/js/mediadb.js:1332 in metadataError: MediaDB: error parsing metadata for 6005.ogg : Error: advance past end of buffer
03-27 19:14:18.777 E/GeckoConsole(  547): Content JS WARN at app://music.gaiamobile.org/shared/js/mediadb.js:1332 in metadataError: MediaDB: error parsing metadata for 6005.ogg : malformed ogg comment packet
It looks like parseOggMetadata() is hard-coded to only support Vorbis:
https://github.com/mozilla-b2g/gaia/blob/master/apps/music/js/metadata.js#L417

I think just modifying the check at line 440 to look for 'OpusTags' in addition to '\003vorbis' would be enough to make this work.

See the format for Opus metadata at <http://tools.ietf.org/html/draft-ietf-codec-oggopus-00#section-5.2>.
blocking-b2g: --- → leo?
Product - please re-nominate if this breaks a user story (we're not aware of one).
blocking-b2g: leo? → -
tracking-b2g18: --- → +
Flags: needinfo?(ffos-product)
Flags: needinfo?(ffos-product) → needinfo?(skamat)
This does not block leo.  Thanks.
Flags: needinfo?(skamat)
We need this targeted for v1.2
I've got a device for a few days I can test things on, so I went ahead and wrote a simple patch for this.
Assignee: nobody → tterribe
Status: NEW → ASSIGNED
Attachment #740584 - Flags: review?(dkuo)
Attached video Another ogg+opus file
Hi, this is a mush more recent ogg file generated by our MediaEncoder (bug 842243). Hope that it helps.
Comment on attachment 740584 [details] [diff] [review]
[music] Add Opus support

Timothy,

This patch looks good, and with this patch music app is able to parse the audio files encode with opus, and their metadata are also correctly parsed.

David has wrote the metadata parser of music app, so I feel like he should be notified that metadata.js will be modified. Setting feedback to David, thanks.
Attachment #740584 - Flags: review?(dkuo)
Attachment #740584 - Flags: review+
Attachment #740584 - Flags: feedback?(dflanagan)
Comment on attachment 740584 [details] [diff] [review]
[music] Add Opus support

Thanks for flagging this for me, Dominic. The patch looks great. How nice that it was so easy to support a new type!
Attachment #740584 - Flags: feedback?(dflanagan) → feedback+
Okay, last B2G patch I did, someone else landed for me. What do I need to do to get this one checked in?
(In reply to Timothy B. Terriberry (:derf) from comment #9)
> Okay, last B2G patch I did, someone else landed for me. What do I need to do
> to get this one checked in?

You need a github account to open a pull request to gaia repo, but I can do this for you.
Landed on master: 153f6805839ccfcd4b1064568377ef26bacf2960
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Comment on attachment 740584 [details] [diff] [review]
[music] Add Opus support

NOTE: Please see https://wiki.mozilla.org/Release_Management/B2G_Landing to better understand the B2G approval process and landings.

[Approval Request Comment]
Bug caused by (feature/regressing bug #): Not a regression.
User impact if declined: Users won't be able to play Opus files (including those created by the Recording API once it lands) in the music app.
Testing completed: Tested locally on a unagi device, landed on master.
Risk to taking this patch (and alternatives if risky): Very low: it's a simple, self-contained patch that makes the existing metadata reader work. All the code to actually play back Opus files is already available to web content via the <audio> tag.
String or UUID changes made by this patch: None.
Attachment #740584 - Flags: approval-mozilla-b2g18?
Adding qawanted to check for regressions before considering this bug for uplift.
Keywords: qawanted
QA Contact: nhirata.bugzilla
Flags: needinfo?(nhirata.bugzilla)
Will verify tomorrow and test around the fix:

Reviewing code change:
https://github.com/mozilla-b2g/gaia/commit/153f6805839ccfcd4b1064568377ef26bacf2960
Flags: needinfo?(nhirata.bugzilla)
Found a nice site to convert audio file types : http://audio.online-convert.com/convert-to-opus

Also used various other types and a corrupt ogg file.  Opus plays back, Vorbis plays back, Theora opens up in video app, all supported audio still shows, nonsupported audio does not show in the music app.  

Music app and volume control issue noted in Bug 858745
Used files from : http://people.mozilla.com/~nhirata/B2G/Soundfiles.zip

Verified with :
"gecko" revision="84f4c17f1605"
"gaia" revision="4e7d63a83508caa391c4db164c3f68422d9ca5b6"
Build ID: 2013-05-09-07-02-05
MC/master build
Unagi
Status: RESOLVED → VERIFIED
Attachment #740584 - Flags: approval-mozilla-b2g18? → approval-mozilla-b2g18+
Keywords: feature
John, can you uplift to v1-train please?
Flags: needinfo?(jhford)
[v1-train 7cc7bd3]
Flags: needinfo?(jhford)
No longer blocks: 803414
No longer blocks: MediaRecording
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: