ossrecord - permission denied even as root

OSS specific Linux discussion (x86/amd64)

Moderators: hannu, dev, cesium

Kingpin
New Member
Posts: 3
Joined: Fri Mar 21, 2014 12:38 pm

ossrecord - permission denied even as root

Postby Kingpin » Thu Apr 10, 2014 11:15 am

ossrecord -d/dev/dsp assdf.wav
/dev/dsp: Permission denied

Why does it happen? Ossplay works perfectly well, and I can hear sound both in it and in applications. Thanks in advance.

igorzwx
Known Member
Posts: 1245
Joined: Sun Jun 28, 2009 9:31 pm

Re: ossrecord - permission denied even as root

Postby igorzwx » Thu Apr 10, 2014 2:31 pm

Kingpin wrote:ossrecord -d/dev/dsp assdf.wav
/dev/dsp: Permission denied

Why does it happen? Ossplay works perfectly well, and I can hear sound both in it and in applications. Thanks in advance.


You may post your "ossinfo" and other info about your system

Code: Select all

$ ossinfo


Code: Select all

$ ossrecord -i?


etc.

waterlaz
Member
Posts: 17
Joined: Wed Aug 27, 2014 4:16 pm
Sound Card: Audigy 2 value
OS: gentoo linux

Re: ossrecord - permission denied even as root

Postby waterlaz » Thu Dec 22, 2016 3:32 pm

I have the same problem now

Code: Select all

$ ossinfo
Version info: OSS 4.2 (b 2011/201609042125) (0x00040100) GPL
Platform: Linux/x86_64 4.7.2-gentoo #1 SMP Sun Sep 4 17:06:37 EEST 2016 (pidgin)

Number of audio devices:        2
Number of audio engines:        6
Number of mixer devices:        1


Device objects
 0: osscore0 OSS core services
 1: oss_hdaudio0 Intel HD Audio interrupts=914 (1181)
    HD Audio controller Intel HD Audio
    Vendor ID    0x8086293e
    Subvendor ID 0x10280211
     Codec  0: AD1984 (0x11d41984/0x10280211)


Mixer devices
 0: High Definition Audio AD1984 (Mixer 0 of device object 1)

Audio devices
HD Audio play front               /dev/oss/oss_hdaudio0/pcm0  (device index 0)
HD Audio play headphone           /dev/oss/oss_hdaudio0/pcm1  (device index 1)

Nodes
  /dev/dsp -> /dev/oss/oss_hdaudio0/pcm0
  /dev/dsp_in -> /dev/oss/oss_hdaudio0/pcm0
  /dev/dsp_out -> /dev/oss/oss_hdaudio0/pcm0
  /dev/dsp_ac3 -> /dev/oss/oss_hdaudio0/spdout0
  /dev/dsp_mmap -> /dev/oss/oss_hdaudio0/pcm0
  /dev/dsp_multich -> /dev/oss/oss_hdaudio0/pcm0


Code: Select all

$ ossrecord -i?                                                                                                     
/dev/dsp: Permission denied


All of this with root.


Code: Select all

 $ ossmix
