How to interpret MediaCodec error messages? - android-mediacodec

I am trying to decode audio data encoded in opus using the MediaCodec class in Android. I am getting an exception which I believe has something to do with how the decoder is configured, but I do not know.
Is there any guide, documentation or anything at all on how to interpret error messages from MediaCodec (or the underlying codecs it uses)?
The following is the error message I get:
E/ACodec: [OMX.google.opus.decoder] ERROR(0x80001001)
signalError(omxError 0x80001001, internalError -2147483648)
E/MediaCodec: Codec reported err 0x80001001, actionCode 0, while in state 6

Was struggling with a similar problem related to video encoding and the same, as far as I can tell, undocumented Error 0x80001001.
My Issue was that my specified MediaFormat was missing a non optional configuration key.
There is different requirements for encoders/decoders so check the description on the right.

Related

What exceptions does JSONEncoder.encode throw in Swift?

I was recently using JSONEncoder.encode() (and its counterpart, JSONDecoder.decode()), which is marked in the documentation as throws. Unfortunately, the documentation does not go into detail on when/how/what this method could throw. Does anybody have any insight in this? I'm asking because I am wondering if an error here is common enough to implement a user-facing error handling for this.
thanks
JSONEncoder.encode() throws EncodingError.invalidValue when one of the values you are about to encode is not valid (e.g. Double.infinity if the NonConformingFloatEncodingStrategy is set to the default .throw, since JSON does not natively support infinity as a number).
You can see this in the source, and read more about the error in the EncodingError documentation.

How to view exceptions parameters in standard flash player?

Flash exceptions can provide: code,stacktrace, message and parameters.
I.e. ( from Here: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/runtimeErrors.html)
#2121 Security sandbox violation: %1: %2 cannot access %3. This may be worked around by calling Security.allowDomain.
In standard flash player (Not debug) normally i see just error code.
I can configure: -compiler.verbose-stacktraces=true to see the stacktrace.
Can I somehow get the arguments as well?
(%1, %2, %3)
Property "message" of the Error object will return a text description of the error. The only way to read parameters is to parse a text description.

AS3, Flash: Accessing error messages text in code

I'm working on some flash app. Now, to test customer side of it I can use Flash Player debugger version that will save logs and show error messages. When it's deployed on the customer side - they will have a regular Flash Player version which means I will have no access to error messages if errors will happen. So I would like to equip it with some tool that would capture all of my trace messages in code and errors text. As for trace messages that's fairly simple, I just override the function in my code so it sends a POST request with trace message to a logger server, but how can I get a hold of the error message? Is there a known approach to this or some trick that somebody can suggest?
You can install the debug version of flash as your browser's default (in Chrome, you must disable the built-in player), so if you wanted to test user experience and debug, this would be the ideal solution.
However, to answer your question: there's no method for universally catching all errors, and redirecting them (that I know of). You'd have to encapsulate problem code ahead of time with try...catch statements, and send the property back on catch. For example:
try {
this["foo"]();
} catch (e:Error) {
trace(e);
}
In the debug version, the traced value would be TypeError: Error #1006: value is not a function. And while the standard version will only output TypeError: Error #1006, (a notably less descriptive error), what we're missing is any reference to where the error occured. To get this, we need to use Error.getStackTrace() to see the call stack and the line where the error occurred. In debug, this outputs the following:
TypeError: Error #1006: value is not a function.
at Shell_fla::MainTimeline/init()[C:\Projects\shell.as:91
In the standard client, we get a dissapointing null. In short, you cannot get any valuable info from the client versions.
The best advice I can give is to write around your problem code with your own custom error reports. For example, catch IO errors and trace the file it failed to load, or if you're expecting an object.foo, first try if (object.hasOwnProperty("foo")) { // do something } else { trace("foo not found in " + object.name) }. Code defensively.
Cheers,
I've discovered this post on StackOverflow:
How to catch all exceptions in Flex?
It answers my question, strange that I haven't ran into it while I was googling prior to asking.

Error: Access of undefined property JSON ... but it IS there

I am developing a Flash application (Flash Player 11 as target platform) that uses the AS3 Facebook API, which in turn uses as3corelib JSON functionality. Or at least it should do so.
However, in spite of including the latest version (.93) of the as3corelib.swc, I still get the "Error: Access of undefined property JSON". I also tried including the sources directly, to no avail.
Any ideas what I am doing wrong?
As I said, the *.swc is definitely included. As is the source code (all at the correct path).
Edit:
I have a more specific error message:
Error: Can not resolve a multiname reference unambiguously. JSON (from C:\Coding\FlashDevelop\Tools\flexsdk\frameworks\libs\air\airglobal.swc(JSON, Walker)) and com.adobe.serialization.json:JSON (from C:\flash_test\lib\as3corelib.swc)) are available.
I know that JSON is included in AIR, but I do not target AIR, so why does it try include the airglobal.swc?
Your problem is that Flash Player 11 and onwards has native JSON support, so the JSON class you are including is likely colliding with the one from as3corelib. Hence the ambiguity problem.
Try removing as3corelib entirely and see what happens.
Specify the full path to the class. Example, code:
...
var jsonData:Object = JSON.decode(loader.data);
...
will be
...
var jsonData:Object = com.adobe.serialization.json.JSON.decode(loader.data);
...

How to trace COM objects exceptions?

I have a DLL with some COM objects. Sometimes, this objects crashes and register an error event in the Windows Event Log with lots of hexadecimal informations. I have no clue why this crashes happens.
So, How can I trace those COM objects exceptions?
The first step is to lookup the Fail code's hex value (E.G. E_FAIL 0x80004005). I've had really good luck with posting that value in Google to get a sense of what the error code means.
Then, I just use trial and error to try to isolate the location in code that's failing, and the root cause of the failure.
If you just want a really quick way to find out what the error code means, you could use the "Error Lookup" tool packaged with Visual Studio (details here). Enter the hex value, and it will give you the string describing that error code.
Of course, once you know that, you've still got to figure out why it's happening.
A good way to look up error (hresult) codes is HResult Plus or welt.exe (Windows Error Lookup Tool).
I use logging internally in the COM-classes to see what is going on. Also, once the COM-class is loaded by the executable, you can attach the VS debugger to it and debug the COM code with breakpoints, watches, and all that fun stuff.
COM objects don't throw exceptions. They return HRESULTs, most of which indicate a failure. So if you're looking for the equivalent of an exception stack trace, you're out of luck. You're going to have to walk through the code by hand and figure out what's going on.