LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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-14-2008, 12:03 PM   #1
moob8
Member
 
Registered: Sep 2006
Distribution: slackware
Posts: 132

Rep: Reputation: 15
non-root fails to play audio


sound doesn't work for non root. Slackware 12. Rather than a length explanation of "i have tried this", a series of dumps:

Code:
bob@darkstar bob $ play hum.mp3
ALSA lib confmisc.c:674:(snd_determine_driver) could not open control for card 0
ALSA lib conf.c:2713:(snd_config_hooks_call) function snd_config_hook_load_for_all_cards returned error: Permission denied
ALSA lib confmisc.c:674:(snd_determine_driver) could not open control for card 0
ALSA lib conf.c:3510:(_snd_config_evaluate) function snd_func_card_driver returned error: Permission denied
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:3510:(_snd_config_evaluate) function snd_func_concat returned error: Permission denied
ALSA lib confmisc.c:1251:(snd_func_refer) error evaluating name
ALSA lib conf.c:3510:(_snd_config_evaluate) function snd_func_refer returned error: Permission denied
ALSA lib conf.c:3982:(snd_config_expand) Evaluate error: Permission denied
ALSA lib pcm.c:2144:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.default
sox: Failed writing default: cannot open audio device
bob@darkstar bob $
Code:
bob@darkstar bob $ aplay hum.mp3
ALSA lib confmisc.c:674:(snd_determine_driver) could not open control for card 0
ALSA lib conf.c:2713:(snd_config_hooks_call) function snd_config_hook_load_for_all_cards returned error: Permission denied
ALSA lib confmisc.c:674:(snd_determine_driver) could not open control for card 0
ALSA lib conf.c:3510:(_snd_config_evaluate) function snd_func_card_driver returned error: Permission denied
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:3510:(_snd_config_evaluate) function snd_func_concat returned error: Permission denied
ALSA lib confmisc.c:1251:(snd_func_refer) error evaluating name
ALSA lib conf.c:3510:(_snd_config_evaluate) function snd_func_refer returned error: Permission denied
ALSA lib conf.c:3982:(snd_config_expand) Evaluate error: Permission denied
ALSA lib pcm.c:2144:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.default
aplay: main:545: audio open error: Permission denied
bob@darkstar bob $
Code:
root@darkstar bin # ls -ld /dev/audio
lrwxrwxrwx 1 root root 6 2008-10-12 10:34 /dev/audio -> audio0
root@darkstar bin # ls -ld /dev/audio0
crw-rw--w- 1 root audio 14, 4 2008-10-04 12:21 /dev/audio0
root@darkstar bin #
next is in the /etc directory ...
Code:
root@darkstar etc # grep audio * | grep bob
group:audio:!:17:bob
group-:audio:!:17:bob
gshadow:audio:::bob
gshadow-:audio:::bob
root@darkstar etc # ls -l group group-
-rw-r--r-- 1 root root 574 2008-10-14 10:00 group
-rw------- 1 root root 570 2008-10-14 09:59 group-
root@darkstar etc #
Please, how do I fix it?
 
Old 10-14-2008, 12:57 PM   #2
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 655Reputation: 655Reputation: 655Reputation: 655Reputation: 655Reputation: 655
Code:
ls /dev/ -R -l | egrep '^.{10}\+'
crw-rw----+ 1 root     audio  14,   4 2008-10-05 19:12 audio
crw-rw----+ 1 root     audio  14,   3 2008-10-05 19:12 dsp
crw-rw----+ 1 root     audio  14,   0 2008-10-05 19:12 mixer
crw-rw----+ 1 root     disk   21,   1 2008-10-03 21:59 sg1
crw-rw----+ 1 root     disk   21,   5 2008-10-12 23:53 sg5
brw-rw----+ 1 root     disk   11,   0 2008-10-03 21:59 sr0
crw-rw----+ 1 root     video  81,   0 2008-10-03 21:59 video0
crw-rw----+ 1 root root 13, 66 2008-10-03 21:59 event2
crw-rw----+ 1 root root 13, 67 2008-10-03 21:59 event3
crw-rw----+ 1 root root 13, 68 2008-10-11 23:37 event4
crw-rw----+ 1 root audio 116, 7 2008-10-03 21:59 controlC0
crw-rw----+ 1 root audio 116, 6 2008-10-03 21:59 hwC0D0
crw-rw----+ 1 root audio 116, 5 2008-10-03 21:59 hwC0D1
crw-rw----+ 1 root audio 116, 4 2008-10-03 21:59 pcmC0D0c
crw-rw----+ 1 root audio 116, 3 2008-10-14 11:37 pcmC0D0p
crw-rw----+ 1 root audio 116, 8 2008-10-05 19:12 seq
crw-rw----+ 1 root audio 116, 2 2008-10-03 21:59 timer
I've got myself enabled with the acls as well. I think it has something to do with PolicyKit.
Check the permissions of the files in /dev/snd/. They should be group owned by "audio" as well.

Sometimes I've run both "alsaconfig" and my distro's sound configuration utility to enable sound.
 
Old 10-14-2008, 01:51 PM   #3
astrogeek
Senior Member
 
Registered: Oct 2008
Distribution: Slackware [64]X{.0|.1|.2|-current} ::X>=12<=14, FreeBSD_10{.0|.1}
Posts: 2,165

Rep: Reputation: 848Reputation: 848Reputation: 848Reputation: 848Reputation: 848Reputation: 848Reputation: 848
Don't change file permission or group - change user group

I think you just need to add the non-root users to the 'audio' group, something like...

usermod -G audio username

where 'username' is the user name to add.

Unlike most distros, Slackware in it's unix-correctness way, uses groups to manage user access to these things...
 
