Flash Player Sample Rate Issues?

Posted: March 3, 2011 in Linux Sound
Tags: ,

Well, after building and settings up my HTPC I experienced an issue with some flash videos. Certain videos, particularly videos of lesser quality, not youtube’s 720p videos, would sound like there was a sample rate conversion problem.

After trying several things, I finally came across this bug report on Red Hat, and it turns out that Linus Torvalds had the same problem!!

Well, they used their fancy developer tools and figured out that the problem was in glib. It turns out glib made a change to memcpy which broke binary compatibility. As Linus said, it doesn’t make much sense to make a change to something like memcpy, and break binary compatibility, if there isn’t a VERY large upside. Which is what happened. Even if it would take 10 minutes for Adobe to fix it, and I completely agree that it sucks to have to cater to the likes of Adobe’s proprietary flash. Anyway, you could read the interesting debate in the thread.

Here’s how to fix it.

I tried the other fixes in the bug report and couldn’t get them to work, this is the one that worked the best.

Basically we compile our own version of memcpy and use LD_PRELOAD to use it with our web browser.

First download and untar memcpy. Then change directories and compile it.

wget https://spideroak.com/share/LJUXIWQ/ilovelinux/home/paul/Interweb/Public/memcpy/mymemcpy-1.1.tar.gz && tar -xzf mymemcpy-1.1.tar.gz && cd mymemcpy-1.1 && ./configure && make && make install

Now, as root, run

make install

It should tell you where it put the library, it should be /usr/local/lib/libmymemcpy.so

Now when you start your browser just do the following

LD_PRELOAD=/usr/local/lib/libmymemcpy.so /usr/bin/iceweasel

That information is also in the README.

Now just decide how you want open your browser so that this change i implemented.

Thanks to Yersinia for the tarball.



Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s