I am developing several AudioEffect subclasses that are being compiled into Android 4.0.3 ICS... I am trying to dump raw PCM data to files, but because the AudioEffects run in the context of the mediaserver process it seems there is no file writing permissions available.
fopen("/data/local/tmp/pcm_in.pcm", "w");
is returning a NULL pointer and errno 13 (permission denied).
Any ideas how I can grant mediaserver this permission, or write to a folder I can access? I'm compiling the OS, so anything goes...
More specifically: How are permissions for these native/system services determined? I don't suppose they have a AndroidManifest.xml...
I suspect the problem is that you don't have permissions to create a file at /data/local/tmp
. In fact i'm not even sure that directory exists on Android.
Instead you should either use the private storage for an app or save the files to the SD card. See this for more information: http://developer.android.com/guide/topics/data/data-storage.html
so I'm just looking to grant mediaserver permissions to write anywhere
without root this just isn't possible, sorr - slayton 2012-04-05 23:23
Maybe you can just create a folder with permission.
root@android:/mount -o remount,rw /
root@android:/mkdir test
root@android:/chown media:media test
root@android:/chmod 777 test
Then you can do whatever you want.
z.B.
fopen("/test/pcm_in.pcm", "w");