LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   Sound doesn't work on slackware 14 :( (http://www.linuxquestions.org/questions/slackware-14/sound-doesnt-work-on-slackware-14-a-4175481306/)

La VloZ 10-18-2013 11:44 AM

Sound doesn't work on slackware 14 :(
 
Hello all
I installed slackware 14 on my computer, i almost configured everything
I stopped on the sound !!!!! in the kde desktop when i test it i can listen to it :) but when i run a music or game i don't listen anything !!!!!!
It just work on kde testing settings !!!!!
I'm using root account :)
I to added root to audio group but it doesn't work !!!!!

When i run :
Code:

aplay -l | grep card
I get :
Code:

card 0: Intel [HDA Intel], device 0: ALC883 Analog [ALC883 Analog]
card 0: Intel [HDA Intel], device 1: ALC883 Digital [ALC883 Digital]
card 1: NVidia [HDA NVidia], device 3: HDMI 0 [HDMI 0]
card 1: NVidia [HDA NVidia], device 7: HDMI 0 [HDMI 0]
card 1: NVidia [HDA NVidia], device 8: HDMI 0 [HDMI 0]
card 1: NVidia [HDA NVidia], device 9: HDMI 0 [HDMI 0]
card 2: Set [C-Media USB Headphone Set], device 0: USB Audio [USB Audio]

I want to use the last one
Code:

card 2: Set [C-Media USB Headphone Set], device 0: USB Audio [USB Audio]
Cuz other are broken !!!!!!!!

Can someone please help me?? :)

Thank you all :)

mattca 10-18-2013 12:31 PM

When I've had issues with sound not working, it's usually been because something is using the sound card and preventing whatever application I'm using from accessing it.

If you do:
Code:

lsof | grep snd
That should tell you what's using the sound card. You may have to grep for something else, if your system doesn't use /dev/snd (not sure if that's standard or not).

mattca 10-18-2013 12:35 PM

Also, you may already be aware of this, but just in case... using root to run your X session is a very bad idea. You should create a user account for yourself, and use su when you need root permissions.

La VloZ 10-18-2013 01:08 PM

mattca this is the output of lsof | grep snd :)
Code:

#lsof | grep snd
kded4    5270    lavloz  23u      CHR      116,8      0t0    1580 /dev/snd/controlC0
kded4    5270    lavloz  24u      CHR    116,17      0t0    6791 /dev/snd/controlC1
kded4    5270    lavloz  25u      CHR    116,20      0t0  311767 /dev/snd/controlC2
kmix      5497    lavloz  11u      CHR      116,8      0t0    1580 /dev/snd/controlC0
kmix      5497    lavloz  16u      CHR    116,17      0t0    6791 /dev/snd/controlC1
kmix      5497    lavloz  17u      CHR    116,20      0t0  311767 /dev/snd/controlC2

I created a user but it doesn't work too
I noticed a thing :
I use XMMS to listen file but it doesn't use snd, it use dsp.
this a peice of my lsof | grep xmms when i listen to something (sure i don't listen anything on speakers) :
Code:

lsof | grep xmms
xmms      5957    lavloz  mem      REG        8,1  153614  1213917 /lib/ld-2.15.so
xmms      5957    lavloz    0r    FIFO        0,8      0t0  562175 pipe
xmms      5957    lavloz    1u      CHR        4,2      0t0    1058 /dev/tty2
xmms      5957    lavloz    2u      CHR        4,2      0t0    1058 /dev/tty2
xmms      5957    lavloz    3u    unix 0xe73c5680      0t0  644847 socket
xmms      5957    lavloz    4u    unix 0xe73c4780      0t0  644850 /tmp/xmms_lavloz.0
xmms      5957    lavloz    5r    FIFO        0,8      0t0  645602 pipe
xmms      5957    lavloz    6w    FIFO        0,8      0t0  645602 pipe
xmms      5957    lavloz    7u    unix 0xdcbdac80      0t0  645603 socket
xmms      5957    lavloz    8r      REG        8,3  1428169    4194 /d/La VloZ/quran/061.mp3
xmms      5957    lavloz    9w      CHR      14,3      0t0    8765 /dev/dsp

As u see the two last lines :)
Code:

xmms      5957    lavloz    8r      REG        8,3  1428169    4194 /d/La VloZ/quran/061.mp3
Is the path of my file :)
Code:

xmms      5957    lavloz    9w      CHR      14,3      0t0    8765 /dev/dsp
Is /dev/dsp :)

Does the problem is here?? if yes how do i make XMMS use /dev/snd (snd here is a directory)?? :)

La VloZ 10-18-2013 01:49 PM

Okey Thank you, i solved it :)

Note: This solution for ALSA.
First you have to know the ID of the device which you want use :)
You can get the devices IDs list from /proc/asound/cards
Or from
Code:

aplay -l | grep card
Then you have to create a file in your home directory named ~/.asoundrc
And write on it these 3 lines which make your default device :)

Code:

defaults.ctl.card DEVICE_ID
defaults.pcm.card DEVICE_ID
defaults.timer.card DEVICE_ID

Change DEVICE_ID with the number you've got from /proc/asound/cards or from
Code:

aplay -l | grep card
And test with this command :
Code:

speaker-test -c 2 -t wav
I hope everything is clear :)

Note: if you reboot your computer and you don't have the sound again, check the /proc/asound/cards for device ID maybe its has been changed without your knowledge (Like in my case) :)


All times are GMT -5. The time now is 10:59 PM.