Selected mixer 0/High Definition Audio AD1984
Known controls are:
jack.fp-green.mute ON|OFF (currently OFF)
jack.fp-green.headphone [<leftvol>:<rightvol>] (currently 58.4:58.4 dB)
jack.fp-green.headphone-sel <headphone|front> (currently front)
jack.fp-green.headphone-sel-m ON|OFF (currently ON)
jack.fp-green.input-mix-mute ON|OFF (currently OFF)
jack.green.mute ON|OFF (currently OFF)
jack.green.front [<leftvol>:<rightvol>] (currently 58.4:58.4 dB)
jack.green.front-mute ON|OFF (currently OFF)
jack.green.input-mix-mute ON|OFF (currently ON)
jack.int-speaker.mono-mix <monovol> (currently 32.9 dB)
jack.int-speaker.mono-sel <headphone|front> (currently headphone)
jack.int-speaker.mono-sel-mute ON|OFF (currently OFF)
jack.int-speaker.input-mix-mute ON|OFF (currently OFF)
jack.fp-pink [<leftvol>:<rightvol>] (currently 29.9:29.9 dB)
jack.blue [<leftvol>:<rightvol>] (currently 29.9:29.9 dB)
misc.aux-sel-mute ON|OFF (currently ON)
misc.input-mix-mute1 ON|OFF (currently OFF)
misc.aux-mix <aux-sel|input-mix> (currently input-mix)
misc.rec1-sel1 [<leftvol>:<rightvol>] (currently 59.9:59.9 dB)
misc.rec1-sel2 <fp-mic|linein|input-mix> (currently fp-mic)
misc.rec2-sel1 [<leftvol>:<rightvol>] (currently 71.9:71.9 dB)
misc.rec2-sel2 <fp-mic|linein|input-mix> (currently fp-mic)
misc.aux-sel <headphone|front> (currently headphone)
misc.beep <monovol> (currently 44.9 dB)
misc.fp-mic [<leftvol>:<rightvol>] (currently 46.4:46.4 dB)
misc.linein [<leftvol>:<rightvol>] (currently 41.9:41.9 dB)
misc.input-mix1 <fp-mic|linein> (currently fp-mic)
misc.input-mix2 [<leftvol>:<rightvol>] (currently 46.4:46.4 dB)
misc.dock-sel <headphone|front> (currently headphone)
misc.dock-sel-mute ON|OFF (currently OFF)
misc.input-mix-mute2 ON|OFF (currently OFF)
misc.dock-mix <dock-sel|input-mix> (currently input-mix)
vmix0-enable ON|OFF (currently ON)
vmix0-rate <decimal value> (currently 48000) (Read-only)
vmix0-channels <Stereo|Multich> (currently Stereo)
vmix0-src <Fast|High|High+|Production|OFF> (currently High+)
vmix0-outvol <monovol> (currently 3.2 dB)
vmix0-invol <monovol> (currently 19.8 dB)
vmix0.pcm2 [<leftvol>:<rightvol>] (currently 25.0:25.0 dB)
vmix0.pcm3 [<leftvol>:<rightvol>] (currently 25.0:25.0 dB)
vmix0.pcm4 [<leftvol>:<rightvol>] (currently 25.0:25.0 dB)
vmix0.pcm5 [<leftvol>:<rightvol>] (currently 25.0:25.0 dB)

igorzwx
Known Member
Posts: 1245
Joined: Sun Jun 28, 2009 9:31 pm

Re: ossrecord - permission denied even as root

Postby igorzwx » Thu Dec 22, 2016 6:30 pm

waterlaz wrote:

Code: Select all

$ ossrecord -i?                                                                                                     
/dev/dsp: Permission denied


All of this with root.


"$" does not mean "root".
The root terminal is usually "#"

Code: Select all

/dev/dsp: Permission denied

This error will occur, if the user does not have permission to use the audio device:

Code: Select all

Error: /dev/dsp: Permission denied

The user is required to be a member of the audio group to use the audio device.
_https://wiki.debian.org/SoundFAQ

waterlaz
Member
Posts: 17
Joined: Wed Aug 27, 2014 4:16 pm
Sound Card: Audigy 2 value
OS: gentoo linux

Re: ossrecord - permission denied even as root

Postby waterlaz » Sat Dec 24, 2016 5:51 pm

This has been done in root. I've just replaced the prompt with $ myself. But ok...

Code: Select all

pidgin tmp # whoami
root

pidgin tmp # ossrecord -i?
/dev/dsp: Permission denied

