Audio/Video not in sync on M10/frieza

Bug #1574729 reported by Michael Zanetti
208
This bug affects 43 people
Affects Status Importance Assigned to Milestone
Canonical System Image
Fix Released
Critical
John McAleely
The Avila project
In Progress
High
Alfonso Sanchez-Beato
frieza
In Progress
Critical
Unassigned
media-hub (Ubuntu)
Invalid
High
Jim Hodapp
pulseaudio (Ubuntu)
Invalid
High
Alfonso Sanchez-Beato

Bug Description

Watching a video (either with the media player or the browser) shows a lag between audio and video. It's out of sync for some hundred milliseconds, just enough to be very annoying while watching the video.

Tags: bq-feedback
tags: added: bq-feedback
Bill Filler (bfiller)
Changed in canonical-devices-system-image:
importance: Undecided → High
assignee: nobody → John McAleely (john.mcaleely)
Changed in media-hub (Ubuntu):
importance: Undecided → High
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in media-hub (Ubuntu):
status: New → Confirmed
Michał Sawicz (saviq)
Changed in canonical-devices-system-image:
milestone: none → backlog
Revision history for this message
Jim Hodapp (jhodapp) wrote :

@Michael: Can you please provide the more detailed debug info by doing the following from the frieza shell:

1. stop media-hub
2. GST_DEBUG=*:4 CORE_UBUNTU_MEDIA_SERVICE_VIDEO_SINK_NAME=mirsink CORE_UBUNTU_MEDIA_SERVICE_AUDIO_SINK_NAME=pulsesink src/core/media/media-hub-server
3. Then try playing the video and attach the entire output from #2 to this bug report. I want to see if GStreamer is aware of A/V getting out of sink and if it's providing any useful messages as to why.

Revision history for this message
Matthias Apitz (gubu) wrote :

I watched the same video
http://www.tagesschau.de/multimedia/sendung/ts-13759.html in

1) with mplayer as local *.mp4 file (downloaded with youtube_dl) on my
   FreeBSD netbook, result: fine;

2) with my BQ E4.5 (OWA-10.1) in webbrowser via HTTP data mobile,
   result: fine

3) in my FreeBSD netbook in chrome browser via HTTP data mobile (BQ E4.5 as
   AP to Internet), result: fine

4) in the M10 with webbrowser via HTTP Wifi, result: off-sync;

5) in the M10 as local *.mp4 file, result: off-sync

Revision history for this message
Pat McGowan (pat-mcgowan) wrote :

The video is just behind the audio on every video I played

Changed in canonical-devices-system-image:
status: New → Confirmed
importance: High → Critical
Changed in media-hub (Ubuntu):
assignee: nobody → Jim Hodapp (jhodapp)
Revision history for this message
Oliver Grawert (ogra) wrote :

a working hack i found is:

pactl set-port-latency-offset droid_card.primary output-speaker -600000

from the terminal-app after boot, this gets me lip-synced video playback in all apps

Revision history for this message
Jim Hodapp (jhodapp) wrote :

We could try to set this same property from media-hub since it sets up the use of pulsesink in the GStreamer pipeline [1]. This would at least take care of the mediaplayer-app video playback. We might be able to accomplish something similar for the Oxide media pipeline but can't comment on that part as I'm not familiar enough with it.

https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-good-plugins/html/gst-plugins-good-plugins-pulsesink.html#GstPulseSink--stream-properties

Revision history for this message
Oliver Grawert (ogra) wrote :

i guess it is rather a device specific thing (you really dont want -600000 on a device where audio is already in sync) and shoulld go into some device specific pulse config.

after all it is only a workaround though ... there must be something in the drivers (video or audio) itself that makes it a requirement at all.

Revision history for this message
Jim Hodapp (jhodapp) wrote :

Yeah I had that thought as well, but I thought it's worth an experiment though on all devices to see if it can be applied generally. Do you happen to know what the default value is for pulse at the moment?

Changed in media-hub (Ubuntu):
status: Confirmed → New
status: New → Incomplete
status: Incomplete → New
Changed in canonical-devices-system-image:
status: Confirmed → Fix Committed
Changed in avila:
status: New → In Progress
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in media-hub (Ubuntu):
status: New → Confirmed
Revision history for this message
Jim Hodapp (jhodapp) wrote :

@nandkishorbairagi007: did you commit a fix that we're not aware of? If so please link a source branch to this bug report.

Changed in canonical-devices-system-image:
status: Fix Committed → Confirmed
Revision history for this message
Oliver Grawert (ogra) wrote :

Just FTR on all devices I have here pact list cards shows a default of 0 usec. For all outputs.

Revision history for this message
Matthias Apitz (gubu) wrote :

FWIW, I found some nice test streams in YT, like this:

https://www.youtube.com/watch?v=ucZl6vQ_8Uo

which make any test more objective.

I watched this in my BQ E4.5 with the browser app and in my FreeBSD netbook
with FF: when the jumping ball hits the dash in ground zero, the 'plonk'
sounds exactly with the hit.

With the M10 the dash is already at 4-5 tens of a second ahead when
the 'plonk' sounds, definitely off-sync.

This is regardless of having applied the command proposed by Oli, at
least with my device. Maybe the issue is more complex and not only
software related.

Revision history for this message
Halo (carlos1259714) wrote :

Have an Aquaris M10 Ubuntu Edition, same bug as well.

I tried to open terminal and type "pactl set-port-latency-offset droid_card.primary output-speaker -600000", but I'm getting this output:

