Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Wed 30 Jul 2014, 05:28
All times are UTC - 4
 Forum index » Advanced Topics » Hardware » Audio
Method for switching playback from one soundcard to another
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [1 Post]  
Author Message
darkcity


Joined: 23 May 2010
Posts: 2435
Location: near here

PostPosted: Thu 27 Mar 2014, 11:54    Post subject:  Method for switching playback from one soundcard to another
Subject description: using /etc/asound.conf
 

Greetings

I have a built in a soundcard VIA 8237 and a USB Audiobox.

I have found a method for switching playback from one card to another. Unfortunately it doesn't work on the fly, the audio app must be restarted for it to take effect (tested with Slacko 5.3.1 using Firefox and aplay).

It involves writing to /etc/asound.conf

NOTE assumes /etc/asound.conf contains only two lines, something like:
defaults.pcm.card 0
defaults.pcm.device 0


Please back up /etc/asound.conf before using code and or tinkering.


for switching soundcard 0, device 0 the bash code using sed-
Code:
#switch to soundcard 0, device 0
asoundconf=/etc/asound.conf
sed -i '1s/.*/defaults.pcm.card 0/' $asoundconf
sed -i '2s/.*/defaults.pcm.device 0/' $asoundconf


for swtiching soundcard 1, device 0 the bash code using sed-
Code:
#switch to soundcard 1, device 0
asoundconf=/etc/asound.conf
sed -i '1s/.*/defaults.pcm.card 1/' $asoundconf
sed -i '2s/.*/defaults.pcm.device 0/' $asoundconf


I've written a script that toggles between card 0 and card 1, its very basic, improvements and suggestions welcome

Ref.
http://ptspts.blogspot.co.uk/2009/03/how-to-select-alsa-sound-card-and-have.html
http://alsa.opensrc.org/MultipleCards
playbacktoggle.tar.gz
Description 
gz

 Download 
Filename  playbacktoggle.tar.gz 
Filesize  802 Bytes 
Downloaded  34 Time(s) 

_________________
helping Wiki for help | IF SendSpace link = "dead" THEN PM me ("up file to http://meownplanet.net/")
Back to top
View user's profile Send private message Visit poster's website 
Display posts from previous:   Sort by:   
Page 1 of 1 [1 Post]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Hardware » Audio
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0434s ][ Queries: 13 (0.0057s) ][ GZIP on ]