GStreamer vs. Windows Media Player

I’ve always been quietly impressed with GStreamer — in a world of multimedia where everything is so complicated, applications using GStreamer pretty much “just work” without any problems.

This was until today. I subscribe to a Polish TV archive, that has archived versions of soaps my girlfriend enjoys (M jak miłość). Windows Media Player 11 plays the mms stream perfectly, with no visual artifects or sound skipping, but in totem the video is unwatchable. As a further point, mplayer seems to play this mms stream with no video glitches, and only an occasional audio blip.

On gstreamer-0.10.21-2.fc10.i386, using playbin and debug level 2, I get:

0:00:11.977812682 15562  0x8ab4e50 WARN              asfdemux asfpacket.c:104:asf_payload_find_previous_fragment: Previous fragment does not match continued fragment
0:00:19.046052292 15562  0x8ab4e50 WARN              asfdemux asfpacket.c:336:gst_asf_demux_parse_payload:<asfdemux0> Offset doesn't match previous data?!
0:00:19.046086304 15562  0x8ab4e50 WARN              asfdemux asfpacket.c:104:asf_payload_find_previous_fragment: Previous fragment does not match continued fragment

Which I guess means the payload timestamps are wrong, then then I get about a bazillion of:

0:00:31.263371321 15562  0x8e0b408 WARN              GST_PADS gstpad.c:2992:gst_pad_iterate_internal_links_default:<selector_video_src1:src> Making unsafe iterator

and then when it skips:

0:00:36.949382321 15644  0x9d0c538 WARN         baseaudiosink gstbaseaudiosink.c:1395:gst_base_audio_sink_render:<audiosink-actual-sink-pulse> warning: Compensating for audio synchronisation problems
0:00:36.949410537 15644  0x9d0c538 WARN         baseaudiosink gstbaseaudiosink.c:1395:gst_base_audio_sink_render:<audiosink-actual-sink-pulse> warning: Unexpected discontinuity in audio timestamps of more than half a second (0:00:00.649705215), resyncing
WARNING: from element /GstPlayBin:playbin0/GstBin:abin/GstAutoAudioSink:audiosink/GstPulseSink:audiosink-actual-sink-pulse: Compensating for audio synchronisation problems
Additional debug info:
gstbaseaudiosink.c(1395): gst_base_audio_sink_render (): /GstPlayBin:playbin0/GstBin:abin/GstAutoAudioSink:audiosink/GstPulseSink:audiosink-actual-sink-pulse:
Unexpected discontinuity in audio timestamps of more than half a second (0:00:00.649705215), resyncing

This makes the video unwatchable. I’m guessing the server is somehow broken, but it works in Windows Media Player perfectly and 99% okay on mplayer.
Any help on how to debug this or report a proper bug gratefully received. Thanks.

pkcon list-install foo.package-list

In newer versions of gnome-packagekit there’s a tool called gpk-service-pack:

Service Pack Creator
Service Pack Creator

This tool I’ve explained in the past, and there is now lots of information and diagrams in the help file about how it all works and what the point of the tool is. Anyway, the point of this blog post isn’t to promote service packs; it’s to scratch an itch that I see coming up when Fedora 10 is released.

The tool exposed one detail to the user: a package list.

This is a simple text file such as hughsie-laptop-f9.package-list. This file allows tools to operate on other similar computers with different packages installed. It’s really just a simple list of all the packages installed. It’s contents and format are unimportant for now as it lets you do some cool stuff.

My personal situation, right now: I’m running a F9/F10/rawhide-ish laptop that I’ve been running for a few months, installing packages using yum, rpm and PackageKit, and have now got all the packages I need for building all my stuff, and all the programs I need on a day-to-day basis.
When F10 comes out, I normally nuke / and reinstall from the live CD as I’ve got so much cruft and brokenness from the months of a rawhide development cycle. On the first boot, I run:

yum -Y install <paste long list of packages from a tomboy note that's got bigger over the years>

Now, what I need is an admin tools that says:

  1. Capture all the package names on my old system
  2. Show me all the differences between what I had then, and what I have now
  3. Use the old package list to install all my normal stuff, not specifying versions

So, two hours of hacking later:

  1. pkcon list-create hughsie-laptop-f9.package-list
  2. pkcon list-diff hughsie-laptop-f9.package-list
  3. pkcon list-install hughsie-laptop-f9.package-list

I know I can do some of step 3 using a custom kickstart if I wanted, but I normally don’t know what I install manually. Maybe it’s only me that’ll find this useful. Code is in git. itch2scratch–;

gnome-power-manager and DeviceKit-power

DeviceKit-power is a system activated service I’ll be writing about in detail in a blog post in the near future. It’s a bit like HAL, but makes common API calls easy for applications (is battery power low?) and also moves the battery profiling down to the system layer from the session so it works for all users and more importantly from the GDM login screen. It’s very lightweight and low on resource usage when it’s active.

Here are some screenshots from gnome-power-manager trunk (compile with –enable-devkit-power).

Statistics profile for my battery
Statistics profile for my battery
History for my Watts Up Pro
History for my Watts Up Pro

The monitor device is a Watts Up Pro device. As you plug it in, DeviceKit-power opens the device, and starts reading data. I’m using it here to monitor my power strip with my laptop and all the power-warts attached. I’ll be converting gnome-power-manager to use DeviceKit-power rather than HAL during the next release cycle. Hopefully, I’ll maintain both HAL and DeviceKit-power backends, although this isn’t making the number of #ifdefs any smaller, which sucks from a readability point of view.

The GUI’s are pretty raw, so suggestions and criticisms are welcome.

DeviceKit-power latency control

We all know controlling latency is the best way to control power consumption and still have a usable system. Putting the processor into deeper sleep states saves power, but it takes longer to come back to running. On pretty much all devices it’s all a trade off between time and power.

org.freedesktop.DeviceKit.Power.Latency is a DBus interface implemented by DeviceKit-power. It allows applications to request target latencies, for example a couple of seconds CPU-DMA latency for an IM application, or a few hundred microseconds of network latency for a multiplayer game. The lowest value of each latency type is used for the userspace->kernel interface, and then what do do is left for the kernel drivers themselves.

Use cases:

  • I want my IM application to request 0.5s latency for messages
  • I’m running an OpenGL simulation and want maximum performance, even on battery
  • I’m running an SQL server for a credit card company, and want the server to request low latency CPU and network as any delay costs money
  • I’m an admin, and want to change the power consumption vs. latency from cron scripts so it uses high latency during the night for maximum power saving, and low latency during business hours.
  • I want high throughput when copying files, but want low throughput for downloading updates in the background.
  • I want my power manager to set all latencies to lowest when on AC power
  • I don’t want my users messing with latency settings
  • I’m and admin and I want to be able to override all latency settings on my machines

Now, I want to build a system-activated service to manage this, so people that don’t care don’t have an extra process running. We can use PolicyKit to control all the authentication, and build up a service for applications and admins to use. This will be suitable for system services and desktop applications.

Why don’t applications use the PMQoS interface directly? Well, by providing a framework we can override requests by admin policy, and also control requests. You also can’t set latencies unless you’re the root user, which is not suitable for the desktop use case.

I’ve put an interface file up here.

Comments? Suggestions? Thanks.