LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-25-2009, 02:24 AM   #1
minge.zu
LQ Newbie
 
Registered: Oct 2008
Location: Beijing
Posts: 17

Rep: Reputation: 0
Question dynamically switch audio soundcard


Hello,
In Fedora 11 there is a new version of gnome-volume-control.Its UI has a tab 'output' which can be used to change the audio output device.For example,if I have two soundcards,when the audio player is running,I can switch the output devices and the sound outflow from different card.
Now I want to get this automatically by my program(or shell script).How should I do? any suggestion is appreciated. thanks!
 
Old 08-25-2009, 08:11 PM   #2
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,083

Rep: Reputation: 404Reputation: 404Reputation: 404Reputation: 404Reputation: 404
It's up to each individual program which output to use. ALSA just makes all of them available, and sets a default one.
 
Old 08-25-2009, 09:37 PM   #3
minge.zu
LQ Newbie
 
Registered: Oct 2008
Location: Beijing
Posts: 17

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by i92guboj View Post
It's up to each individual program which output to use. ALSA just makes all of them available, and sets a default one.
Thank for your reply.but I am still confused,any more hints?
 
Old 08-25-2009, 10:29 PM   #4
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,083

Rep: Reputation: 404Reputation: 404Reputation: 404Reputation: 404Reputation: 404
Quote:
Originally Posted by minge.zu View Post
Thank for your reply.but I am still confused,any more hints?
Media players and the like, usually have an option to specify which output to use. For example, if I have many cards, in mplayer I can do this to select which one to use:

Code:
mplayer -ao alsa:device=hw=X.0 whatever.mp3
Where 'X' is the card to use, 0 for the first, 1 for the second, and so on. Other programs will have a similar option, and graphical frontends usually will have some configuration dialog where to specify this.
 
Old 08-25-2009, 10:37 PM   #5
minge.zu
LQ Newbie
 
Registered: Oct 2008
Location: Beijing
Posts: 17

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by i92guboj View Post
Media players and the like, usually have an option to specify which output to use. For example, if I have many cards, in mplayer I can do this to select which one to use:

Code:
mplayer -ao alsa:device=hw=X.0 whatever.mp3
Where 'X' is the card to use, 0 for the first, 1 for the second, and so on. Other programs will have a similar option, and graphical frontends usually will have some configuration dialog where to specify this.
OK,thank you!
as I know,alsa player 'aplay' also can specify the output hardware:hw:0,0.
but the problem is that how the gnome-volume-control communicate with audio player(or alsalib)?I mean that no matter what the player is,I wanna to switch the output device dynamically even when the player is already running.
 
Old 08-25-2009, 10:59 PM   #6
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,083

Rep: Reputation: 404Reputation: 404Reputation: 404Reputation: 404Reputation: 404
I don't think alsa has that capability at all.

However, it can be done with jack, and *maybe* pulseaudio, which work in top or alsa. You will need to configure your apps to work with jack instead, assuming that you have already jack up and running. Most apps, however, will automatically use jack if it's available.

ps. The gnome mixer, just like any other mixer, is just an interface to the mixer of each device. Each device has a separate mixer, and they don't intercommunicate or something like that. What you need, definitely is jack.

Last edited by i92guboj; 08-25-2009 at 11:00 PM.
 
Old 08-26-2009, 02:39 AM   #7
minge.zu
LQ Newbie
 
Registered: Oct 2008
Location: Beijing
Posts: 17

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by i92guboj View Post
I don't think alsa has that capability at all.

However, it can be done with jack, and *maybe* pulseaudio, which work in top or alsa. You will need to configure your apps to work with jack instead, assuming that you have already jack up and running. Most apps, however, will automatically use jack if it's available.

ps. The gnome mixer, just like any other mixer, is just an interface to the mixer of each device. Each device has a separate mixer, and they don't intercommunicate or something like that. What you need, definitely is jack.
Thank you for your suggestion!
I think I should search more informations about jack.
 
  


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
ubuntu -how do i switch from onboard sound to pci soundcard boyd98 Linux - Hardware 3 01-12-2010 07:46 PM
[SOLVED] Onboard Audio (hda_intel) for Mic Input and Soundcard (ca0106) for Audio Output? snowdonkey Linux - General 1 07-11-2009 03:17 PM
M-Audio - Audiophile USB soundcard jasonsexton Ubuntu 0 08-26-2006 08:25 PM
Crystal Audio Soundcard davethegenius Linux - Hardware 1 04-23-2005 03:49 AM
Getting CD audio through PCI soundcard NOT motherboard soundcard HalfDiminished Debian 0 01-11-2005 06:59 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:50 PM.

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
Open Source Consulting | Domain Registration