LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   Making progs use definitions in asound.conf? (https://www.linuxquestions.org/questions/linux-hardware-18/making-progs-use-definitions-in-asound-conf-425842/)

tuxedo-notebook 03-17-2006 04:14 PM

Making progs use definitions in asound.conf?
 
Ok, I'm setting up a digital DJ system with a M-Audio Revolution 7.1 with alsa on Arch Linux. I want to be able to play songs from one player through the main speakers while preview other songs over the headphones. I got asound.conf all set up and I can sucessfully play two songs at the same time by doing:

aplay -D main song1.wav

in one console and:

aplay -D preview song1.wav

in another. I want programs like XMMS and amaroK to use these two asound definitions because they go to different channels and convert the format, but I can't figure out how to make the them do it.

With amaroK using gstreamer I can specifiy device (default is /dev/dsp) and parameters. With XMMS only default is in the slector box, but the device (default /dev/dsp) can also be altered.

How can I get my progs using the asound definitions?

bluelightning 03-19-2006 01:02 AM

Some programs use OSS for sound output (/dev/dsp is OSS), other program use ALSA (like aplay). Most people use OSS emulation to map /dev/dsp to ALSA, but that doesn't use your asound.conf. One option is to use aoss instead to emulate /dev/dsp.

A better option for XMMS is to use the ALSA output plugin. Chances are that this is already installed, but you didn't select it. Go to the perferences dialog in XMMS, and select ALSA as your output plugin. Click the configure button. Change audio device to main or preview in your case.

tuxedo-notebook 03-19-2006 04:46 AM

Thanks for the reply, that really clears things up for me.

After putting the main user in the audio group (apparently OSS doesn't care but ALSA does) XMMS didn't have any trouble outputting through preview using the ALSA output plugin. So that works how I want it now.

Only trouble now is that I'm trying to run two instances of XMMS with different configurations. Seems to me that the only way to do this as the same user is to actually change the ~/.xmms folder before starting each instance (overwriting current configs with two sets of old ones.) Of course I can still run the second instance as root, but I don't want to type a password for sudo in my script and although I doubt it would harm anything, it doesn't seem like always running an app as root is a good idea. I also tried using 'really' (part of chiark-utils) to run xmms as a different user, but I had little sucess with that. Any ideas?

Oh BTW, I did get that script working, but I'd rather keep current configuration for each instance if possible.

Thanks again bluelightning.

bluelightning 03-19-2006 04:56 AM

I don't know what the ideal solution is, but you could try switching your home directory but not user. Just do:
export HOME=newdirectory

If you put that in a script, the variable will only be changed for inside the script. Once the script is done, the variable will be back to normal.

I tried changing HOME on my computer, and I couldn't use the xserver afterwards from that terminal. I had to copy the .Xauthority over to fix it.

tuxedo-notebook 03-20-2006 02:16 PM

Changing HOME to a different dir in the main user's home worked great and now both instances of XMMS remember their configs. Thanks a lot!


All times are GMT -5. The time now is 08:52 AM.