23

I'm getting the following error java.lang.RuntimeException: setDataSource failed: status = 0xFFFFFFEA and I'd like to know what this status is. I'm using the function MediaMetaDataRetriever.setDataSource(String filePath)

Andrew Orobator
  • 7,978
  • 3
  • 36
  • 36

7 Answers7

13

I got this error java.lang.RuntimeException: setDataSource failed: status = 0xFFFFFFEA when tried to call void setDataSource(String path) on an empty file. (0 bytes)

You need to be 100% sure that path for the file is not null, not empty, the file itself exists and valid.

Kirill Karmazin
  • 6,256
  • 2
  • 54
  • 42
  • @user25 maybe it's invalid or unrecognizable format? Could you specify which file causes such error? (type, extension, size, maybe upload it somewhere?) – Kirill Karmazin Nov 17 '18 at 17:27
11

I didn't have an empty file or any other of the here mentioned bugs in my code. The files I tried to use were fine. I don't exactly know why, but it worked for me when I simply used another overload of setDataSource.

The ones I used that threw this exception were MediaMetadataRetriever.setDataSource(String) and MediaMetadataRetriever.setDataSource(String, HashMap)

The one that simply worked was MediaMetadataRetriever.setDataSource(Context, URI).

Benjamin Basmaci
  • 2,247
  • 2
  • 25
  • 46
7

It was very well buried but I found the source. Here is a link to the error codes

It's a build from ICS and I'm not sure where it is in the current build.

My error was a not supported error when I used a midi file.

Source:

/*
 * Copyright (C) 2009 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef MEDIA_ERRORS_H_

#define MEDIA_ERRORS_H_

#include <utils/Errors.h>

namespace android {

enum {
    MEDIA_ERROR_BASE        = -1000,

    ERROR_ALREADY_CONNECTED = MEDIA_ERROR_BASE,
    ERROR_NOT_CONNECTED     = MEDIA_ERROR_BASE - 1,
    ERROR_UNKNOWN_HOST      = MEDIA_ERROR_BASE - 2,
    ERROR_CANNOT_CONNECT    = MEDIA_ERROR_BASE - 3,
    ERROR_IO                = MEDIA_ERROR_BASE - 4,
    ERROR_CONNECTION_LOST   = MEDIA_ERROR_BASE - 5,
    ERROR_MALFORMED         = MEDIA_ERROR_BASE - 7,
    ERROR_OUT_OF_RANGE      = MEDIA_ERROR_BASE - 8,
    ERROR_BUFFER_TOO_SMALL  = MEDIA_ERROR_BASE - 9,
    ERROR_UNSUPPORTED       = MEDIA_ERROR_BASE - 10,
    ERROR_END_OF_STREAM     = MEDIA_ERROR_BASE - 11,

    // Not technically an error.
    INFO_FORMAT_CHANGED    = MEDIA_ERROR_BASE - 12,
    INFO_DISCONTINUITY     = MEDIA_ERROR_BASE - 13,

    // The following constant values should be in sync with
    // drm/drm_framework_common.h
    DRM_ERROR_BASE = -2000,

    ERROR_DRM_UNKNOWN                       = DRM_ERROR_BASE,
    ERROR_DRM_NO_LICENSE                    = DRM_ERROR_BASE - 1,
    ERROR_DRM_LICENSE_EXPIRED               = DRM_ERROR_BASE - 2,
    ERROR_DRM_SESSION_NOT_OPENED            = DRM_ERROR_BASE - 3,
    ERROR_DRM_DECRYPT_UNIT_NOT_INITIALIZED  = DRM_ERROR_BASE - 4,
    ERROR_DRM_DECRYPT                       = DRM_ERROR_BASE - 5,
    ERROR_DRM_CANNOT_HANDLE                 = DRM_ERROR_BASE - 6,
    ERROR_DRM_TAMPER_DETECTED               = DRM_ERROR_BASE - 7,

    // Heartbeat Error Codes
    HEARTBEAT_ERROR_BASE = -3000,

    ERROR_HEARTBEAT_AUTHENTICATION_FAILURE                  = HEARTBEAT_ERROR_BASE,
    ERROR_HEARTBEAT_NO_ACTIVE_PURCHASE_AGREEMENT            = HEARTBEAT_ERROR_BASE - 1,
    ERROR_HEARTBEAT_CONCURRENT_PLAYBACK                     = HEARTBEAT_ERROR_BASE - 2,
    ERROR_HEARTBEAT_UNUSUAL_ACTIVITY                        = HEARTBEAT_ERROR_BASE - 3,
    ERROR_HEARTBEAT_STREAMING_UNAVAILABLE                   = HEARTBEAT_ERROR_BASE - 4,
    ERROR_HEARTBEAT_CANNOT_ACTIVATE_RENTAL                  = HEARTBEAT_ERROR_BASE - 5,
    ERROR_HEARTBEAT_TERMINATE_REQUESTED                     = HEARTBEAT_ERROR_BASE - 6,
};

}  // namespace android

#endif  // MEDIA_ERRORS_H_
Andrew Orobator
  • 7,978
  • 3
  • 36
  • 36
3

I got this error: setDataSource failed: status = 0xFFFFFFEA because the file does not exist on my device.

Samuel Thompson
  • 2,429
  • 4
  • 24
  • 34
1

I met this question when I try to use a 0 kb mp3 file,I solved it after I deleted that file.maybe you can catch this exception.

Rickon Gao
  • 116
  • 6
1

Just adding this link to know more about error codes: https://kdave.github.io/errno.h/

By searching for FFEA, it tells that 0xFFFFFFEA is decimal value 22 as @AndrewOrobator said, the error is EINVAL invalid argument.

Mina Wissa
  • 10,923
  • 13
  • 90
  • 158
0

I'm catch this error when my audio file was brocken, it solved when I change file, you can try manually set different sources paths

Warrocker
  • 734
  • 6
  • 12