Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - dmilligan

#1
Well, hg always annoyed me b/c I use git at work and I am more used to it, but this move by atlassian is pretty sketchy. I'd see this as an opportunity to dump them altogether and moving to another hosting provider. Although as a1ex points out it does suck to loose all that history. Maybe they will relent as google did with nest recently. We should all probably complain loudly, just in hopes of keeping options open.
#3
Scripting Q&A / Re: Semaphore message
May 02, 2018, 01:00:59 AM
The real solution is a proper multithreading implementation in lua. Alas, that remains rather elusive.

It does appear your issue is coming from a menu update callback. It's either too slow, you have too many of them, or your script is busy doing something else when the menu backend calls the update.

It might help to post your script.
#4
Could be better in LV perhaps since mirror is already up? (Too hard to get a DM log from LV with all the extra noise?) Also perhaps FRSP is even more consistent. And of course grabbing every Nth LV frame would be microsecond acurrate.
#5
Scripting Corner / Re: Lua Scripting (lua.mo)
February 04, 2018, 03:53:26 AM
Quoteor did it have some hidden shortcut?
The lua_touch branch. The editor is actually [the most] useful on that branch with an EOSM, there's an on screen touch keyboard.
#6
Scripting Corner / Re: Lua Scripting (lua.mo)
January 31, 2018, 03:41:14 PM
If the Lua garbage collector is anything like other collectors I'm more familiar with, it likely uses some sort of heuristic to decide when to run. The goal being to optimize the trade off between running too often which would hurt performance and not running often enough which would leave unused memory unreclaimed for longer. If that's the case (I don't have any specific experience with the lua garbage collector), the heuristic is probably tuned for systems that have more free memory than we do. If it's a real problem, you could try adjusting it to running more often (IDK how or where to do that), but if it's just something you noticed, but is not causing issues, I would leave it alone.
#7
Upload a crash dump or at the very least the console output
#8
Quote from: aprofiti on December 23, 2017, 02:19:09 AM
Someone can explain to me why can't get it working? I have also tried to merge into lua_fix to get latest fixes, but nothing usefull happened.

Question: Should I include also 1/3 stop values to Fnumbers? Currently if an aperture value of the lens isn't found in Fnumbers when opening Manual Lens submenu, it get set to first index (ex. aperture 4.5 not found -> set by script to 1.0)

[EDIT]
It's a problem of floating points rapresentation in lua:

1.4 -> 1.399999
2.8 -> 2.799999
4.5 -> 4.5 (ok)
5.6 -> 5.59999


Check the ftoa function in ml_lua_shim.c, it could probably be improved (maybe there's a usable implementation in dietlibc that's better). The sprintf in Canon firmware doesn't support floats at all, and we don't have a complete, standards compliant libc implementation available in ML. So for now there are hacky implementations here and there of stuff we need (space in the compiled binary is at a premium).

As a workaround you could store lens.manual_aperture as string and then when you need to use it as a number, convert it to number with tonumber().
#9
Scripting Q&A / Re: Script termination
December 11, 2017, 02:45:36 PM

if test() == false then
    print("exiting...")
    return
end
#10
Have you tried it?

It sounds like what you are actually trying to do is communicate between scripts and somewhat misusing the menu API to accomplish this. This is pretty classic xy problem. When you ask questions, it's much more helpful to state exactly what it is you are actually trying to do. Rather than finding some sort of alternative way to do it and then asking about that. There may be a much better solution to the original problem, or if an API is missing or lacking, we might have a much better idea what new functionality should be provided.
#11
You should already be able to do that (for menus that you create): menu:select

See copy2m.lua for an example:


copy2m_menu = menu.new
{
    parent  = "Copy exposure to M",
    name    = "Enabled",
    help    = "Copy exposure settings (Tv, Av, ISO) when switching to M.",
    choices = {"OFF","ON"},
    value   = "OFF"
}

function copy2m_menu:select(delta)
    if self.value == "OFF" then self.value = "ON" else self.value = "OFF" end
    copy2m_update(self.value)
end
#12
Scripting Q&A / Re: Script state at camera switch off
December 08, 2017, 03:42:35 AM
Doing this is completely unnecessary:

if cfg.data ~= nil then
    cfg = config:load()
    menu.set("Focus Bar","Display",cfg.data.Display)
    menu.set("Focus Bar","Focus Stacking",cfg.data."Focus Stacking")
end


config.create_from_menu does everything (setting up the save, initializing, and reloading menu values on startup). You simply pass your menu to that function and everything just works.

but to answer you question, since it's a general Lua syntax question:

menu.set("Focus Bar", "Focus Stacking", cfg.data["Focus Stacking"])
#13
Why do you need to read the temp on the computer? It would be simple to write a Lua script that did this entirely on camera.

Why do you need to do this at all? Canon firmware itself will automatically shutoff the camera when the temperature reaches dangerous levels. Do you not trust the people who actually designed the Camera that they selected an appropriate temperature at which to shutoff the camera to prevent damage?
#14
You mean the Canon prop handlers? We can't add new Canon properties, Lua simply exposes a way for scrips to register callbacks for existing Canon properties. If there's already a Canon property that fires when the focus distance or focal length changes, you can use those (I believe there are but there may be limitations). If not, a method for doing that will have to be developed in the ML core (possibly requiring some reverse engineering, see the thread about MPU/lens communication) and exposed to Lua (probably as an event).
#15
The Mac finder automatically (and incorrectly) associates files with the .RAW extension with the application Photoshop (not sure if this is by default or only if you have Photoshop installed), and gives them an icon that is a document with the letters "PS" on it. This was one of the reasons I wanted to drop the old .RAW extension completely. It's a very common term that may very likely be associated with the incorrect application by unwitting OS, confusing users who don't know any better than to trust their OS's interpretation of file extensions. The same thing happens with autoexec.bin but that one has to be named that, there's nothing we can do.

OP simply needs to update to a converter that supports the newer and better .MLV format.
#16
Do the actual files still show in the Finder? Can you upload ~/.mlvfs.log?
#17
This is quite an accomplishment. Congratulations!
#18
MLVFS is multithreaded, but not all algorithms can be parallelized (easily or at all). The fix pattern noise algorithm is an experimental algorithm written by a1ex. The implementation as written by a1ex is not easily parallelizable (or maybe not at all, IDK) per frame. However, multiple frames can be processed at a time, but you have to request them. So for example if you ask for one DNG and then wait til it's done to ask for the next one, you will end up waiting. Most programs that access files won't behave like that, b/c it's extremely uncommon for file access to be CPU bound.

If the real problem is that the algorithm is too slow, there are all sorts of optimization avenues to explore, not just multi-threading (vectorization, gpu/hardware acceleration, etc). But you will have to understand and analyze the code and algorithm to do any of this. Any optimization or other improvements to the implementation are welcome contributions.
#19
What options do you have enabled? (some are quite slow)
#20
I found basically an exact copy of that site a while back it just wasn't about ML, something else. They just take a popular search phrase and insert it as the title of that page. It was a different domain, but I found several other domains host the exact same content (with different search terms inserted). Also reported them to google.
#21
Quote from: tonij on August 03, 2017, 07:42:57 AM
Also how is MLVFS able to remove fixed pattern noise when I'm not giving it a suitable darkframe? Should I be providing darkframes if so how?
http://www.magiclantern.fm/forum/index.php?topic=11787.msg158766#msg158766
#22
Could be some caching issue. Might want to make sure you turn the option on very first thing before doing anything else, or even start MLVFS with it on via the command line (MLVFS does some internal caching, but the FUSE library or the OS might also be doing some caching that MLVFS can't do anything about).
#23
There appears to be a typo in the lua API docs. It's keys:start() not keys:keys(). These functions are designed to be used in a main loop. If you just want to detect a single key press, key.last or key.wait() will be easier.
#24
4193737 / 1024 = 4096 KB => 4096 KB / 1024 = 4 MB
#25
General Help Q&A / Re: Reading 14 bit RAW
July 29, 2017, 10:36:17 PM
DNG only has RGB multipliers for white balance (AsShotNeutral). MLVFS has some functions borrowed from ufraw for computing RGB multipliers from Kelvin, and they are not perfect.