SexScripts : getImage() causing hang on new Mac OS - https://ss.deviatenow.com:443/viewtopic.php?f=6&t=779 Page 2 of 3

Re: getImage() causing hang on new Mac OS

doti [ Mon Jul 30, 2018 3:05 pm ]

The function getFile has a mandatory argument with the message (String), can you check if it works with something like this ?
Code:
def test = null
test = getFile("File ?")
sendImage(test)


The corresponding code (use of JFileChooser) is mostly identical to the one that allow you to choose a script (open, save), there's no problem with those windows (in the main frame and the editor frame) ?

Re: getImage() causing hang on new Mac OS

ptdw [ Tue Jul 31, 2018 2:07 am ]

doti wrote:
The function getFile has a mandatory argument with the message (String), can you check if it works with something like this ?


Hi doti, even with the message argument, the result is the same. I ran it again with your example, and the script hangs. It's almost like the dialog is blocked or rendered invisibly, so the only option is to force quit. It's been like this for as long as I can remember, and is really noticeable in scripts like courtroom. Maybe it's an OS X security thing?

Re: getImage() causing hang on new Mac OS

ptdw [ Tue Sep 25, 2018 3:21 am ]

@lifeinplymouth, did you ever find a work-around to this? I've got my finger on the upgrade button to Mojave, but would hate to lose the ability to develop for/use sexscripts. Hopefully there's a way forward...

Re: getImage() causing hang on new Mac OS

doti [ Sat Sep 29, 2018 3:05 pm ]

I could test and see some Freeze on Mac Os Sierra + Java 8.

Today's update of SexScripts may resolve the problems.

