pseudoberries random thoughts about life, hacking and open source

26Jan/100

iPhone sync lands on Linux!

That's right, iPhone 3.0 sync now works properly over the cable on Linux!

Mostly  thanks to the work of marcan. Ubuntu instructions are here.

Filed under: Linux, iPhone No Comments
26Dec/081

Tearing in video on Intel GM965?

Quick workaround if you're using mplayer:

  1. Use xvinfo to find the port number of the overlay Xv port.
  2. mplayer -vo xv:port=<port>

This will enable proper sync for video playback, but will of course disable any fancy compiz effects on videos. Hope it helps!

In my case the port was 84, so I added vo=xv:port=84 to ~/.mplayer/config

Tagged as: 1 Comment
9Sep/081

ALSA -> JACK and Flash

I've got an Edirol FA-66 firewire sound card. The only system on linux with support for this is JACK (with the FreeBoB driver). I use the FA-66 mainly for high quality audio playback. I start jackd with:

$ jackd -R --verbose -d freebob -r 44100

The command depends of course on your sound card. Test your setup with:

$ mplayer -ao jack some-file.mp3

Got sound? Excellent! Now, many audio players come with built-in jack playback support (gstreamer, pulseaudio, mplayer, xine, ...) But some don't, and the biggest issue for me here is Flash. Flash uses ALSA for playback, so it would be nifty if we could configure ALSA to redirect all it's sound to JACK. I have been able to redirect flash audio to PulseAudio and from there to JACK, but that requires yet another sound server. No thanks! So, if we can redirect audio from ALSA to JACK, most apps should be able to send their sound through my FA-66. For apps that aren't ALSA aware, there's always aoss.

Googling got me to the following solution in my ~/.asoundrc file:


# convert alsa API over jack API
# use it with
# % aplay foo.wav

# use this as default
pcm.!default {
type plug
slave { pcm "jack" }
}

ctl.mixer0 {
type hw
card 1
}

# pcm type jack
pcm.jack {
type jack
playback_ports {
0 system:playback_1
1 system:playback_2
}
capture_ports {
0 system:capture_1
1 system:capture_2
}
}

Test it with aplay file.avi. Nifty, now ALSA pushes all audio to JACK which in turn pushes it through the firewire port to my sound card! If you're unsure on what to put under playback_ports, just have a look at jack's verbose output (--verbose flag).

Rightie, now let's try with Flash. Pop up Firefox, youtube ahoy, nice video, play! ... Nada, no sound. :( Look at the debug output from jackd and you'll discover that the Flash player continously connects and disconnects. This results in a flood of debug messages in the console. According to this post, it seems to be a bug with Flash 9. I got to be honest with you, I couldn't get this to work properly with flash 9. The solution? Install Flash 10 Release Candidate! I'm on Ubuntu (8.04 "Hardy") so I downloaded the flash 10 RPM and ran the following commands:
$ sudo apt-get remove flashplugin-nonfree
$ fakeroot alien flashplayer10_install_linux_081108.i386.rpm
$ sudo dpkg -i flash-plugin_10.0.0.569-1_i386.deb
$ cd ~/.mozilla/plugins
$ ln -s /usr/lib/flash-plugin/libflashplayer.so

Restart firefox, check that youtube movie again and VOILA! There's SOUND! Hope it helps, and I hope you don't have to spend 2hrs on this as I did... :-/

(Who said it would be easy?)

Tagged as: 1 Comment
11Aug/080

Talk To Me 1.2

Today I spent some time hacking on my irssi notification script - Talk To Me. Up until now it has relied on irssi running on your local computer for the notifications to work. For me that's a problem - I run irssi in a screen session on a remote server. Launching the notification commands on the remote machine would have no effect at all. Then I found this blog post.

It describes how you can set up ssh to forward connections to a port on the remote machine to a port on your local host. This connection is then used to transfer notification messages from irssi to a local daemon which listens on the specified port, and launches notify-send to display them. Neat :-)

So I decided to incorporate this feature into Talk To Me! Go have a look! :-)

25Jun/080

XRandr not reporting the correct resolution for your external monitor?

For months I've struggled with connecting an external monitor to my laptop (ThinkPad X61). The external monitor supports resolutions up to 1280x1024, but xrandr -q reports a maximum resolution of only 1024x768! This is the same resolution as the main laptop screen. To get this to work I've previously had to issue the following commands:

xrandr --newmode "1280x1024_60.00"  108.88 1280 1360 1496 1712  1024 1025 1028 1060  -HSync +Vsync
xrandr --addmode VGA "1280x1024_60.00"
xrandr --output VGA --mode "1280x1024_60.00" --right-of LVDS

No more! Read on...

After a quick chat with the guys at #xorg @ freenode, they soon figured out my problem: In my Monitor section in xorg.conf there was specified a HorizSync and VertRefresh which were too low for X to operate on a resolution higher than 1024x768! After removing those lines and restarting X, xrandr reported the correct resolutions! Hooray!

14Nov/070

Compiz + Intel 965 = No XV video

Today I learned why my Intel GM965 video adapter had been blacklisted from compiz. Apparently there's an issue with the 965, compiz and Xv video.

The symptoms?

The program 'totem' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadAlloc (insufficient resources for operation)'.
  (Details: serial 48 error_code 11 request_code 140 minor_code 19)
  (Note to programmers: normally, X errors are reported asynchronously;
   that is, you will receive the error a while after causing it.
   To debug your program, run it with the --sync command line
   option to change this behavior. You can then get a meaningful
   backtrace from your debugger if you break on the gdk_x_error() function.)

See my ThinkPad X61 page for more information.