LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 10-04-2012, 02:32 AM   #1
688a
Member
 
Registered: Sep 2012
Location: Hong Kong
Distribution: Slackware14 (3.7)
Posts: 51

Rep: Reputation: Disabled
[Solved] USB Speaker


Hi there.

I have a Logitech USB speacker connected to my laptop. Trying to make it work, I searched the similar questions here.

I've found some threads and answer was to user alsamixer.

My question is, I can see my speaker in alsamixer by pressing F6. But how to make it work? The sound is coming from my laptop's speaker. Funny thing is I can control the volume by my Logitech speacker, but sound never comes out from it! How to make the usb speaker the master?

Thank guys.

Last edited by 688a; 10-08-2012 at 08:50 AM.
 
Old 10-04-2012, 02:43 AM   #2
zhjim
Senior Member
 
Registered: Oct 2004
Distribution: Debian Squeeze x86_64
Posts: 1,467
Blog Entries: 11

Rep: Reputation: 184Reputation: 184
Not sure which distro your running. But with debian and only using alsa (pulseaudio never did what it ought to) I can get another sound card going by setting up a local .asoundrc file. One could also do it system wide but that would need root privileges each time I change my sound setup.

Heres my .asoundrc which goes into your home directory
Code:
#defaults.ctl.card 2
#defaults.pcm.card 2
#defaults.timer.card 2
All lines are commented cause I right now don't have another soundcard inserted. To see your soundcards and numbers see /proc/asound/cards.
Just be aware that when you change your sound setup and .asoundrc accordingly you have to restart the program you want to use the new setting with.
 
Old 10-04-2012, 10:50 PM   #3
688a
Member
 
Registered: Sep 2012
Location: Hong Kong
Distribution: Slackware14 (3.7)
Posts: 51

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by zhjim View Post
Not sure which distro your running. But with debian and only using alsa (pulseaudio never did what it ought to) I can get another sound card going by setting up a local .asoundrc file. One could also do it system wide but that would need root privileges each time I change my sound setup.

Heres my .asoundrc which goes into your home directory
Code:
#defaults.ctl.card 2
#defaults.pcm.card 2
#defaults.timer.card 2
All lines are commented cause I right now don't have another soundcard inserted. To see your soundcards and numbers see /proc/asound/cards.
Just be aware that when you change your sound setup and .asoundrc accordingly you have to restart the program you want to use the new setting with.
Thx zhjim. My machine is running Slackware 14.
I can see my speaker in /proc/asound/cards, but I can't find the conf file .asoundrc! would it be in a different file name?
 
Old 10-05-2012, 02:40 AM   #4
zhjim
Senior Member
 
Registered: Oct 2004
Distribution: Debian Squeeze x86_64
Posts: 1,467
Blog Entries: 11

Rep: Reputation: 184Reputation: 184
You have to create it if its not there. As far as I recall mine wasn't there either. Just fire up your favorite editor and create it.
Mind the . (dot) at the start of the file

Code:
$ vi /home/$(id -un)/.asoundrc
 
Old 10-05-2012, 07:35 PM   #5
chrisretusn
Member
 
Registered: Dec 2005
Location: Philippines
Distribution: Slackware
Posts: 490

Rep: Reputation: Disabled
I have a Logitech Z205 my solution is to place the following in /etc/asound.conf. I used that instead of ~/.asoundrc because I wanted it as a global change since I have more than one user account on this laptop.

Code:
# Force USB speaker to default
pcm.!default {
type hw
card Z205
}

ctl.!default {
type hw
card Z205
}
I used Z205 in the above because I also have a Web Cam with a microphone, they does always take the same card.

You can get the information you need to use with "aplay -l".

This is the output on my system
Code:
bash-4.2$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Intel [HDA Intel], device 0: ALC861-VD Analog [ALC861-VD Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: Z205 [ Logitech Z205], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
Output of arecord -l showing card assigment for web cam mic
Code:
bash-4.2$ arecord -l
**** List of CAPTURE Hardware Devices ****
card 0: Intel [HDA Intel], device 0: ALC861-VD Analog [ALC861-VD Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 2: USB20Camera [USB2.0_Camera], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
The USB speaker takes card 1 because I plugged it in after booting before my web cam. If the devices are left in on a reboot or turn on, the web cam takes card 1, the Z205 takes card 2.
 
Old 10-06-2012, 12:28 PM   #6
688a
Member
 
Registered: Sep 2012
Location: Hong Kong
Distribution: Slackware14 (3.7)
Posts: 51

Original Poster
Rep: Reputation: Disabled
Unhappy

Quote:
Originally Posted by zhjim View Post
Not sure which distro your running. But with debian and only using alsa (pulseaudio never did what it ought to) I can get another sound card going by setting up a local .asoundrc file. One could also do it system wide but that would need root privileges each time I change my sound setup.

Heres my .asoundrc which goes into your home directory
Code:
#defaults.ctl.card 2
#defaults.pcm.card 2
#defaults.timer.card 2
...
Quote:
Originally Posted by chrisretusn View Post
I have a Logitech Z205 my solution is to place the following in /etc/asound.conf. I used that instead of ~/.asoundrc because I wanted it as a global change since I have more than one user account on this laptop.

Code:
# Force USB speaker to default
pcm.!default {
type hw
card Z205
}

ctl.!default {
type hw
card Z205
}
I used Z205 in the above because I also have a Web Cam with a microphone, they does always take the same card.

You can get the information you need to use with "aplay -l".
....


Hi both there.

I've tried to add both files in my machine:

Quote:
defaults.ctl.card 1
defaults.pcm.card 1
defaults.timer.card 1
/home/dww/.asoundrc lines 1-3/3 (END)
Quote:
pcm.!default {
type hw
card Z205
}
ctl.!default {
type hw
card Z205
}
/etc/asound.conf lines 1-8/8 (END)
Still my Z205 (Oh... I've a Z205 too ) is not working either! Here is the output of aplay in my computer! Should I not have both files at the same time? I'm kinda giving up...

Quote:
dww@r380:~$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: NVidia [HDA NVidia], device 0: ALC663 Analog [ALC663 Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: NVidia [HDA NVidia], device 3: HDMI 0 [HDMI 0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: Z205 [ Logitech Z205], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0
dww@r380:~$

Last edited by 688a; 10-06-2012 at 12:30 PM.
 
Old 10-06-2012, 03:28 PM   #7
chrisretusn
Member
 
Registered: Dec 2005
Location: Philippines
Distribution: Slackware
Posts: 490

Rep: Reputation: Disabled
What is the output of:

aplay -v /usr/share/sounds/pop.wav

-or-

aplay -v /usr/share/sounds/alsa/Noise.wav

Also aplay -L

Last edited by chrisretusn; 10-06-2012 at 03:35 PM.
 
Old 10-07-2012, 01:11 PM   #8
zhjim
Senior Member
 
Registered: Oct 2004
Distribution: Debian Squeeze x86_64
Posts: 1,467
Blog Entries: 11

Rep: Reputation: 184Reputation: 184
I would use only one of the files. Did not look it up but on the corner of mind there is a info that .asoundrc takes precedence over /etc/asound.conf if both files exists. Also in your .asoundrc I would use the number 2. Dunno why but I'd say as you have three cards listed counting up from zero up makes your Z205 number 2. (Also its written as "card 1"). Or just use the name of the card like you have in your asound.conf.

Just make .asoundrc and asound.conf look the same. Use chrises example. As you both have the same gear it should get you going.
 
Old 10-07-2012, 10:29 PM   #9
chrisretusn
Member
 
Registered: Dec 2005
Location: Philippines
Distribution: Slackware
Posts: 490

Rep: Reputation: Disabled
Yes .asoundrc does take precedence over asound.conf as it loads on user log in. You normally would only use one or the other, not both. I use asound.conf because I have more than one user account on this laptop and I'd rather do it system wide rather than by user.
 
Old 10-08-2012, 08:26 AM   #10
688a
Member
 
Registered: Sep 2012
Location: Hong Kong
Distribution: Slackware14 (3.7)
Posts: 51

Original Poster
Rep: Reputation: Disabled
Thx guys. It is working now.
 
  


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
USB Speaker Volume Control Ipozya Linux - Hardware 1 02-10-2011 11:11 PM
Need sound on USB not speaker dad Linux - Laptop and Netbook 4 10-14-2007 12:53 AM
How could I make USB speaker as default/master speaker ? czy11421 Linux - Hardware 1 09-02-2007 11:59 AM
Volume control speaker USB mjnman Linux - Hardware 0 07-12-2007 09:45 AM
USB speaker volume control? Brian Knoblauch Solaris / OpenSolaris 4 02-16-2006 07:40 AM


All times are GMT -5. The time now is 03:52 AM.

Main Menu
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