pidgin tmp # ossmix
Selected mixer 0/High Definition Audio AD1984
Known controls are:
jack.fp-green.mute ON|OFF (currently OFF)
jack.fp-green.headphone [<leftvol>:<rightvol>] (currently 4.4:58.4 dB)
jack.fp-green.headphone-sel <headphone|front> (currently front)
jack.fp-green.headphone-sel-m ON|OFF (currently ON)
jack.fp-green.input-mix-mute ON|OFF (currently OFF)
jack.green.mute ON|OFF (currently OFF)
jack.green.front [<leftvol>:<rightvol>] (currently 58.4:58.4 dB)
jack.green.front-mute ON|OFF (currently OFF)
jack.green.input-mix-mute ON|OFF (currently ON)
jack.int-speaker.mono-mix <monovol> (currently 46.4 dB)
jack.int-speaker.mono-sel <headphone|front> (currently headphone)
jack.int-speaker.mono-sel-mute ON|OFF (currently OFF)
jack.int-speaker.input-mix-mute ON|OFF (currently OFF)
jack.fp-pink [<leftvol>:<rightvol>] (currently 0.0:29.9 dB)
jack.blue [<leftvol>:<rightvol>] (currently 29.9:29.9 dB)
misc.aux-sel-mute ON|OFF (currently ON)
misc.input-mix-mute1 ON|OFF (currently OFF)
misc.aux-mix <aux-sel|input-mix> (currently input-mix)
misc.rec1-sel1 [<leftvol>:<rightvol>] (currently 4.4:4.4 dB)
misc.rec1-sel2 <fp-mic|linein|input-mix> (currently fp-mic)
misc.rec2-sel1 [<leftvol>:<rightvol>] (currently 4.4:71.9 dB)
misc.rec2-sel2 <fp-mic|linein|input-mix> (currently fp-mic)
misc.aux-sel <headphone|front> (currently headphone)
misc.beep <monovol> (currently 44.9 dB)
misc.fp-mic [<leftvol>:<rightvol>] (currently 0.0:46.4 dB)
misc.linein [<leftvol>:<rightvol>] (currently 22.4:0.0 dB)
misc.input-mix1 <fp-mic|linein> (currently fp-mic)
misc.input-mix2 [<leftvol>:<rightvol>] (currently 4.4:0.0 dB)
misc.dock-sel <headphone|front> (currently headphone)
misc.dock-sel-mute ON|OFF (currently OFF)                                                                                                                   
misc.input-mix-mute2 ON|OFF (currently OFF)                                                                                                                 
misc.dock-mix <dock-sel|input-mix> (currently dock-sel)                                                                                                     
vmix0-enable ON|OFF (currently ON)
vmix0-rate <decimal value> (currently 48000) (Read-only)
vmix0-channels <Stereo|Multich> (currently Stereo)
vmix0-src <Fast|High|High+|Production|OFF> (currently High+)
vmix0-outvol <monovol> (currently 20.0 dB)
vmix0-invol <monovol> (currently 19.8 dB)
vmix0.pcm2 [<leftvol>:<rightvol>] (currently 25.0:25.0 dB)
vmix0.pcm3 [<leftvol>:<rightvol>] (currently 25.0:25.0 dB)
vmix0.pcm4 [<leftvol>:<rightvol>] (currently 25.0:25.0 dB)
vmix0.pcm5 [<leftvol>:<rightvol>] (currently 25.0:25.0 dB)

pidgin tmp # ossrecord -d/dev/dsp assdf.wav
/dev/dsp: Permission denied

igorzwx
Known Member
Posts: 1245
Joined: Sun Jun 28, 2009 9:31 pm

Re: ossrecord - permission denied even as root

Postby igorzwx » Mon Dec 26, 2016 5:20 pm

waterlaz wrote:This has been done in root. I've just replaced the prompt with $ myself. But ok...

Code: Select all

pidgin tmp # whoami
root

pidgin tmp # ossrecord -i?
/dev/dsp: Permission denied

pidgin tmp # ossrecord -d/dev/dsp assdf.wav
/dev/dsp: Permission denied


Does your "root" have rw access to it?

Post here the output of these commands:

Code: Select all

$ ls -ld /dev/dsp
$ ls -ld /dev/oss/oss_hdaudio0/pcm0


Code: Select all

$ file /dev/dsp
$ file /dev/oss/oss_hdaudio0/pcm0
$ find /dev/oss -type c


You may also try this:

Code: Select all

$ cat /dev/random > /dev/dsp # plays white noise through the speaker
$ cat /dev/dsp > /dev/dsp # reads data from the microphone and plays them through the speaker


See: _https://en.wikipedia.org/wiki/Open_Sound_System#API

waterlaz
Member
Posts: 17
Joined: Wed Aug 27, 2014 4:16 pm
Sound Card: Audigy 2 value
OS: gentoo linux

Re: ossrecord - permission denied even as root

Postby waterlaz » Thu Dec 29, 2016 2:48 pm

