[RTSP] Audio playback is not smooth

VERIFIED FIXED in Firefox 40

Status

defect
VERIFIED FIXED
4 years ago
4 years ago

People

(Reporter: ntroast, Assigned: jhao)

Tracking

unspecified
2.2 S10 (17apr)
ARM
Gonk (Firefox OS)

Firefox Tracking Flags

(blocking-b2g:2.2+, firefox38 wontfix, firefox39 wontfix, firefox40 fixed, b2g-v2.2 verified, b2g-v2.5 verified, b2g-master verified)

Details

(Whiteboard: [caf priority: p2][CR 811806])

Attachments

(1 attachment)

(Reporter)

Description

4 years ago
The following RTSP stream produces stuttering audio.
rtsp://203.35.158.135/TRL/trl-upload/Highbit/brock_128k.3gp

Gaia: e54c4ed1cc188f70ddf1156534d364005dc45490
Gecko: c8c2e0a255fa123bb425c5125ec025d41e0817e7
Whiteboard: [CR 811806]
Whiteboard: [CR 811806] → [caf priority: p2][CR 811806]

Updated

4 years ago
OS: Linux → Gonk (Firefox OS)
Hardware: x86_64 → ARM

Comment 1

4 years ago
Hi Vincent,

Please have someone on your team familiar with the RTSP codebase pick this up. We are less than a week away from FC, April 6th.

Thanks!
Mike
Flags: needinfo?(vchang)
Jonathan, can you help to check this one?
Assignee: nobody → jhao
Flags: needinfo?(vchang)
See Also: → 877116
(Assignee)

Comment 3

4 years ago
By printing start time and end time of each decoded sample in MDSM::OnAudioDecoded(), we found that there is unexpected discontinuity, i.e. the previous end time doesn't equal to the next start time.

I/ETHAN   ( 1954): OnAudioDecoded [85333,170666] disc=0
I/ETHAN   ( 1954): OnAudioDecoded [256000,341333] disc=0
I/ETHAN   ( 1954): OnAudioDecoded [426666,511999] disc=0
I/ETHAN   ( 1954): OnAudioDecoded [512000,597333] disc=0
I/ETHAN   ( 1954): OnAudioDecoded [597333,682666] disc=0
I/ETHAN   ( 1954): OnAudioDecoded [682666,767999] disc=0
I/ETHAN   ( 1954): OnAudioDecoded [768000,853333] disc=0
I/ETHAN   ( 1954): OnAudioDecoded [853333,938666] disc=0
I/ETHAN   ( 1954): OnAudioDecoded [938666,1023999] disc=0
I/ETHAN   ( 1954): OnAudioDecoded [1024000,1109333] disc=0
I/ETHAN   ( 1954): OnAudioDecoded [1109333,1194666] disc=0
I/ETHAN   ( 1954): OnAudioDecoded [1280000,1365333] disc=0

The next step would be to print each accessUnit's timestamp, in order to check if the packets are lost before decoding.
(Assignee)

Comment 4

4 years ago
At first, we thought that the problem may be that multiple packets were glued together, and we need to separate them, but further investigation shows that all mPackets.size() are 1, so it was not the case.
According to comment 1, it should be 2.2+.
blocking-b2g: 2.2? → 2.2+
(Assignee)

Comment 6

4 years ago
Hi Benjamin,

Can you review this patch?

The original calculation of slots count in ReadBuffer and WriteBuffer will  count one more slot when data size is a multiple of slot size.

Furthermore, when data size is equal to the slot size, WriteBuffer will think the slot counts is 2, but ReadBuffer will think it's 1 because the calculation is put in |if (aWriteCount > mSlotSize)|. This causes mismatch of mProducerIdx and mConsumerIdx, so some data are never read.

Try server: 
https://treeherder.mozilla.org/#/jobs?repo=try&revision=978b38f233e8
Attachment #8589509 - Flags: review?(bechen)
Comment on attachment 8589509 [details] [diff] [review]
Fix the calculation of slots count in Read/WriteBuffer

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

Nice catch!!
Attachment #8589509 - Flags: review?(bechen) → review+

Comment 8

4 years ago
Comment on attachment 8589509 [details] [diff] [review]
Fix the calculation of slots count in Read/WriteBuffer

[Triage Comment]FC blocker
Attachment #8589509 - Flags: approval-mozilla-b2g37+
(Assignee)

Comment 9

4 years ago
The attachment 8589509 [details] [diff] [review] solves most of the discontinuity problems. There's still very little discontinuity, but I listened with VLC on both Ubuntu and OS X, and I hear the same discontinuities, so I think it's the audio files problem.

This patch can apply on both master and 2.2.
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/a5f72f85df4a
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 2.2 S10 (17apr)
I think this needs b2g37 approval from RelMan first.
Flags: needinfo?(bbajaj)
Flags: needinfo?(bbajaj)
Looks good to land now, I communicated to kkuo about the landing policies (m-c/master) first and we are on the same page now. He mentioned this is one of those partner bugs that needs urgent landing hence NI you.
Flags: needinfo?(ryanvm)
This issue is verified fixed on Flame and Aries. Audio playback is smooth when playing the video at comment 0.

Verified on the following devices/builds:

Device: Flame 2.6 Master
BuildID: 20151116030435
Gaia: e8c15ae4e5324a210000ee0a869a962aa542009f
Gecko: 48d636f678b0e5162ab868dc9024a5ffe350460c
Gonk: 205ac4204bbbb2098a8046444acba551ba5dc75a
Version: 45.0a1 (2.6) 
Firmware Version: v18Dv4
User Agent: Mozilla/5.0 (Mobile; rv:45.0) Gecko/45.0 Firefox/45.0

Device: Aries 2.6 Master
BuildID: 20151116140807
Gaia: e8c15ae4e5324a210000ee0a869a962aa542009f
Gecko: 4294bf91174b71ed7440dc491dac5d15394ec227
Gonk: a19052e4389c3ae2d8fc3e7a74a475401baacc56
Version: 45.0a1 (2.6) 
Firmware Version: D5803_23.1.A.1.28_NCB.ftf
User Agent: Mozilla/5.0 (Mobile; rv:45.0) Gecko/45.0 Firefox/45.0

Device: Flame 2.5
BuildID: 20151116173604
Gaia: 9473dbcbebf4e758a3b73200968efc69071b4312
Gecko: 17877d161e5f62726027ee70101a7004dcad5a69
Gonk: 205ac4204bbbb2098a8046444acba551ba5dc75a
Version: 44.0a2 (2.5) 
Firmware Version: v18Dv4
User Agent: Mozilla/5.0 (Mobile; rv:44.0) Gecko/44.0 Firefox/44.0

Device: Flame 2.2
BuildID: 20151116032504
Gaia: 885647d92208fb67574ced44004ab2f29d23cb45
Gecko: e772f343b736
Gonk: bd9cb3af2a0354577a6903917bc826489050b40d
Version: 37.0 (2.2) 
Firmware Version: v18Dv4
User Agent: Mozilla/5.0 (Mobile; rv:37.0) Gecko/37.0 Firefox/37.0
Status: RESOLVED → VERIFIED
QA Whiteboard: [QAnalyst-Triage?]
Flags: needinfo?(jmercado)
QA Whiteboard: [QAnalyst-Triage?] → [QAnalyst-Triage+]
Flags: needinfo?(jmercado)
You need to log in before you can comment on or make changes to this bug.