Nothig about the webcam (couldn't test), still desactivated through application.webcam.index=-1

Re: getImage() causing hang on new Mac OS

ptdw [ Sun Sep 30, 2018 6:32 am ]

doti wrote:
I could test and see some Freeze on Mac Os Sierra + Java 8.

Today's update of SexScripts may resolve the problems.

Nothig about the webcam (couldn't test), still desactivated through application.webcam.index=-1


Hi @doti, I'd be happy to test, but am afraid of losing the webcam ability after upgrading. Can I just turn on application.webcam.index, or do you know that it will fail?

Re: getImage() causing hang on new Mac OS

doti [ Sun Sep 30, 2018 9:45 am ]

I don't know if the webcam will work. application.webcam.index=-1 is only usefull to avoid webcam hanging, but it only ignores it (replacing it by getFile())

Re: getImage() causing hang on new Mac OS

ptdw [ Tue Oct 02, 2018 4:05 pm ]

I'll try it once I have a backup method of using a webcam through another computer. Unless anyone can report that Mojave already works for them...

Re: getImage() causing hang on new Mac OS

ptdw [ Wed Oct 31, 2018 2:18 pm ]

Hi @doti, I've been afraid to upgrade my Mac after the issues @lifeinplymouth reported. However, I couldn't wait any longer and finally upgraded to 10.14.1 today. At the same time, I also upgraded to Java 8 build 191.

Unfortunately, I have the exact same error message as he did, and I no longer can use/develop webcam features in SexScripts. I tried with both the internal webcam, and an external USB webcam with the same results.

A bit of good news is that after a few minutes I am prompted to upload a picture, and that part seems to be working now. I'd be happy to help debug this. Let me know if there's anything you need me to try. Here is my error log:

Code:
[Thread-3] INFO com.github.sarxos.webcam.Webcam - WebcamDefaultDriver capture driver will be used
[atomic-processor-1] INFO com.github.sarxos.webcam.ds.cgt.WebcamOpenTask - Opening webcam HD Webcam C615 0x14200000046d082c
[frames-refresher-[0x14200000046d082c]] ERROR com.github.sarxos.webcam.ds.buildin.WebcamDefaultDevice - Timeout when requesting image!
[atomic-processor-1] WARN com.github.sarxos.webcam.ds.buildin.WebcamDefaultDevice - Null array pointer found instead of image
[atomic-processor-1] ERROR com.github.sarxos.webcam.ds.buildin.WebcamDefaultDevice - Images bytes buffer is null!
[frames-refresher-[0x14200000046d082c]] ERROR com.github.sarxos.webcam.ds.buildin.WebcamDefaultDevice - Timeout when requesting image!
[frames-refresher-[0x14200000046d082c]] ERROR com.github.sarxos.webcam.ds.buildin.WebcamDefaultDevice - Timeout when requesting image!
[frames-refresher-[0x14200000046d082c]] ERROR com.github.sarxos.webcam.ds.buildin.WebcamDefaultDevice - Timeout when requesting image!
[frames-refresher-[0x14200000046d082c]] ERROR com.github.sarxos.webcam.ds.buildin.WebcamDefaultDevice - Timeout when requesting image!
[frames-refresher-[0x14200000046d082c]] ERROR com.github.sarxos.webcam.ds.buildin.WebcamDefaultDevice - Timeout when requesting image!
[frames-refresher-[0x14200000046d082c]] ERROR com.github.sarxos.webcam.ds.buildin.WebcamDefaultDevice - Timeout when requesting image!
[frames-refresher-[0x14200000046d082c]] ERROR com.github.sarxos.webcam.ds.buildin.WebcamDefaultDevice - Timeout when requesting image!
[atomic-processor-1] INFO com.github.sarxos.webcam.ds.cgt.WebcamCloseTask - Closing HD Webcam C615 0x14200000046d082c


One thing new to the latest OS is that it has much higher privacy protections, and apps must get permission to use the camera. Maybe that's related? Though the OS seems to automatically prompt for that with other apps. Anyway, let me know if you have any idea.

Re: getImage() causing hang on new Mac OS

doti [ Thu Nov 01, 2018 11:41 am ]

I'll try to post a test program in a few days, probably is is related to the permission system.

Re: getImage() causing hang on new Mac OS

ptdw [ Thu Nov 01, 2018 1:25 pm ]

Thanks @doti! I also tried the nightly build of sarxos.webcam, but it seems I need to update the jar, and I don't have the JDE installed at the moment.

One other note: older Mac apps that are definitely not updated for Mojave still seem to work with the webcam. The system just asks first before allowing access. So I'd be surprised if you had to code any kind of permission request.

It's also completely possible that there's a Java setting that needs to be configured, as I don't see anyone else outside of SexScripts complaining about Mojave and sarxos.

Let me know if/when you need something tested.

Re: getImage() causing hang on new Mac OS

ptdw [ Sat Nov 03, 2018 2:05 pm ]

Good News! After many hours of testing and debugging today, I finally got SexScripts working on macOS Mojave! At the same time, I found that getFile() is still problematic. Here's some details of what I found.

The webcam error, as I suspected, was a security precaution. It seems that something is blocking the "Jar Launcher" application from prompting for webcam permission. Here's the exact error I found in the system logs:

Code:
Policy disallows prompt for RESP:{ID: com.apple.JarLauncher, PID[20268], auid: 501, euid: 501, responsible path: '/System/Library/CoreServices/Jar Launcher.app/Contents/MacOS/Jar Launcher', binary path: '/System/Library/CoreServices/Jar Launcher.app/Contents/MacOS/Jar Launcher'}, ACC:{ID: net.java.openjdk.cmd, PID[20269], auid: 501, euid: 501, binary path: '/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java'}, REQ:{ID: com.apple.tccd, PID[252], auid: 0, euid: 0, binary path: '/System/Library/PrivateFrameworks/TCC.framework/Versions/A/Resources/tccd'}; access to kTCCServiceCamera denied


There are two work-arounds, but both are basically the same thing: run SexScripts from the command line in terminal, or create an Automator program, so that you can just double click on an icon as usual.

Here's the terminal command:

Code:
java -jar sexscripts.jar


For automator (which is what I'm using) add a "Run Shell Script" action with the following code:

Code:
cd sexscripts
java -jar sexscripts.jar


(You'll want to include the full path to the sexscripts home directory.)

The first time you run a script that uses the webcam, you'll be prompted to allow access. After that, everything works as before. Whew!

However, in the process of researching all this, I also found that getFile() doesn't work reliably. Nor can I find any error messages or logs related to what's happening--it just stops. In previous versions of macOS, getFile() didn't work at all. It still doesn't really work if the webcam is missing. However, if you explicitly call it, it works the first time. After that, it's hit or miss.

It *seems* to be more reliable if you wait a while between calls. However, adding waits and buttons didn't really seem to have an effect. Perhaps the wait needs to be longer, or perhaps I just got lucky a few times, who knows.

It would be nice to have getFile() working in the even a webcam isn't available, and also for scripts like Courtroom that require the occasional file upload.

Anyway, if there are other Mac users waiting to upgrade, it looks like SexScripts is usable with a webcam again now.

Re: getImage() causing hang on new Mac OS

doti [ Sun Nov 04, 2018 2:42 pm ]

Webcam :
Does it works if you rename "sexcripts.sh" to "sexscripts.command" and make it runnable ? Mainly, I'd like to provide a launcher like sexcripts.sh but for MacOS (and if possible, inside, avoiding having a line "cd xxxx" thats depends on the user.

getFile()
Was it the same thing on previous MacOS versions ? (the last update, SexScripts 1.28.3, was released to correct this problem)

Re: getImage() causing hang on new Mac OS

ptdw [ Mon Nov 05, 2018 12:59 pm ]

doti wrote:
Webcam :
Does it works if you rename "sexcripts.sh" to "sexscripts.command" and make it runnable ? Mainly, I'd like to provide a launcher like sexcripts.sh but for MacOS (and if possible, inside, avoiding having a line "cd xxxx" thats depends on the user.


No, command doesn't work. I would think an Automator program would be the easiest way. I can make a universal one for you if needed.

doti wrote:
getFile()
Was it the same thing on previous MacOS versions ? (the last update, SexScripts 1.28.3, was released to correct this problem)

It's definitely better than before, but still fails fairly regularly. I spent quite a bit of time trying to figure out if delays, user input, etc could stabilize it, but no luck. Also no error messages as a direct result of the problem. There were some String/URI messages early on, but I tried casting and overloading in every possible combination with no luck...

Re: getImage() causing hang on new Mac OS

doti [ Mon Nov 05, 2018 1:08 pm ]

ptdw wrote:
doti wrote:
Webcam :
Does it works if you rename "sexcripts.sh" to "sexscripts.command" and make it runnable ? Mainly, I'd like to provide a launcher like sexcripts.sh but for MacOS (and if possible, inside, avoiding having a line "cd xxxx" thats depends on the user.


No, command doesn't work. I would think an Automator program would be the easiest way. I can make a universal one for you if needed.


Well it would be great, I must say I don't really understand how Automator works, if it can save an automation task as an universal distributable file.

Re: getImage() causing hang on new Mac OS

joko [ Sun Mar 24, 2019 10:58 am ]

My cam wont work on my Mac... Anyone have a autroator file or a solution?

Page 2 of 3 All times are UTC + 1 hour [ DST ]
https://ss.deviatenow.com:443/
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Maroon Fusion theme created by Oxydo
Software, theme modifications, phpBB modification by Doti 2010, 2011