LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices



Reply
 
Search this Thread
Old 01-04-2013, 05:05 AM   #1
narz
Member
 
Registered: May 2007
Location: US
Distribution: slackware
Posts: 184

Rep: Reputation: 35
Switching sound devices


I feel silly asking this, but I have no idea what I'm doing.

I have a Logitech USB headset with it's own internal sound card. Is there a simple way of switching between my onboard sound card and my headset? I have yet to actually even figure out how to use my headset. I can't switch sound cards with xfce mixer or alsamixer by themselves.

I'm finding a lot of random documentation that's either old, leaning toward other distributions configurations or pulseaudio related stuff. I found this http://alsa.opensrc.org/MultipleCards, but I don't know what is useful to me in that documentation.

Anyone can give me a simple explanation of how I accomplish this?

Thank you!!
 
Old 01-04-2013, 05:17 AM   #2
tuxbg
Member
 
Registered: Sep 2012
Location: Bulgaria,Varna
Distribution: Slackware64
Posts: 249

Rep: Reputation: Disabled
If you won't your USB headset to be primary sound device when system boot,then you have to create a file in /lib/modprobe with that content

options USB kernel module index=0
options other card module index=1

To view which module is used by system run that command lspci -vvv

Sorry for my english

This is mine i have a intel audio card and creative sound blaster,my creative card is a primary device

options snd-ctxfi index=0
options snd-hda-intel index=1

Last edited by tuxbg; 01-04-2013 at 05:18 AM.
 
Old 01-04-2013, 06:48 AM   #3
narz
Member
 
Registered: May 2007
Location: US
Distribution: slackware
Posts: 184

Original Poster
Rep: Reputation: 35
Hi I'm looking to switch between the two in the same session. I'd rather not reboot my computer every time I want to use headphones. This is possible to do right?
 
Old 01-05-2013, 07:02 PM   #4
narz
Member
 
Registered: May 2007
Location: US
Distribution: slackware
Posts: 184

Original Poster
Rep: Reputation: 35
Ok update and I'm not sure if there's a better way to do this but I found a sample udev rule on an Arch blog that lets me accomplish this.

Code:
# Set USB headset as default sound card when plugged in
KERNEL=="pcmC[D0-9cp]*", ACTION=="add", PROGRAM="/bin/sh -c 'K=%k; K=$${K#pcmC}; K=$${K%%D*}; echo defaults.ctl.card $$K > /etc/asound.conf; echo defaults.pcm.card $$K >>/etc/asound.conf'"

# Restore default sound card when USB headset unplugged
KERNEL=="pcmC[D0-9cp]*", ACTION=="remove", PROGRAM="/bin/sh -c 'echo defaults.ctl.card 0 > /etc/asound.conf; echo defaults.pcm.card 0 >>/etc/asound.conf'"

Though it works, it seems a little quirky. As applications like Audacious will spit out a warning "snd_mixer_find_selem failed" when you use it with your headset.

Last edited by narz; 01-05-2013 at 07:15 PM.
 
1 members found this post helpful.
Old 02-26-2013, 12:37 PM   #5
john2
Member
 
Registered: Aug 2004
Location: UK
Distribution: SolydK, Kubuntu, Mageia, OpenSUSE
Posts: 81

Rep: Reputation: 22
I don't know about alsa, but if you use PulseAudio Volume Control (package name pavucontrol), you can choose outputs on the Playback tab when a sound source is operating (dropdown on the right above the audio stream volume sliders).
 
Old 02-26-2013, 11:16 PM   #6
ReaperX7
Senior Member
 
Registered: Jul 2011
Location: California
Distribution: LFS-7.6, Slackware 14.1, FreeBSD 10.1
Posts: 3,834
Blog Entries: 15

Rep: Reputation: 1188Reputation: 1188Reputation: 1188Reputation: 1188Reputation: 1188Reputation: 1188Reputation: 1188Reputation: 1188Reputation: 1188
Slackware does not use PulseAudio.

alsamixer should be able to assign a primary sound card, or you can manually define it in /etc/modules.conf
 
  


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
What is the program/command for switching video devices drivers between v4l and v4l2? tauro_kpo Linux - Software 2 04-06-2009 02:19 PM
/dev/video devices keep switching pickarooney Linux - Hardware 2 08-23-2008 05:54 AM
Switching Ethernet devices on boot omega9380 Linux - Networking 1 02-21-2006 08:36 PM
switching between/activate network devices snow_bound Mandriva 3 06-04-2005 01:48 AM
Switching between two sound output devices in FC2 fat-guy Linux - Hardware 3 11-24-2004 09:18 PM


All times are GMT -5. The time now is 03:36 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration