Unix Technical Forum

problems setting up alsa on gentoo - sox: Can't open output file:

This is a discussion on problems setting up alsa on gentoo - sox: Can't open output file: within the Gentoo Linux Support forums, part of the Unix Operating Systems category; --> Hi! After installing compiling and installing alsa from the source, I am still not able to get some music ...


Go Back   Unix Technical Forum > Unix Operating Systems > Gentoo Linux Support

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-21-2008, 09:12 AM
Tamer Higazi
 
Posts: n/a
Default problems setting up alsa on gentoo - sox: Can't open output file:

Hi!
After installing compiling and installing alsa from the source, I am
still not able to get some music to run.

I receive the error message:

sox: Can't open output file: '/dev/dsp': Permission denied

/dev/dsp doesn't exist, what could mean that the devfsd application
didn't set up the virtual filesystem for the soundcard.

what I did:

Kernel: Soundcard support is available and devfsd (with automount at
boottime) is activated

alsa: latest alsa stuff downloaded, compiled and installed
alsa: soundcard is confifured with alsaconfig

Sample Linux-User with audio access is created!

For any ideas and help to solve my problem, I would thank very much


Tamer


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-21-2008, 09:12 AM
Albert
 
Posts: n/a
Default Re: problems setting up alsa on gentoo - sox: Can't open output file: '/dev/dsp': Permission denied

Tamer Higazi has offered us the following clue :

> Hi!
> After installing compiling and installing alsa from the source, I am
> still not able to get some music to run.
>
> I receive the error message:
>
> sox: Can't open output file: '/dev/dsp': Permission denied
>
> /dev/dsp doesn't exist, what could mean that the devfsd application
> didn't set up the virtual filesystem for the soundcard.
>
> what I did:
>
> Kernel: Soundcard support is available and devfsd (with automount at
> boottime) is activated
>
> alsa: latest alsa stuff downloaded, compiled and installed
> alsa: soundcard is confifured with alsaconfig
>
> Sample Linux-User with audio access is created!
>
> For any ideas and help to solve my problem, I would thank very much
>
>
> Tamer


Did ou try to run music from root to check permissions ?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-21-2008, 09:13 AM
Karsten Baumgarten
 
Posts: n/a
Default Re: problems setting up alsa on gentoo - sox: Can't open output

Tamer Higazi wrote:
> Hi!
> After installing compiling and installing alsa from the source, I am
> still not able to get some music to run.
>
> I receive the error message:
>
> sox: Can't open output file: '/dev/dsp': Permission denied
>
> /dev/dsp doesn't exist, what could mean that the devfsd application
> didn't set up the virtual filesystem for the soundcard.
>
> what I did:
>
> Kernel: Soundcard support is available and devfsd (with automount at
> boottime) is activated
>
> alsa: latest alsa stuff downloaded, compiled and installed
> alsa: soundcard is confifured with alsaconfig
>
> Sample Linux-User with audio access is created!
>
> For any ideas and help to solve my problem, I would thank very much


/dev/dsp is an OSS device, not an ALSA device. You need to enable OSS
emulation in the kernel (look in the ALSA section), which creates the
(deprecated) devices for you.

--
Regards,

Karsten
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-21-2008, 09:13 AM
Sybren Stuvel
 
Posts: n/a
Default Re: problems setting up alsa on gentoo - sox: Can't open output file: '/dev/dsp': Permission denied

Albert enlightened us with:
> Did ou try to run music from root to check permissions ?


Albert, you keep giving bad advice. Running something as root, just
because it's giving a permission denied error is Bad Practice. What's
wrong with simply examining the output of "stat /dev/dsp"?

My guess: OP isn't in the 'audio' group.

Sybren
--
The problem with the world is stupidity. Not saying there should be a
capital punishment for stupidity, but why don't we just take the
safety labels off of everything and let the problem solve itself?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 02-21-2008, 09:13 AM
Tamer Higazi
 
Posts: n/a
Default Re: problems setting up alsa on gentoo - sox: Can't open output

Hui Sybren!
The user is in the "audio" group. By the way, I think I'll try out what
Karsten said. That sounded for me more logical.

But thank you anyway.

Sybren Stuvel schrieb:
> Albert enlightened us with:
>
>>Did ou try to run music from root to check permissions ?

>
>
> Albert, you keep giving bad advice. Running something as root, just
> because it's giving a permission denied error is Bad Practice. What's
> wrong with simply examining the output of "stat /dev/dsp"?
>
> My guess: OP isn't in the 'audio' group.
>
> Sybren

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 02-21-2008, 09:13 AM
Karsten Baumgarten
 