Old 10-14-2008, 08:25 PM   #4
T3slider
Senior Member
 
Registered: Jul 2007
Distribution: Slackware64-14.1
Posts: 2,298

Rep: Reputation: 722Reputation: 722Reputation: 722Reputation: 722Reputation: 722Reputation: 722Reputation: 722
Quote:
Originally Posted by astrogeek
I think you just need to add the non-root users to the 'audio' group, something like...

usermod -G audio username

where 'username' is the user name to add.

Unlike most distros, Slackware in it's unix-correctness way, uses groups to manage user access to these things...
`usermod -G audio username` is NOT the correct command, and it is unfortunately quoted too often. `man usermod` says this:
Code:
       -G group,[...]
              A list of supplementary groups which the user is also  a  member
              of.   Each  group is separated from the next by a comma, with no
              intervening whitespace.  The groups  are  subject  to  the  same
              restrictions as the group given with the -g option.  If the user
              is currently a member of a group which is not listed,  the  user
              will be removed from the group
Unless you want your user to be removed from all other groups and then added only to the audio group (which no one would want), the following command is better:
Code:
# gpasswd -a user audio
However, this output
Quote:
Originally Posted by moob8
Code:
root@darkstar etc # grep audio * | grep bob
group:audio:!:17:bob
group-:audio:!:17:bob
gshadow:audio:::bob
gshadow-:audio:::bob
suggests that user 'bob' (which I'm assuming is the correct user) is already added to the audio group. To verify, you should try the command `id` as your normal user to see what groups you are a part of (though I think this may be misleading since /etc/login.defs places you transiently in the floppy, audio, cdrom and video groups if you use runlevel 3).
 
Old 10-14-2008, 09:07 PM   #5
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 655Reputation: 655Reputation: 655Reputation: 655Reputation: 655Reputation: 655
I hadn't looked before at what the messages actually said. This line:
Code:
ALSA lib confmisc.c:674:(snd_determine_driver) could not open control for card 0
for example, implies to me that the /dev/snd/controlC0 device isn't group owned by the "audio" group.
 
Old 10-14-2008, 11:00 PM   #6
astrogeek
Senior Member
 
Registered: Oct 2008
Distribution: Slackware [64]X{.0|.1|.2|-current} ::X>=12<=14, FreeBSD_10{.0|.1}
Posts: 2,165

Rep: Reputation: 848Reputation: 848Reputation: 848Reputation: 848Reputation: 848Reputation: 848Reputation: 848
Thanks T3 - I stand corrected!

Quote:
Originally Posted by T3slider View Post
`usermod -G audio username` is NOT the correct command, and it is unfortunately quoted too often.
Yikes! Just when you think you know how something works!

I myself have used it that way for quite some time, guess I have just been lucky in not encountering ill effects!

But you are correct as actually reading the man page shows... now where is the icon for 'egg on face'...? ()-}
 
Old 10-14-2008, 11:17 PM   #7
T3slider
Senior Member
 
Registered: Jul 2007
Distribution: Slackware64-14.1
Posts: 2,298

Rep: Reputation: 722Reputation: 722Reputation: 722Reputation: 722Reputation: 722Reputation: 722Reputation: 722
Quote:
Originally Posted by astrogeek
Yikes! Just when you think you know how something works!

I myself have used it that way for quite some time, guess I have just been lucky in not encountering ill effects!

But you are correct as actually reading the man page shows... now where is the icon for 'egg on face'...? ()-}
No worries. I only know that because of my participation in the incredibly long HAL thread, where the topic of the correct command to add users to groups was hotly debated.
 
Old 10-15-2008, 12:21 PM   #8
moob8
Member
 
Registered: Sep 2006
Distribution: slackware
Posts: 132

Original Poster
Rep: Reputation: 15
Thank you all for the replies.

I found a solution ... though it was kind of tedious. I had space on a partition, so I restored an old backup. I looked at the current dev vs the old dev in the backup. Some large number of files in dev had their group protections set to not be writable: very odd.

So, the tedious part, chmoding each of the things in dev. Now audio works for non-root.

p.s. Now if only I can get the console to stop beeping! but that is off topic to this thread.
 
Old 10-15-2008, 12:34 PM   #9
astrogeek
Senior Member
 
Registered: Oct 2008
Distribution: Slackware [64]X{.0|.1|.2|-current} ::X>=12<=14, FreeBSD_10{.0|.1}
Posts: 2,165

Rep: Reputation: 848Reputation: 848Reputation: 848Reputation: 848Reputation: 848Reputation: 848Reputation: 848
Silencing the bells

Just uncomment this line in /etc/inputrc :

#set bell-style none
 
Old 10-15-2008, 12:36 PM   #10
Ilgar
Member
 
Registered: Jan 2005
Location: Istanbul, Turkey
Distribution: Slackware 14.1, Slackware64 14.1
Posts: 930

Rep: Reputation: 96
Quote:
Originally Posted by moob8 View Post
p.s. Now if only I can get the console to stop beeping! but that is off topic to this thread.
Just uncomment the line

Code:
set bell-style none
in /etc/inputrc.
 
  


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
Burnt Audio CD by K3B CANNOT play on external CD playing device, but can play on comp robin.com.au Linux - Software 14 05-27-2007 05:30 AM
can't play audio CD when I'm not root yukie Linux - Newbie 7 06-12-2006 08:16 AM
Can not play audio cds as user (just as root) hraposo Slackware 4 08-06-2004 03:20 PM
Cannot play audio CD when non-root rsamurti Slackware - Installation 2 05-06-2004 08:49 PM
DVD plays but no audio (can play audio cd's though)? guitarnix Linux - Newbie 2 10-05-2003 08:52 AM


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

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