Does your "root" have rw access to it?

You don't need to put parentheses =) It is root and it has read and write access. I'll post the details later.

igorzwx wrote:You may also try this:

Code: Select all

$ cat /dev/random > /dev/dsp # plays white noise through the speaker
$ cat /dev/dsp > /dev/dsp # reads data from the microphone and plays them through the speaker


See: _https://en.wikipedia.org/wiki/Open_Sound_System#API

This was the first thing that I've tried. The first one works as expected, the second one complains about permissions.


PS a simple C program to access /dev/dsp fails on opening the file with "RW" access (I just had this code from my home projects, so tried to run it).

waterlaz
Member
Posts: 17
Joined: Wed Aug 27, 2014 4:16 pm
Sound Card: Audigy 2 value
OS: gentoo linux

Re: ossrecord - permission denied even as root

Postby waterlaz » Thu Dec 29, 2016 8:18 pm

Code: Select all

pidgin tmp # ls -ld /dev/dsp
lrwxrwxrwx 1 root root 26 Dec 29 11:09 /dev/dsp -> /dev/oss/oss_hdaudio0/pcm0

pidgin tmp # ls -ld /dev/oss/oss_hdaudio0/pcm0
crw-rw-rw- 1 root root 247, 3 Dec 29 11:09 /dev/oss/oss_hdaudio0/pcm0

pidgin tmp # file /dev/dsp
/dev/dsp: symbolic link to /dev/oss/oss_hdaudio0/pcm0

pidgin tmp # file /dev/oss/oss_hdaudio0/pcm0
/dev/oss/oss_hdaudio0/pcm0: character special (247/3)

pidgin tmp # find /dev/oss -type c
/dev/oss/oss_hdaudio0/pcm1
/dev/oss/oss_hdaudio0/pcm0
/dev/oss/oss_hdaudio0/mix0

pidgin tmp # cat /dev/dsp > /dev/dsp
cat: /dev/dsp: Permission denied

igorzwx
Known Member
Posts: 1245
Joined: Sun Jun 28, 2009 9:31 pm

Re: ossrecord - permission denied even as root

Postby igorzwx » Thu Dec 29, 2016 9:26 pm

Try something like this ("hdaudio_noskip=7"):
_http://ossnext.trueinstruments.com/forum/viewtopic.php?f=16&t=4446&p=17828#p17828


The same problem with the same HDA codec AD1984
_http://ossnext.trueinstruments.com/forum/viewtopic.php?f=3&t=3887

PROBLEM: "OSS doesn't identify any input device at all on your hdaudio"

Such "input devices" can be found in the output of "ossinfo -v9" command.
For example:

Code: Select all

HD Audio rec mix                  /dev/oss/oss_hdaudio0/pcmin0  (device index 7)


Nodes "/dev/dsp_in" and "/dev/dsp_out" (in ossinfo) should look like this:

Code: Select all

Nodes
  /dev/dsp_in -> /dev/oss/oss_hdaudio0/pcmin0
  /dev/dsp_out -> /dev/oss/oss_hdaudio0/pcm0


So that, you may try this:
1. Set "hdaudio_noskip=7" in /usr/lib/oss/conf/oss_hdaudio.conf and reload OSS4.

2. Compare "ossinfo -v9" before and after "hdaudio_noskip=7".

waterlaz
Member
Posts: 17
Joined: Wed Aug 27, 2014 4:16 pm
Sound Card: Audigy 2 value
OS: gentoo linux

Re: ossrecord - permission denied even as root

Postby waterlaz » Sun Feb 12, 2017 3:50 pm

Well.. now I don't have the permission denied error, but the mic still doesn't work, even though I've tried all the possible settings in the mixer.

igorzwx
Known Member
Posts: 1245
Joined: Sun Jun 28, 2009 9:31 pm

Re: ossrecord - permission denied even as root

Postby igorzwx » Tue Feb 14, 2017 3:07 pm

waterlaz wrote:Well.. now I don't have the permission denied error, but the mic still doesn't work, even though I've tried all the possible settings in the mixer.


Post here the output of this command:

Code: Select all

$ find /dev/oss -type c


Return to “Linux”

Who is online

Users browsing this forum: Google [Bot] and 1 guest