0

I've built an Android app that uses tinyalsa through jni. When I call pcm_open, I get:

cannot open device '/dev/snd/pcmC1D0c': Permission denied

Unlike this poster's case, I do see the file in question if I su -c 'ls /dev/snd'. In fact, if I stat this file and the directories above it, all the way up to the root directory, the permissions that stat outputs conform to the permissions that I see on my ordinary linux workstation:

All of the directories are 0755/drwxr-xr-x, and the file itself is 0660/crw-rw----.

Why would Android deny me permission, and what do I need to do about it?

Despite this 755 permission on the directories above my device file, if I adb shell and then ls /dev/snd, I get Permission denied!

Edit: it has been suggested that the resolution to this problem (which, incidentally, is still unresolved) will solve my alsa issue; I don't know if it will or not. My concern is that the source for pcm_open calls open on /dev/snd/pcmC1D1c, and that file does not have any permissions set for a (not o or g) users. Does the use of alsa require that I do something more than link libtinyalsa.so.1 when building my Android app?

Am I mistaken in my linking strategy? In my app's JNI modules, I included pcm.c and pcm.h from the primary tinyalsa repository and then followed standard procedure for opening an audio device with it.

Community
  • 1
  • 1
JellicleCat
  • 28,480
  • 24
  • 109
  • 162
  • why asking the same question again?http://stackoverflow.com/questions/40410190/android-dir-permissions-are-r-x-but-i-still-get-permission-denied – Opiatefuchs Nov 03 '16 at 20:19
  • To me the questions are related, but they are different, and the answer to one question might not answer the other question. Even if I find an answer to the permissions issue on the directories above the device file, it is possible that alsa still be denied permission to access the device file. – JellicleCat Nov 04 '16 at 01:22
  • @Opiatefuchs : clearer explanation is given in the edit above. – JellicleCat Nov 04 '16 at 01:30

0 Answers0