Two things I don’t like about “multimedia linux”

Kernel being dumb by being smart

Memory cache is a good thing to speed up a computer, but it’s a PITA when it comes to stopping playing a DVD or a big video file.

The kernel usually keeps in memory cache data that has been read from the hard drive so that it can get it faster next time the same data is accessed. I don’t know exactly on what grounds fragments are decided to be kept or not, but observation shows that playing a DVD or a Xvid file makes the cache grow more than significantly. Moreover, while playing the video, the other software from the desktop (nautilus, for example), is not used, thus, the kernel decides it can swap it to disk virtual memory.

Then, when you stop reading your video and want to come back to normal activity, your desktop is damn slow for some long seconds. That makes the experience a real pain.

Overuse of network bandwidth

I noticed that when I switched from a samba network share to an apache based DAV one: reading a video file from the DAV share with totem-gstreamer filled my apache logs very quickly. It seems gstreamer/gnomevfs seeks a lot in the file to play the video. Instead of making one HTTP request, it does several thousands, each time requesting again data it already received.

As a result of that, it usually takes up to 1 mega byte per second to play a video that has a bitrate of 1 mega bit per second, with a nice effect of network congestion when the bit rate grows for detailed sequences.

Do you find it normal that it takes 5 minutes to download a 45 minutes file at 2~3 MB/s, and 1MB/s for 45 minutes to play it directly from the network ?

Well, now, gstreamer 0.10 doesn’t even support reading from HTTP/DAV, but the problem remains the same when reading via sftp with gnomevfs.

2006-08-19 08:40:26+0900

miscellaneous, p.d.o

Both comments and pings are currently closed.

3 Responses to “Two things I don’t like about “multimedia linux””

  1. James Says:

    I believe they added support for some bits of posix_fadvise in Linux 2.6.6 (or thereabouts) to allow apps to stop exactly this happening. But the kernel doesn’t appear to properly implement the really useful one (i.e. simple for application developers) – POSIX_FADV_NOREUSE.

  2. required Says:

    open w/ O_DIRECT ? or perhaps implement a O_NOCACHE option :

  3. Jeff Waugh Says:

    Whoa, holy crap – could you do some analysis on the gstreamer stuff and file a bug? If your analysis so far is correct, that’s seriously scary.