Posts Tagged ‘Sound’

I reported this bug with debian and it seems they will not make the changes to glibc. It does seem that one of the patches to seems to work and that is the workaround I will be using.

I’ve assisted a few others in fixing this. Here is a blog post with how to apply the patch.


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 && 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/

Now when you start your browser just do the following

LD_PRELOAD=/usr/local/lib/ /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.

Sometimes it may be desirable to connect a bluetooth audio device, such as headset, to the Linux audio service from the commandline. This isn’t well documented, especially since it wasn’t possible in some older versions of bluez, and just recently became possible again.

Firstly, as far as I know you need atleast bluez 4.87 to do this. Well, it doesn’t work in bluez 4.66.

Firstly, to do this we need to get the dbus address of the bluetooth adapter, which changes with restarts.

dbus-send --system --print-reply --dest=org.bluez / \
org.bluez.Manager.DefaultAdapter|awk '/object path/ {print $3}'

This will output the address of the bluetooth device.

Next, we will use bluez-simple-agent to pair the device. My device like many can be paired with the passphrase “0000”. So I pipe that to the bluez-simple-agent.

echo "0000" | bluez-simple-agent hci0 00:12:A1:90:39:A9

With the device paired and the address of the bluetooth adapter, we can now connect the device to the audio sink.

dbus-send --print-reply --system --dest=org.bluez BT_ADAPTER/dev_00_12_A1_90_39_A9 org.bluez.AudioSink.Connect

This command requires pulseaudio-module-bluetooth to be installed (I’m big on pulseaudio). You can see where I have the mac address and the bluetooth adapter address.

To disconnect the device from the audio sink you can simple run the same command again, but replace “Connect” with “Disconnect”.

You can also use the following command to “unpair” the bluetooth device.

bluez-test-device remove 00:12:A1:90:39:A9

So, just remember to use the mac address of your own device in substitution for mine.

Also, note that none of these commands need to be run as root!

Here is a script I wrote which automates the process. If I can find the script that I referenced, I will credit it. “pulsespeak” is a program I wrote as a wrapper to espeak.


### The Mac of the device I'm connecting to is
### 00:12:A1:90:39:A9

### I should make a variable
### MAC_ADD=00:12:A1:90:39:A9

_BT_ADAPTER=`dbus-send --system --print-reply --dest=org.bluez / \
org.bluez.Manager.DefaultAdapter|awk '/object path/ {print $3}'`
#echo "$BT_ADAPTER"

if [ "$1" == "off" ]; then
dbus-send --print-reply --system --dest=org.bluez $BT_ADAPTER/dev_00_12_A1_90_39_A9 org.bluez.AudioSink.Connect
#echo "0000" | bluez-simple-agent hci0 00:12:A1:90:39:A9 remove
bluez-test-device remove 00:12:A1:90:39:A9

if [ "$1" == "on" ]; then

echo "0000" | bluez-simple-agent hci0 00:12:A1:90:39:A9

dbus-send --print-reply --system --dest=org.bluez $BT_ADAPTER/dev_00_12_A1_90_39_A9 org.bluez.AudioSink.Connect
#pulsespeak "Bluetooth is now connected"