Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid Memory issue while executing E04-Live_View.java #32

Open
vidyapiquor opened this issue Jan 11, 2017 · 7 comments
Open

Invalid Memory issue while executing E04-Live_View.java #32

vidyapiquor opened this issue Jan 11, 2017 · 7 comments

Comments

@vidyapiquor
Copy link

vidyapiquor commented Jan 11, 2017

Hi,
I am trying to run the java wrapper for my canon EOS 1300D and it is giving erro of type INVALID MEMORY ACCESS after debug i got the issue in this line "err = CanonUtils.toEdsError( CanonCamera.EDSDK.EdsCreateMemoryStream( new NativeLong( 0 ), streamRef ) );" after this line my code is giving error. please help.

@stefanocapitanio
Copy link

I have an issue similar to vidyapiquor:

(decommented system out) Received new command, processing CanonCamera.OpenSessionCommand

Received new command, processing ShootCommand
Exception in thread "Thread-0" java.lang.Error: Invalid memory access
        at com.sun.jna.Native.invokeInt(Native Method)
        at com.sun.jna.Function.invoke(Function.java:390)
        at com.sun.jna.Function.invoke(Function.java:323)
        at com.sun.jna.Library$Handler.invoke(Library.java:236)
        at com.sun.proxy.$Proxy0.EdsCreateMemoryStream(Unknown Source)
        at edsdk.utils.CanonUtils.getLiveViewImageReference(CanonUtils.java:970)
        at edsdk.utils.CanonUtils.isLiveViewEnabled(CanonUtils.java:935)
        at edsdk.api.commands.ShootCommand.run(ShootCommand.java:125)
        at edsdk.api.CanonCamera.dispatchMessages(CanonCamera.java:161)
        at edsdk.api.CanonCamera.access$000(CanonCamera.java:61)
        at edsdk.api.CanonCamera$1.run(CanonCamera.java:102)

I'm using EDSDKv0308W. Could you help me?

@kritzikratzi
Copy link
Owner

i haven't maintained this library in a long time (around edsdk2.14 or smthg like that). maybe @WolfgangFahl knows what's up with bindings for newer versions of the edsdk... (i see there's some generated code, but it's not used yet by the api.* classes).

@Blackdread
Copy link

That's unfortunate, difficult to see why you get this error.
In any case I am redoing an API (as you were not maintaining anymore) with latest version of EDSDK, I have not finished: https://github.com/Blackdread/canon-sdk-java

I will investigate more on this issue later, but with my camera I have not encountered this error with my live view implementation tests.

@stefanocapitanio
Copy link

i haven't maintained this library in a long time (around edsdk2.14 or smthg like that). maybe @WolfgangFahl knows what's up with bindings for newer versions of the edsdk... (i see there's some generated code, but it's not used yet by the api.* classes).

There are generated classes because the error is happening running a JAR in Windows. Now I'll try to reproduce this error with my MacBook with debug (or configure a development enviroment on a windows machine).

@stefanocapitanio
Copy link

That's unfortunate, difficult to see why you get this error.
In any case I am redoing an API (as you were not maintaining anymore) with latest version of EDSDK, I have not finished: https://github.com/Blackdread/canon-sdk-java

Thank you, I'll try also your new API! ;-)

@stefanocapitanio
Copy link

stefanocapitanio commented Nov 8, 2018

I've forced CanonUtils.isLiveViewEnabled to true (because I don't need to know if is enabled live view, it's always disabled and I know that).
Now I can take photo with E01_Simple code (and I find the photo on my SD card), but with E02_Simpler I've a single photo null, but no errors.

Never printed this:

if ( photo != null ) {
   System.out.println( "Saved photo as: " + photo.getCanonicalPath() );
}

If I try this, I get an empty file IMG_001.jpg:
final File[] photos = camera.shoot( EdsSaveTo.kEdsSaveTo_Host, Integer.MAX_VALUE, new File(System.getProperty("user.home") + File.separator + "Pictures" + File.separator ) );

It's a problem of the EDSDK?

Another thing, I have always this error:

Could not check if mirror lockup enabled: An error occurred while getting kEdsPropID_CFn data (error 7: EDS_ERR_NOT_SUPPORTED - Not Supported)

E01_Simple output:

----------------
allocated@0x15d48338 (4 bytes) (edsdk.bindings.EdSdkLibrary$EdsCameraListRef$ByReference@15d48338): 0
----------------
----------------
allocated@0x15d48338 (4 bytes) (edsdk.bindings.EdSdkLibrary$EdsCameraListRef$ByReference@15d48338): 25016
----------------
native@0x5861b8 (edsdk.bindings.EdSdkLibrary$EdsCameraListRef@5861b8): 281481199266176
Cameras: 1
----------------
allocated@0x15e0fbf8 (4 bytes) (edsdk.bindings.EdSdkLibrary$EdsCameraRef$ByReference@15e0fbf8): 0
----------------
----------------
allocated@0x15e0fbf8 (4 bytes) (edsdk.bindings.EdSdkLibrary$EdsCameraRef$ByReference@15e0fbf8): 25632
----------------
native@0x5b6420 (edsdk.bindings.EdSdkLibrary$EdsCameraRef@5b6420): 281481199288452
Event!!!513.0, null
Event!!!513.0, null
Event!!!516.0, null

Never happened to you? ah, my camera is a EOS 3000D.

Thank you

@Blackdread
Copy link

@stefanocapitanio I have released version 1.0.0 that I consider usable in production, try it and tell me if you get same error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants