question

ALEXANDER VEPRIK avatar image
ALEXANDER VEPRIK asked

Failed to open file 'mnt/sdcard/test/testVideo.mp4' (Permission denied)

Device: Kindle Fire HDX 7' Hi, I am trying to play audio from the mp4 file (the file is recorded by the pre-installed camera application) via OpenMAX-AL APIs and getting the following error: 11-06 15:07:09.620: I/AwesomePlayer(409): Awsomeplayer is created 11-06 15:07:09.620: D/AwesomePlayer(409): AwesomePlayer::sendDolbyProfile skip on vorbis/raw files 11-06 15:07:09.620: D/AwesomePlayer(409): AwesomePlayer::sendDolbyProfile skip on vorbis/raw files 11-06 15:07:09.620: I/AwesomePlayer(409): setDataSource_l(URL suppressed) 11-06 15:07:09.620: E/(409): Failed to open file 'mnt/sdcard/test/testVideo.mp4'. (Permission denied) 11-06 15:07:09.620: E/libOpenSLES(10200): Error (-2147483648) encountered while prefetching Device: Kindle Fire HDX 7' Hi, I am trying to play audio from the mp4 file (the file is recorded by the pre-installed camera application) via OpenMAX-AL APIs and getting the following error: // audio source XADataLocator_URI loc_uri = {XA_DATALOCATOR_URI, (XAchar *) filepath}; // filepath is the file://mnt/test/testVideo.mp4 XADataFormat_MIME format_mime = {XA_DATAFORMAT_MIME, NULL, XA_CONTAINERTYPE_UNSPECIFIED}; XADataSource audioSrc = {&loc_uri, &format_mime}; // configure audio sink XADataLocator_OutputMix loc_outmix = {XA_DATALOCATOR_OUTPUTMIX, outputMixObject}; XADataSink audioSnk = {&loc_outmix, NULL}; // create audio player const XAInterfaceID ids[2] = {XA_IID_PLAY, XA_IID_PREFETCHSTATUS}; const XAboolean req[2] = {XA_BOOLEAN_TRUE, XA_BOOLEAN_TRUE}; (*engineEngine)->CreateMediaPlayer(engineEngine, &mPlayerObject, &audioSrc, NULL, &audioSnk, NULL, NULL, NULL, (sizeof(ids)/sizeof(XAInterfaceID)), ids, req); (*mPlayerObject)->Realize(mPlayerObject, XA_BOOLEAN_FALSE); (*mPlayerObject)->GetInterface(mPlayerObject, XA_IID_PLAY, &mPlayerPlay); Device: Kindle Fire HDX 7' Hi, I am trying to play audio from the mp4 file (the file is recorded by the pre-installed camera application) via OpenMAX-AL APIs and getting the following error: Device: Kindle Fire HDX 7' Hi, I am trying to play audio from the mp4 file (the file is recorded by the pre-installed camera application) via OpenMAX-AL APIs and getting the following error:
fire tablet
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

ALEXANDER VEPRIK avatar image
ALEXANDER VEPRIK answered
Dear Amazon support guys, Please take a look at this problem and give me soi much needed feedback.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

ALEXANDER VEPRIK avatar image
ALEXANDER VEPRIK answered
Adding additional info in case it might be needed: android.os.Build.MODEL = "KFTHWI" android.os.Build.VERSION.INCREMENTAL = "13.3.0.5_user_305079020"
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Sujoy@Amazon avatar image
Sujoy@Amazon answered
Hi Benderillo, Thank you for writing to us. Sorry for the late response. I have sent you a mail to your registered mail address. Can you please send me the complete sample project on this?
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Pen Name avatar image
Pen Name answered
Could you please reply publicly on the forum to help others with similar issues?
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Sujoy@Amazon avatar image
Sujoy@Amazon answered
Hi Pen, Thank you for posting. Actually, there is limitation in our developer forum for sample source code/project attachment. That's why I communicated to Alex through mail. Any way, he has forwarded me this link https://www.dropbox.com/s/tdjshp0a4hxuq1x/NativePlayer.zip And he wrote to me this: "..attached simple android app that uses only two native methods start/stop implemented inside the ./jni/native-player.cpp file. You will need to use android ndk in order to re-build the libnative-player.so from the source code. This project uses video file that should be located in internal sdcard: /mnt/sdcard/test/testVideo.mp4" My reply went: "I rebuilt the libnative-player.so and tried to run on Kindle HD, HDX and an Android device. In HDX, I got the same error like you. But in other devices I did not see any error reported in logcat by AwesomePlayer, but video is not shown in the screen (only white screen). Is this expected? Below is the logcat for HD and generic android devices: ---------------------------------------------------------------------- 11-18 23:24:58.885: WARN/ASFDummyExtractor(110): ASF parser is not available 11-18 23:24:58.885: INFO/AwesomePlayer(110): Awsomeplayer is created 11-18 23:24:58.885: INFO/AwesomePlayer(110): board file present 11-18 23:24:58.885: INFO/AwesomePlayer(110): cabc present 11-18 23:24:58.885: INFO/AwesomePlayer(110): setCabc file open ! 11-18 23:24:58.885: INFO/AwesomePlayer(110): setCabc ret = -22 11-18 23:24:58.885: INFO/AwesomePlayer(110): cabc present 11-18 23:24:58.885: INFO/AwesomePlayer(110): setCabc file open ! 11-18 23:24:58.885: INFO/AwesomePlayer(110): setCabc ret = -22 11-18 23:24:58.885: DEBUG/dalvikvm(6660): DexOpt: unable to opt direct call 0x0bd6 at 0x27 in Lcom/whitesky/mobile/android/database/DatabaseAccessObject;.getInstanceMockFile 11-18 23:24:58.963: INFO/SampleTable(110): There are reordered frames present. 11-18 23:24:58.963: DEBUG/AwesomePlayer(110): finishSetDataSource_l:: ExtractorType video/mp4 11-18 23:24:58.963: DEBUG/AwesomePlayer(110): AwesomePlayer Not VPX decoder = **video/avc** and video is = 1024X576 11-18 23:24:58.963: INFO/AwesomePlayer(110): AIV system property sys.aiv_playback set to 11-18 23:24:59.369: DEBUG/AwesomePlayer(110): Mime = video/avc 11-18 23:24:59.369: DEBUG/AwesomePlayer(110): Mime = audio/mp4a-latm 11-18 23:24:59.369: DEBUG/AwesomePlayer(110): getTrackAudioVideoProfile audioOrVideo=2 11-18 23:24:59.369: DEBUG/AwesomePlayer(110): Play - AUDIO/VIDEO 11-18 23:24:59.369: INFO/AwesomePlayer(110): cabc present 11-18 23:24:59.369: INFO/AwesomePlayer(110): setCabc file open ! 11-18 23:24:59.369: INFO/AwesomePlayer(110): setCabc ret = 0 11-18 23:24:59.369: INFO/AwesomePlayer(110): sendDolbyProfile in play_l 11-18 23:24:59.369: INFO/AwesomePlayer(110): awsomeplayer_play_l : ForwardUtilService started... 11-18 23:24:59.369: INFO/AwesomePlayer(110): awsomeplayer_play_l got ForwardUtilService 11-18 23:24:59.369: INFO/ForwardUtilService(207): setValue= 2 11-18 23:24:59.369: INFO/ForwardUtilService(207): sound effect value is 1 ------------------------------------------------------- I need to have a working code which runs in HD but not in HDX before producing the issue to the concerned team." So basically I failed to run the video on Kindle HD devices. Could you please share with us what problem you are facing?
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

ALEXANDER VEPRIK avatar image
ALEXANDER VEPRIK answered
In my last email I replied saying the following: start quote: Hi Sujoy, The application I provided plays audio only. It does not create the surface and does not set up video rendering. Therefore, as long as you can hear audio, the code behaves as expected. My original complain was that the audio playback code that works on Kindle HD, doesn't work on HDX. end quote. So, the white screen that you have seen should not be an issue, therefore it should not be a blocker.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Sujoy@Amazon avatar image
Sujoy@Amazon answered
Hi Alex, I am sorry that I have missed you mail. Yes you are correct that the HDX devices failed to play the media ad below the error I got 01-17 04:58:35.161: ERROR/NativePlayer-JNI(17182): All is fine 01-17 04:49:42.701: ERROR/(340): Failed to open file '/storage/emulated/0/test/test.mp4'. (Permission denied) 01-17 04:58:35.161: ERROR/libOpenSLES(17182): Error (-2147483648) encountered while prefetching 01-17 04:58:35.161: ERROR/NativePlayer-JNI(17182): Failed to open media content The audio plays fine in HD. I am forwarding this to the the concerned team. Did you make any progress mean while after you sent me the last mail.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Sujoy@Amazon avatar image
Sujoy@Amazon answered
Hi Alex, The app is failing on Nexus 7 (4.2.2) as well with the same error 01-17 16:33:15.469: E/NativePlayer-JNI(14913): All is fine 01-17 16:33:15.469: I/AwesomePlayer(129): setDataSource_l(URL suppressed) 01-17 16:33:15.469: E/(129): Failed to open file '/storage/emulated/0/test.mp4'. (Permission denied) 01-17 16:33:15.469: E/libOpenSLES(14913): Error (-2147483648) encountered while prefetching 01-17 16:33:15.469: E/NativePlayer-JNI(14913): Failed to open media content As shown in the log, it is a permission issue. It is most likely related to the multi-profiles feature added in Android 4.2 http://stackoverflow.com/questions/16430358/nexus-7-failed-to-open-file-permission-denied The Android NDK come with a "native-media" sample. You could follow it to construct a XADataSource with a buffer instead of a uri, so it doesn't rely on the native player to read the file directly.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.