Posts: n/a
Default Re: problems setting up alsa on gentoo - sox: Can't open output

I wrote:
>
> /dev/dsp is an OSS device, not an ALSA device. You need to enable OSS
> emulation in the kernel (look in the ALSA section), which creates the
> (deprecated) devices for you.
>


Basically my suggested solution works, but it dosn't really fit your
problem. I missed your first statement "installed ALSA from source".
Sorry about that. In this case you'll need the alsa-oss compatibility
layer (just emerge alsa-oss) to enable the OSS emulation.

--
Regards,

Karsten
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 02-21-2008, 09:13 AM
Albert
 
Posts: n/a
Default Re: problems setting up alsa on gentoo - sox: Can't open output file: '/dev/dsp': Permission denied

Sybren Stuvel has offered us the following clue :

> Albert enlightened us with:
>> Did ou try to run music from root to check permissions ?

>
> Albert, you keep giving bad advice. Running something as root, just
> because it's giving a permission denied error is Bad Practice. What's
> wrong with simply examining the output of "stat /dev/dsp"?
>
> My guess: OP isn't in the 'audio' group.
>
> Sybren


Thank you Mollah Sybren for enlighting us on Good Practise.
We all know it is bad practise to launch anything from root but this is very
theoritical in case of a desktop use where one already runs such a vast
quantity of software such as media players or even X. If you run such
software on a Linux box, that means you accept some degree of risk
(http://www.gentoo.org/security/en/gl...200408-01.xml).
Running a piece of software which is well known 1 minute from root carries a
limited risk and gives you an immediate idea if you were having a
permission problem. Permission problems can be quite difficult to sort out
because several things can pile up. One time, I spent a long time trying to
understand why a file for which I had all permissions would not delete,
only to find later that one directory far above did not have the correct
rights. Rights in Linux is a wonderful thing but can be quite a headache
and are sometimes overkill.

By the way, if I understand well, you recommend that people like me using
scanning, audio, CD recording, etc, should belong to the scanner, audio,
cdr, etc groups ? This is nonsense for a regular desktop usage such as
mine. I bother for security but there is a limit between good practise and
extremism. For a Linux box sitting on a network, OK, I accept that.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 02-21-2008, 09:13 AM
Johan Lindquist
 
Posts: n/a
Default Re: problems setting up alsa on gentoo - sox: Can't open output file: '/dev/dsp': Permission denied

So anyway, it was like, 11:30 CET Feb 08 2005, you know? Oh, and, yeah,
Albert was all like, "Dude,

> By the way, if I understand well, you recommend that people like
> me using scanning, audio, CD recording, etc, should belong to the
> scanner, audio, cdr, etc groups ? This is nonsense for a regular
> desktop usage such as mine.


On the contrary, the default security settings for certain software
that require such devices are often set to a certain group. If just
adding your username to the "audio" group makes music playback work,
doesn't that seem like a pretty neat idea?

> I bother for security but there is a limit between good practise and
> extremism. For a Linux box sitting on a network, OK, I accept that.


Your linux box isn't sitting on a network then, I take it?

--
Time flies like an arrow, fruit flies like a banana. Perth ---> *
11:41:24 up 107 days, 8 min, 11 users, load average: 1.04, 1.54, 1.27
Linux 2.6.9 x86_64 GNU/Linux Registered Linux user #261729
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 02-21-2008, 09:15 AM
Simon Kellett
 
Posts: n/a
Default Re: problems setting up alsa on gentoo - sox: Can't open output

Karsten Baumgarten <karsten@invalid.net> writes:

> /dev/dsp is an OSS device, not an ALSA device. You need to enable OSS
> emulation in the kernel (look in the ALSA section), which creates the
> (deprecated) devices for you.


I have currently upgraded to 2.6.10 from 2.4.26, from fsdev to udev and
OSS to Alsa and have not quite got it sorted out but:

I have Alsa with OSS support built as modules, and unfortunately /dev/dsp
and /dev/mixer are *not* created by the loaded modules. But the
following works:

As root (I do it in a boot script now):

mknod -m 660 /dev/dsp c 14 3
chgrp audio /dev/dsp
mknod -m 660 /dev/mixer c 14 3
chgrp audio /dev/mixer

And add yourself to audio group.

Accessing /dev/dsp as a user (eg starting mpg123 or realplayer) will
then load the correct modules. But it starts fully muted so use a mixer
to raise the volume (eg aumix).

I have not had time yet to find the "correct way" to interface OSS apps
to Alsa :-(

--
Simon Kellett, Darmstadt, Germany | http://home.arcor.de/zoxed
Gentoo Linux, Fvwm, Firefox | Xemacs, vm, Gnus
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 11:29 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com