Closed
Bug 775319
Opened 13 years ago
Closed 13 years ago
Determine the sample type in the media code at compile time.
Categories
(Core :: Audio/Video, defect)
Tracking
()
People
(Reporter: padenot, Assigned: padenot)
References
Details
Attachments
(1 file, 8 obsolete files)
|
22.38 KB,
patch
|
padenot
:
review+
|
Details | Diff | Splinter Review |
The sample type should be 16bits integers on arm, and 32bits float on everything else. It should be fixed at compile time so we avoid branching all over the place.
| Assignee | ||
Comment 1•13 years ago
|
||
| Assignee | ||
Comment 2•13 years ago
|
||
| Assignee | ||
Comment 3•13 years ago
|
||
| Assignee | ||
Updated•13 years ago
|
Attachment #643613 -
Attachment is obsolete: true
| Assignee | ||
Comment 4•13 years ago
|
||
I'm not sure if we need to keep the parameter nsAudioStream::Init, because we may need to be able to use floating point on ARM if we want to do signal processing (for example for Web Audio). Maybe attachment 643615 [details] [diff] [review] is too aggressive. Any thoughts before I continue?
Status: NEW → ASSIGNED
Comment 5•13 years ago
|
||
We can always add it back later, if it's needed.
I think it's fine for MediaStreamGraph to convert floats to integers itself as needed.
| Assignee | ||
Comment 7•13 years ago
|
||
These patches actually use that cool feature of the MediaStreamGraph to convert from 16bits integers to 32bits floats for getUserMedia kind of automatically.
| Assignee | ||
Comment 8•13 years ago
|
||
Attachment #643614 -
Attachment is obsolete: true
Attachment #643615 -
Attachment is obsolete: true
Attachment #648497 -
Flags: review?(cpearce)
Comment 9•13 years ago
|
||
Comment on attachment 648497 [details] [diff] [review]
Decide the sample type to use at compile time.
Review of attachment 648497 [details] [diff] [review]:
-----------------------------------------------------------------
Matthew should look at this, he's the audio tech lead.
::: content/media/nsAudioStream.cpp
@@ +491,3 @@
>
> + if (sa_stream_write(static_cast<sa_stream_t*>(mAudioHandle),
> + s_data.get(),
Indentation is off here.
@@ +1170,5 @@
> if (scaled_volume == 1.0) {
> memcpy(output, input[i], input_size[i]);
> output += input_size[i];
> } else {
> + //// Adjust volume as each sample is copied out.
//// should be //
Attachment #648497 -
Flags: review?(cpearce) → review?(kinetik)
| Assignee | ||
Comment 10•13 years ago
|
||
Attachment #648497 -
Attachment is obsolete: true
Attachment #648497 -
Flags: review?(kinetik)
Attachment #648796 -
Flags: review?(kinetik)
Comment 11•13 years ago
|
||
Comment on attachment 648796 [details] [diff] [review]
Added a chunk that was not qref'ed + addressed cpearce comments
Review of attachment 648796 [details] [diff] [review]:
-----------------------------------------------------------------
Looks good.
::: configure.in
@@ +5230,5 @@
>
> dnl ========================================================
> dnl = Enable Raw Codecs
> dnl ========================================================
> +MOZ_ARG_DISABLE_BOOL(floating-point,
The comment is out of date. Also, do we need a configure flag for this?
::: content/media/nsAudioStream.cpp
@@ +938,5 @@
>
> cubeb_stream_params params;
> params.rate = aRate;
> params.channels = aNumChannels;
> + params.format = CUBEB_SAMPLE_FLOAT32LE;
Bug 779187 changes this, so please be careful when rebasing.
Attachment #648796 -
Flags: review?(kinetik) → review+
| Assignee | ||
Comment 12•13 years ago
|
||
I took extra care for the CUBEB_SAMPLE_FLOAT32LE -> CUBEB_SAMPLE_FLOAT32NE
change.
I find the compilation flag useful to debug things like bug 780531
(comment says that doing a MOZ_TREMOR build helps diagnose an issue), and to
test fixed point version of libraries without leaving the comfort of the desktop.
| Assignee | ||
Updated•13 years ago
|
Attachment #648796 -
Attachment is obsolete: true
| Assignee | ||
Updated•13 years ago
|
Keywords: checkin-needed
Comment 13•13 years ago
|
||
Keywords: checkin-needed
Target Milestone: --- → mozilla17
Comment 14•13 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Comment 15•13 years ago
|
||
Audio volume is broken on Android. It plays very loud and distorted. I plan to back this out shortly and it can be relanded when the fixes in bug 781667 are ready.
Comment 16•13 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/a1659b2b5ac0
https://hg.mozilla.org/integration/mozilla-inbound/rev/0707699ac549
Backout. Please leave bug open after merge to m-c.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Target Milestone: mozilla17 → ---
Comment 17•13 years ago
|
||
(In reply to Chris Double (:doublec) from comment #16)
> Backout. Please leave bug open after merge to m-c.
Per https://wiki.mozilla.org/Tree_Rules/Inbound#Please_do_the_following_after_pushing_to_inbound and the dev.platform post, bug comments like this won't be seen by the merge tool we now use. Please make sure to add [leave open] to the whiteboard if the bug must remain open.
In this particular instance, the merge tool should hopefully recognise that the commit message is in the form of a backout. However one of the commits is typoed (Backup rather than backout/backed out/...), so not sure how it will handle them in combo:
"Backup bug 775319 due to audio issues on android and b2g"
Comment 18•13 years ago
|
||
Thanks Ed, I hadn't noticed the process had changed. Whiteboard updated as per new rules.
Whiteboard: [leave open]
Comment 20•13 years ago
|
||
The answer is that the tool will not know what to do with "Backup" instead of "Backout", but our smart merge monkeys will :)
| Assignee | ||
Comment 21•13 years ago
|
||
Attachment #651263 -
Flags: review?(kinetik)
| Assignee | ||
Updated•13 years ago
|
Attachment #649855 -
Attachment is obsolete: true
Updated•13 years ago
|
blocking-basecamp: --- → ?
Updated•13 years ago
|
blocking-basecamp: ? → +
| Assignee | ||
Comment 22•13 years ago
|
||
Comment on attachment 651263 [details] [diff] [review]
Determine the sample format at compile time, without busting everything.
Found a mistake.
Attachment #651263 -
Attachment is obsolete: true
Attachment #651263 -
Flags: review?(kinetik)
Comment 23•13 years ago
|
||
While you're fixing that, can you please also reconcile MOZ_FLOATING_POINT_AUDIO vs MOZ_SAMPLE_TYPE_* (defined in nsBuiltinDecoderReader.h)? We don't need both, and MOZ_SAMPLE_TYPE_* seems more descriptive to me.
| Assignee | ||
Comment 24•13 years ago
|
||
Here is a new version, where MOZ_SAMPLE_TYPE_{SE16, FLOAT32} are used instead of
the MOZ_FLOATING_POINT_AUDIO.
I made sure it is working on desktop, fennec and b2g (playback + mozWriteAudio
each time, apart for fennec where mozWriteAudio is busted).
Attachment #652641 -
Flags: review?(kinetik)
Comment 25•13 years ago
|
||
Thanks, I'll get to this shortly.
(In reply to Paul ADENOT (:padenot) from comment #24)
> apart for fennec where mozWriteAudio is busted
Can you file a bug for this, with details of what you're using to test and what breakage you're seeing?
Comment 26•13 years ago
|
||
Comment on attachment 652641 [details] [diff] [review]
Determine the sample format at compile time for all media code. r=
Thanks, looks good.
Can you please file a followup to untangle S16LE vs S16(NE)? We should rename S16LE to just S16 (i.e. native) and do the endian conversion in nsWaveReader.cpp; I think everywhere else that uses S16LE is acting as if it's NE.
(In reply to Matthew Gregan [:kinetik] from comment #25)
> Can you file a bug for this, with details of what you're using to test and
> what breakage you're seeing?
And that's bug 783456.
Attachment #652641 -
Flags: review?(kinetik) → review+
AudioSegment::WriteTo generates little-endian when writing to an nsAudioStream with FORMAT_S16_LE. Changing FORMAT_S16_LE to FORMAT_S16 makes sense to me if cubeb can handle it, but don't forget to update AudioSegment.
| Assignee | ||
Comment 28•13 years ago
|
||
That's what my mxr query told me as well. This will be taken care of.
| Assignee | ||
Updated•13 years ago
|
Keywords: checkin-needed
Whiteboard: [leave open]
| Assignee | ||
Comment 29•13 years ago
|
||
Attachment #652641 -
Attachment is obsolete: true
Attachment #653570 -
Flags: review+
Comment 30•13 years ago
|
||
Green on Try.
https://tbpl.mozilla.org/?tree=Try&rev=3d0f1291cf01
https://hg.mozilla.org/integration/mozilla-inbound/rev/79e9fb28b8e1
Flags: in-testsuite-
Keywords: checkin-needed
Comment 31•13 years ago
|
||
Status: REOPENED → RESOLVED
Closed: 13 years ago → 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla17
You need to log in
before you can comment on or make changes to this bug.
Description
•