LinuxQuestions.org
Visit Jeremy's Blog.
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, 04:05 AM   #1
narz
Member
 
Registered: May 2007
Location: US
Distribution: slackware
Posts: 186

Rep: Reputation: 37
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, 04: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 04:18 AM.
 
Old 01-04-2013, 05:48 AM   #3
narz
Member
 
Registered: May 2007
Location: US
Distribution: slackware
Posts: 186

Original Poster
Rep: Reputation: 37
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, 06:02 PM   #4
narz
Member
 
Registered: May 2007
Location: US
Distribution: slackware
Posts: 186

Original Poster
Rep: Reputation: 37
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 06:15 PM.
 
1 members found this post helpful.
Old 02-26-2013, 11:37 AM   #5
john2
Member
 
Registered: Aug 2004
Location: Wales
Distribution: Manjaro, Kubuntu, MX
Posts: 102

Rep: Reputation: 29
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, 10:16 PM   #6
ReaperX7
LQ Guru
 
Registered: Jul 2011
Location: California
Distribution: Slackware64-15.0 Multilib
Posts: 6,554
Blog Entries: 15

Rep: Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097
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 01:19 PM
/dev/video devices keep switching pickarooney Linux - Hardware 2 08-23-2008 04:54 AM
Switching Ethernet devices on boot omega9380 Linux - Networking 1 02-21-2006 07:36 PM
switching between/activate network devices snow_bound Mandriva 3 06-04-2005 12:48 AM
Switching between two sound output devices in FC2 fat-guy Linux - Hardware 3 11-24-2004 08:18 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 02: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
Open Source Consulting | Domain Registration