Realplayer uses the OSS sound driver, and on sound cards with only one channel this can grab the whole card until the application releases it (or usually, terminates).
You can call realplayer using a program called aoss (which in Ubuntu is part of the alsa-oss package). This channels the OSS driver calls though ALSA, which knows how to share the sound card with other ALSA apps. Most apps are ALSA these days, with a few OSS apps still remaining, and being a pain in the butt. Some programs allow you to choose which one to use - ALSA or OSS (e.g. Skype).
What I did was to create a wrapper script called realplay which I put in my PATH before the existing realplay launcher. This script contains the following:
Code:
#!/bin/bash
pgrep realplay > /dev/null
if [ $? -eq 0 ]; then
aoss /opt/real/realplay -r "$@"
else
aoss /opt/real/realplay "$@"
fi
As you an see I installed realplayer to /opt/real, and this is called from my wrapper script. My wrapper script has another function - if an instance of realplayer is already running it opens the requested media in that instance of the program rather than opening a second window.
I put this in a directory called bin in my HOME directory, which I added to the PATH in my .bashrc file by adding a line to the end of the file:
Code:
export PATH="$PATH:$HOME/bin"
To make this effective for all apps I had to log out and back in again.