If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

fix latency reporting in libcubeb sndio

RESOLVED FIXED in mozilla48

Status

()

Core
Audio/Video: cubeb
P4
normal
RESOLVED FIXED
3 years ago
6 months ago

People

(Reporter: Alexandre Ratchov, Assigned: Alexandre Ratchov, Mentored)

Tracking

Trunk
mozilla48
x86_64
OpenBSD
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

3 years ago
Created attachment 8590748 [details] [diff] [review]
mc_wrpos.diff

AFAICS, the sndio_stream_get_latency() function reports the time (expressed in number of samples) it take the last sample submitted to the device to reach the user's ears. This is the number of samples played (s->rdpos in the code) minus the number of samples submitted (s->wrpos, in the code).

But the s->wrpos counter is set to zero, instead of being increased after each call to sio_write(). The diff fixes this. As sio_write() reports bytes (sample may be partially written), we have to switch s->rdpos and s->wrpos to use bytes.

Tested on OpenBSD/amd64
Component: Audio/Video → Audio/Video: MSG/cubeb/GMP
Component: Audio/Video: MediaStreamGraph → Audio/Video: cubeb

Updated

2 years ago
Status: UNCONFIRMED → NEW
Ever confirmed: true
Priority: -- → P4
Alex, is this patch still valid ? If so i can do the hg plumbing to get it commited.. at least it still applies.
Flags: needinfo?(alex)
(Assignee)

Comment 2

2 years ago
sure it's still valid.
Flags: needinfo?(alex)
matthew, since it's a libcubeb patch, what do you prefer ? a github pull request and a backport/cubeb upgrade in m-i, or a patch to review for m-i and you'll take care of commiting it to github ? same question for #1153151.
Flags: needinfo?(kinetik)
https://github.com/kinetiknz/cubeb/pull/79
(In reply to Landry Breuil (:gaston) from comment #3)
> matthew, since it's a libcubeb patch, what do you prefer ? a github pull
> request and a backport/cubeb upgrade in m-i, or a patch to review for m-i
> and you'll take care of commiting it to github ? same question for #1153151.

A pull request on GitHub and then an update of the in-tree version using media/libcubeb/update.sh is the preferred approach.

Note that the last pending libcubeb update is slightly blocked right now: see bug 1251502.
Flags: needinfo?(kinetik)

Comment 6

6 months ago
https://hg.mozilla.org/mozilla-central/diff/54534d5c9382/media/libcubeb/src/cubeb_sndio.c
Assignee: nobody → alex
Blocks: 1251502
Status: NEW → RESOLVED
Last Resolved: 6 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla48
You need to log in before you can comment on or make changes to this bug.