Change output device for a specifik application

OSS specific Linux discussion (x86/amd64)

Moderators: hannu, dev, cesium, kodachi

Change output device for a specifik application

Postby Hawkis » Fri Jul 02, 2010 1:16 am

Hello.
I am completely new to OSS and decided to try it out yesterday, and so far, everything works exceptional and I have no issues whatsoever.

First of all, let me tell you about my setup:
My computer have two soundcards, one is for the PC speakers and the other is for my TV-out.
The TV I'm using is (Of course) for watching movies and such, so the card hooked up to it is not the default card.
Therefore, I use mplayer because it lets me choose which output device to use, so I can make it use the output for the TV.
So far, so good. No issues at all.

So my question is: Can I somehow configure OSS to let me force any given application to use a certain output device?

I want to run a video game emulator on the TV, and this is where my problem is. The emulator uses the default card, so the sound comes from the PC speakers and not the TV. Also, the emulator can't be reconfigured. It just doesn't have that feature.

X.org lets me open any application on a certain screen with the $DISPLAY variable. Can something similar be done with OSS?
Hawkis
New Member
 
Posts: 1
Joined: Fri Jul 02, 2010 12:46 am

Re: Change output device for a specifik application

Postby cesium » Fri Jul 02, 2010 4:52 pm

No, there isn't any default variable for this. A few apps listen to $AUDIODEV, but not all/most of them. So I can think of several options for the few apps with no mechanism to change output device:

A. There are apps which can change their output device, but it's not clearly pointed out in the docs. Can you tell me the name of the emulator?
B. You can change the default /dev/dsp output for the app, since it's just a symlink (i.e. 'ln -sf /dev/oss/.. /dev/dsp'). Once the app has started, you can just change the symlink back. A script can automate this (A more permament change of default output would require a bit more setup due to vmix considerations).
B. 2. A variant of the above - a simple lib can intercept the open request and change /dev/dsp to something else.
C. You can recompile the app, and change "/dev/dsp" string to something more useful.
D. If the app can output via Pulse/libao/SDL etc. these libs/sound servers have a mechanism to use a different output.
cesium
Developer
 
Posts: 902
Joined: Sun Aug 12, 2007 12:51 am


Return to Linux

Who is online

Users browsing this forum: Bing [Bot] and 1 guest