LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-06-2007, 03:32 PM   #1
afa_linux
LQ Newbie
 
Registered: Oct 2005
Distribution: Ubuntu 8.04
Posts: 15

Rep: Reputation: 0
Linux more than 1 multimedia application sharing sound


Hey,
In Linux, does anyone know how to enable multiple applications like realplayer and other mp3 player to play sound at the same time?
Current I think when I started realplayer, it totally grabs the sound card. And I started xmms(another multimedia player) afterwards, it has no sound produced at all...(unless I closed realplayer application first, then start it)
Is this a common problem in Linux?
Sorry that I don't know how to explain this problem in a precisely technical way. Thanks in advance.
 
Old 12-06-2007, 03:45 PM   #2
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 63
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
multimedia center application khairil Programming 3 12-26-2006 03:41 AM
Video Multimedia Application of the Year jeremy 2005 LinuxQuestions.org Members Choice Awards 83 05-03-2006 10:28 PM


All times are GMT -5. The time now is 03:18 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration