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 Tue 21 Oct 2014, 09:54
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 Posts_count_1  
Author Message
darkcity


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

PostPosted: Thu 27 Mar 2014, 11:54    Post_subject:  Method for switching playback from one soundcard to another
Sub_title: 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  48 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_website 
Display_posts:   Sort by:   
Page 1 of 1 Posts_count_1  
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » Advanced Topics » Hardware » Audio
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


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