LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-23-2004, 09:28 PM   #1
VioLaToR
Member
 
Registered: Aug 2002
Distribution: ArchLinux 2007.08 / Slackware 11.0
Posts: 58

Rep: Reputation: 15
when i try to play a sound file with mpg123 or mpg321 i get an error


When i try to play a song or a sound, it echos this:

ALSA lib pcm_hw.c:1055:(snd_pcm_hw_open) open /dev/snd/pcmC0D0p failed: Permission denied


Then it goes ahead and plays anyway. What can i do to get rid of this error?


I am a user with non root.

If i run that as su, then i do not get the error.



ls -l shows:

crw-rw--w- 1 root sys 116, 16 Aug 29 02:47 /dev/snd/pcmC0D0p

Last edited by VioLaToR; 02-23-2004 at 09:31 PM.
 
Old 02-23-2004, 11:39 PM   #2
tk31337
Member
 
Registered: Oct 2003
Location: Tucson, AZ
Distribution: Linux Mint
Posts: 194

Rep: Reputation: 32
"c"? I don't think I've seen that before. Huh, anyhow, try doing "chmod 0666 /dev/snd/pcmC0D0p" as root. That should give r/w permissions to everyone for that device (as well as summon the dark lord ;-)).
 
Old 02-23-2004, 11:56 PM   #3
VioLaToR
Member
 
Registered: Aug 2002
Distribution: ArchLinux 2007.08 / Slackware 11.0
Posts: 58

Original Poster
Rep: Reputation: 15
that does fix the error. but do you know why it was like it was? and why it needs to be the 666 for it to work with no error?

I tried all chmod configurations on it and 666 was the only thing that worked.

661, 662, 663, 664, 665 did not work, and still gave the errors.

Seems kinda odd to me. i was just wondering why it is like that.

Thanks for your input.

Last edited by VioLaToR; 02-24-2004 at 12:25 PM.
 
Old 02-24-2004, 02:25 AM   #4
tk31337
Member
 
Registered: Oct 2003
Location: Tucson, AZ
Distribution: Linux Mint
Posts: 194

Rep: Reputation: 32
Octal code works like this:
4=Read
2=Write
1=Execute
The reason it works this way has to do with binary theory, but I won't get into that. Anyhow, basically, it's easy to remember it this way, and therefore 0-7 is:
0=No Perms
1=Execute
2=Write
3=(2+1) Write & Execute
4=Read
5=(4+1) Read & Execute
6=(4+2) Read & Write
7=(4+2+1) Read, Write, Execute

Then in order from left to right it's Sticky Bit, User, Group, Others. So apparently, since the device was being used by a user (or process) which came into the "others" category, it needed to both read & write to not get the perms error. I bet if you had set it to 667, for instance, you wouldn't get the error message either, but you really don't need to execute the device (and may cause probs down the road).
 
Old 02-24-2004, 02:28 AM   #5
tk31337
Member
 
Registered: Oct 2003
Location: Tucson, AZ
Distribution: Linux Mint
Posts: 194

Rep: Reputation: 32
Oh yeah, and the reason I suggested that, was because you listed your perms as "rw-rw--w-". The third column is for others, and it's only listing write access. So those perms would be equivalent to 662.
 
Old 02-24-2004, 12:25 PM   #6
VioLaToR
Member
 
Registered: Aug 2002
Distribution: ArchLinux 2007.08 / Slackware 11.0
Posts: 58

Original Poster
Rep: Reputation: 15
yes, i know all of that already. and 667 or 777 or 767 also works, but i left those off for the obvious reasons you stated.

I just wondered why the permissions were set like they were by default if something else that came packaged in the OS was going to need different permissions.

thanks for the refresher course in chmod.
 
  


Reply



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
mpg321 gives http_open error when playing streams vrillusions Linux - Software 2 08-08-2005 10:43 PM
mpg321 gives no such device error thiqued Linux - Newbie 2 09-10-2004 07:56 PM
Mpg321/Mpg123 -- Infopipe like XMMS? Adrohak Linux - Software 2 08-19-2004 05:48 PM
how to play sound file with c code? khucinx Programming 1 05-11-2004 06:28 AM
mpg321 won't play high quality ogg vorbis files VorlonInfoTech Linux - Software 1 01-10-2004 09:23 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:17 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