"Home directory not accessible: Permission denied
Connection error: connection denied
pa_context_connect() failed: connection denied"

I tried with sudo su first and marking as read/write with "sudo mount -o remount,rw /". Have developer mode activated too.

Changed in canonical-devices-system-image:
milestone: backlog → 12
Revision history for this message
Ben Sanderson (bennysthe1) wrote :

So after I ran sudo mount -o remount,rw / and added pactl set-port-latency-offset droid_card.primary output-speaker -600000 I have synced video and audio. Ubuntu store still downloads and installs apps although it seems bit slower to download. The updates in system settings seems to work fine too. I have heard about the updates not working so is it possible to update with apt-get? it seems to work fine???

Revision history for this message
Jim Hodapp (jhodapp) wrote :

@Ben: most things continue to work fine via apt-get but I strongly advise you to not use it and to stick with the normal system settings updater. Most packages would install cleanly via apt-get but some very important system ones will not and you'll probably break your system trying to do so. So unless you are on a development phone that you don't care if you have to reflash from time to time, just stay with the normal update procedure.

Revision history for this message
John McAleely (john.mcaleely) wrote :

@bensmythe1 - this ask ubuntu answer covers the consequences of using apt-get:

http://askubuntu.com/questions/600065/consequences-of-using-apt-get-in-ubuntu-touch/775550#775550

Short version: dont. So I'd restore your device to ro, and then let updates take their course.

Changed in media-hub (Ubuntu):
status: Confirmed → Invalid
Changed in avila:
status: In Progress → Confirmed
Revision history for this message
Alessandro Spagnoletta (a-spagnoletta) wrote :

Have an Aquaris M10 FHD Ubuntu Edition, same bug.

I noticed that the audio is <1s ahead the video when playing .mkv .mp4 video with Media Player or youtube video with the default browser. Instead, when playing .avi video with Media Player, the lag is definitely much worse (the audio is several seconds ahead).

Revision history for this message
Thomas Voß (thomas-voss) wrote :

Based on ogra's observation and given that both oxide and media-hub are affected, pulse and its configuration are quite likely the issue here. I'm marking pulseaudio as affected. We should aim for fixing the issue centrally in pulse.

Revision history for this message
Pat McGowan (pat-mcgowan) wrote :

I can confirm that the command in comment #5 works to fix the video in comment #12

Changed in pulseaudio (Ubuntu):
assignee: nobody → Alfonso Sanchez-Beato (alfonsosanchezbeato)
Changed in canonical-devices-system-image:
milestone: 12 → 13
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in pulseaudio (Ubuntu):
status: New → Confirmed
Changed in frieza:
status: New → Confirmed
importance: Undecided → Critical
Revision history for this message
Leonardo Donelli (learts92) wrote :

Guys, if you can, keep up updated on this. I bought the M10 basically only just to support Ubuntu Touch, knowing well that it wouldn't have (yet) a lof of things Android has, but thinking that "at least I will be able to watch videos on it, which is the primary use I have of a tablet anyway".

Because of this bug, I can't really do that..

Revision history for this message
Dave H (dhandhelen-s) wrote :

Hi, just updated my BQ M10 to OTA-12 and the problem is not resolved. I think the media player sound is in sync for the video camera mp4 and youtube mp4 streaming, the problem is with .avi files. With avi files the sound is totally out of sync and stops altogether after a short time, hope this helps.

Regards

Dave H

Changed in avila:
assignee: nobody → Alfonso Sanchez-Beato (alfonsosanchezbeato)
importance: Undecided → High
Changed in pulseaudio (Ubuntu):
importance: Undecided → High
Changed in avila:
milestone: none → 13
Jim Hodapp (jhodapp)
Changed in canonical-devices-system-image:
status: Confirmed → In Progress
Changed in avila:
status: Confirmed → In Progress
Changed in frieza:
status: Confirmed → In Progress
Changed in pulseaudio (Ubuntu):
status: Confirmed → In Progress
Revision history for this message
Alfonso Sanchez-Beato (alfonsosanchezbeato) wrote :

@gubu, thanks for the link to the sync video, it is great to see the delay between audio and video. To rule out gstreamer of the equation, I have tried to transcode the video by doing:

gst-launch-1.0 filesrc location=Videos/sync-test.mp4 ! decodebin name=demux demux. ! queue ! audioconvert ! lamemp3enc ! mux. qtmux name=mux ! filesink location=recode.mp4 demux. ! queue ! videoconvert ! x264enc ! mux.

The resulting file has correct synchronization, so all points to pulseaudio or android drivers to be the culprit here.

Revision history for this message
Alfonso Sanchez-Beato (alfonsosanchezbeato) wrote :

Interesting finding (thanks @Jim for the suggestion): I changed the output device to headphones using the jack, same issue. Then I switched to bluetooth headphones, using A2DP profile, and video and audio came into sync. However, that only lasted a couple of minutes, after that suddenly I got the delay again while watching a youtube video. There is definitely something wrong with pulseaudio sinks.

Revision history for this message
Alfonso Sanchez-Beato (alfonsosanchezbeato) wrote :

Device tarballs for testing the fix:

http://people.canonical.com/~abeato/lp1574729/

Changed in pulseaudio (Ubuntu):
status: In Progress → Invalid
Changed in canonical-devices-system-image:
status: In Progress → Fix Committed
Changed in canonical-devices-system-image:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.