ottokiksmaler / nx500_nx1_modding Goto Github PK
View Code? Open in Web Editor NEWSamsung NX500 and NX1 Modding
License: GNU Affero General Public License v3.0
Samsung NX500 and NX1 Modding
License: GNU Affero General Public License v3.0
I'd like to keep this one post/contributor only. Please post requests here. active means someone is working on it and, for now, plans to continue working on it. Otherwise there was some time spent on it, but currently there's no active development/effort. Lists are not ordered, no ETA and no result guarantee.
I will receive the burner some time this week - I hope - and am thinking about how to best achieve the subject.
For the time being I feel that having working systemd hibernation/suspend wakeup services would be best because they would be inline with general GNU/Linux philosophy.
BUT systemd says this is should be considered a hack, and we don't want that, do we? :-) and that there are nicer interfaces available.
@ottokiksmaler Would you be able to change keyscan to take advantage of this?
In fact I would propose splitting keyscan in two:
This way we could have (1) a very stable and small program to be integrated in the hibernation image (unlikely to require frequent changes, which is what we want because updating the hibernation image is still going to be comparatively a bit more dangerous), and (2) an easily update-able mod environment on /opt.
I would also suggest we stop supporting sdcard resident mods, and do a wholesale adoption of internal (/opt) mods.
Thoughts?
home/songha.choi/osp/NX500/linux-3.5/arch/arm/mach-drime5/nx500/dev-keys.c
/**
* NX500 LOG KEY Configuration
*/
static struct d5_keys_keycode drime5_log_keycode[] = {
{2, KEY_KP8}, // up
{3, KEY_REFRESH}, // EV
};
/**
* NX500 SDB KEY Configuration
*/
static struct d5_keys_keycode drime5_sdb_keycode[] = {
{2, KEY_KP2}, // DOWN
{3, KEY_KPDOT}, // DEL
};
/home/songha.choi/osp/NX500/linux-3.5/arch/arm/mach-drime5/nx1/dev-d5keys_polled_before_merge.c
/**
* NX500 LOG KEY Configuration
*/
static struct d5_keys_keycode drime5_log_keycode[] = {
{6, KEY_KP2}, // DOWN
{5, KEY_F18}, // AF-ON
};
/**
* NX500 SDB KEY Configuration
*/
static struct d5_keys_keycode drime5_sdb_keycode[] = {
{6, KEY_KP2}, // DOWN
{5, KEY_KPDOT}, // DEL
};
despite the comments it has to be for NX1 because NX500 does not have AF-ON, and it is in an nx1 folder
Hi all,
before to buy the amazing NX500 now discontinued, could you please tell me if it outputs live real time video from the HDMI port?
I need to mount it on a drone for surveying and videos.
Thanks.
Is it possible to enable PTP/MTP mode without using factory mode, but rather via scripts? USB storage mode is pretty dangerous you can damage file system if you unplug usb without safe ejecting..so i think PTP/MTP mode is safer.
TL;DR: IMO excessive use of prefman to load/save settings will decrease camera life.
Experiment: change a setting (any setting) and pull the battery. Result: the setting is not remembered unless a normal power off takes place.
=> Samsung engineers made sure that settings are saved to camera flash only when really needed. this begs the question: why not save every time a setting is changed, which is both easier and safer? IMO the answer is that they wanted to avoid excessive flash wear.
Fact: @ottokiksmaler proved that internal camera flash is very slow.
My conclusion: Samsung used low quality flash (read: slow, maybe with low write cycle count) in the NX line, to keep costs down, and they relied on the fact that there are not going to be many instances when writes take place (on power off only).
BTW, I am not quite sure what the EV_UP EV_DOWN method is supposed to achieve - is it for custom video profiles (just like C1 and C2 dial work for photo?) - if yes, we should probably try to find better ways than imposing camera reboots - I am sure we could build something better with libprefman.
In the meantime, I do not know about you but I will (personally) not use that profile save method for my cameras.
Hello.Thanks for your great work!
Just seen this on a facebook group:
http://www.dpreview.com/forums/post/57446101
Quoting:
Follow this tutorial at your risk and peril. Your warranty is now void.
After some more digging through the firmware and way in advance of my ETA
- Create a text file as follows:
file name: nx_dev.adj
file content: "smart_camera" - NB no carriage return, no nothing except the string (NB excluding quotes). File length should be exactly 12 bytes.
2. Place this file on the root of an SD card and put the card in your camera.
- Power on the camera.
- Make sure camera is on Auto.
- Press, in succession: down [for NX1 press on the wheel around the OK button downwards], OK, up, OK, right, press and keep pressed the exposure compensation button, press and release OK, and finally release the exposure compensation button.
- You should now see the DEV menu.
- The setting referred to in the subject of this post is under SYSTEM PARAMETER, (5) DISABLE MOVIE REC LIMIT.
- Do not forget to delete the nx_dev.adj file from the SD card.
Before I forget:
YOUR WARRANTY IS NOW VOID.
YOUR WARRANTY IS NOW VOID.
YOUR WARRANTY IS NOW VOID.
YOUR WARRANTY IS NOW VOID.
Hi,
We appreciate and thank you for your work on the NX500.
I remade your telnet skript on ST commands and recorded this on SD card NX500 and silent shutter work great :) but touchscreen doesn't work.
Please help what you need to do to operate a touch screen too with the same time.
I wrote this
https://drive.google.com/file/d/0B7Dv1h3r4-u6MXhuQ1JmYnlTdjQ/view
Greetings.
Sorry I am new to Github and am not sure if I am posting this in the right place, but I am using my Samsung NX500 for aerial Photorgraphy and video. I use an hdmi to av converter to take still photos in 4k which works great. But to record video with live preview I can only go up to a 1080p 24fps recording resolution, since that is the resolution it is pushing through the hdmi port. Is there a way to get around this to be able to record in 4k 24fps with a live preview out of only 1080p or lower?
Thanks
If I hold EV, (not double tap but just hold) I go to the mod menu and remains "locked".
Problems with it:
I'm on NX1 + 4.12
@ottokiksmaler, I think I messed up. I did that:
mkswap -c /dev/mmcblk0p9
echo disk > /sys/power/state
pulled battery
When I put the battery back in the led turns on, screen backlight comes on and that is it.
Ideas?
power off button does nothing: turns on camera but does not turn it off.
Hello Otto, sorry again the "issue". you could share to me your email :)
Look i was banned from all websites, asshole moderators and crybabies dont like me much ๐
I was thinking about linux. -this is pure linux. i dont know why you think that camera app is so important.:
My idea:
Copy your created linux app into camera system.
Your app would do this - autostart like camera app (runing like deamon). And could listen to commands via telnet (telnetd should be in system too). This would be app responsible to emergency situations-because you still have access to file system. lets say camera app cant start. This emergency app (if possible) should always try turning on WIFI. and read some files/commands from SD card.
2 app - second app would be mod app. It would live in file system, it listens to some KEY COMBO, when keycombo pressed-it shows itself to user (if possible to go onto camera app).
Idea is simple- it's linux-so use linux stuff :) camera app is just an app. yes it's for firmware flash and so on-but who cares? it's just an app, if you have backup -you can always restore it - u only need access to filesystem, so job here is to have it all the time, - telnet would be best option.
sorry messy message but you get the point, and i see you done some work -did not read it but i think you did something similar.
Cheers.
Otto did you really hoped that SOC is the same i think you should know that long time ago. kernels are not the same. They have different audio chips and so on. But i think you misleading people with your statement "So, for people hoping that NX1 and NX500 have the same CPU/SoC and that NX500 is just software limited - bad news folks - it's not just software."
Ram gives nothing so ram is not important, audio chip, touchscreen, mic in.. too, main question is - is cpu the same. If they put the same sensor-why should they put different cpu? I saw voltages and they use different amount of watts but this is too not important. So... so far no proof that cpu is different :)
First of all I wanted to say thanks to everyone who is making this new features possible. The NX500 is already a great camera and you are helping to make it even better!
However one feature I am missing is a better AEB Mode. On NX500 you are limited to 3 pictures where on the NX1 you can shoot 5 pictures at once. So I wondered if it is possible to enable the AEB mode from NX 1 somehow?
I am sorry if this is the wrong place to ask such a question. I am fairly new to github.
Hi everybody!
I'm trying to use focus stack. I have green dots on the left off the sreen but when I press "EV+AEL" green dots don't desepear and I can't activate focus stack.
Hi, sorry for opening issue i see no way other than thsi to communicate with you. Im Windows guy and suck at linux,
In android we can make full backup of all partitions, is it possible to make backup of NX1 and extract contents so for example we could replace some of apps or settings on top of NX500. I think frame rates, bitrates are somewhere in configs or hardcoded into camera app.
Maybe you could clone NX1 (if you have it) and share somewhere? THANKS.
Small detail. Maybe change the folder name with the hacks from nx500. To a name like: 'NX1 and NX500' . Makes more sense to me.
Great hacks by the way. Awsome people who're making this possible!
I think we need a clearly documented method of auto executing scripts in two ways
active means in active development. Otherwise there was some time spent on it, but no active development/effort. List is not ordered. No ETA and no result guarantee.
Feature requests - collected from dpreview and eoshd or directly on github. NB. These are requests not commitments nor promises and may well be unachievable.
Hi,
I installed focus stack in my NX1. It works fine but when I try to use timer, it doesn't work anymore.
Otto, I have something naughty in mind :-) but before I move on with it, is there a way to check key state - hypothetically, I'd like to be able to do this in a script:
isKeyPressed "OK"
return 0 if yes, 255 if no
It's easier to follow/answer comments using an "open issue", than below the code.
Please post any comments, questions, requests regarding NX-KS here.
@ottokiksmaler
From dpreview.com
Why you waste time on new FW? trying to do the same what is already done? Those who upgraded -its their problems, not yours.
Hi, Sorry for the late reply. Yes, it also does the original function - that's why it's so difficult to do for nx500 - the only button that's supposed to be used pressed down is EV and I can't use that.
May 11, 2016 at 04:59
stf1x
I will test again TBBAF once I have time, I assume I can still start it from a telnet session and have a look at the log files on SD, are they produced also if not in factory mode ?
"there's no way to make it work on nx500"
All the mod functions are currently on key that are not used by samsung, like EV+ something, correct ?
how does keyscan work actually for AF ON ?
(if (bbaf && NXKEY_AFON == (int)ev.code && 1 == ev.value))
does it perform the original function of the button as well (for example C-AF) or is the original function not called at all and only the replacement is executed instead ? (here: execute_script("/usr/bin/st cap capdtm setusr AFMODE 0x70001"))
May 10, 2016 at 20:05
otto k
I tried everything but there's no way to make it work on nx500 :( there just is no button that behaves like af-on.
When an application crashes there is a set of log files made on SD card. You could upload them somewhere.
It is quite possible it behaves better in factory mode, they are very different, but I have no way to test any of it. Sorry. I have an idea I'll try over the weekend and get back to you.
May 6, 2016 at 06:00
stf1x
drime5 login: root
[root@drime5 ~]# opt/home/scripts/keyscan /dev/event0 /dev/event1 /opt/home/scripts/ bbaf
OLD PID: 0
PID: 702
BB-AF ON
704 (process ID) old priority -20, new priority -20
/opt/home/scripts/pokemon: line 106: [: too many arguments
/opt/home/scripts/pokemon: line 106: [: too many arguments
/opt/home/scripts/pokemon: line 106: [: too many arguments
/opt/home/scripts/pokemon: line 106: [: too many arguments
/opt/home/scripts/pokemon: line 106: [: too many arguments
/opt/home/scripts/pokemon: line 106: [: too many arguments
/opt/home/scripts/pokemon: line 106: [: too many arguments
/opt/home/scripts/pokemon: line 106: [: too many arguments
/opt/home/scripts/pokemon: line 106: [: too many arguments
704 (process ID) old priority -20, new priority 19
UserData is set
[ 1: 238.811510] I/CAP_LV (A7 54): [Live] PManager]CLiveviewPerformanceManager init
UserData is set
UserData is set
UserData is set
UserData is set
UserData is set
May 5, 2016 at 21:47
hallo otto, i did some more testing with the BBAF functionality in the new envoronement (1.47 w/o factory mode) by invoking keysscan bbaf via telnet: Sometime it works fine, somtime the camera crashes (reboot).
I can not see a pattern.
Kino has added it to the package now, but I rather test via telnet over the next days, since invoking it via the UI caused me and another test problems, and I were scared that we had bricked the camera. Kino fixed it by making a patch which will kill the keyscan before installing, which solved the issue.
Below is a log of a session on NX1 that crashed.
Could you maybe do:
May 5, 2016 at 21:46
After some time of usage (5 minutes) it kind of mini-crashes or resets (all symbols of the UI disappear for a few seconds, then the camera is back).
Could you add these commands to update symbols/icons on the UI and show the modes you are activating (MF or SAF)?
I think these are commands like the below which I got by looking at the code from focus_stack.c:
run_command("/usr/bin/st app nx capture af-mode manual\n"); // show manual focus mode
Apr 11, 2016 at 21:54
It works :-)
You're a star!
Apr 11, 2016 at 05:54
otto k
I have updated it now, could you test?
Apr 10, 2016 at 21:46
Oops, I have a wrong key code, thank you :) I will make a corrected version tonight (I'm at a picnic right now) and send you a message.
Apr 10, 2016 at 11:43
stf1x
It doesn't work on ny NX1, the "AF ON" button still does behave as before, i.e. focus and lock in SAF and CAF in CAF. When I press the shutter it re-focuses.
Have you linked it to the right button? NX 500 / 1 have "AF button", only NX1 has "AF ON" button.
If I use your debug option I get 188 for the "AF ON" button.
In can't see 188 when I look at keyscan.c code #defines.
How is it suppose to work on the NX500, I can test it there ?
Which action/key is
[root@drime5 scripts]# /mnt/mmc/scripts/keyscan_bbaf /dev/event0 /dev/event1 /mnt/mmc/scripts/ debug
DEBUG ON
Opening inputs /dev/event0 /dev/event1
PRESSED 125 <- shutter half press
RELEASED 125<- shutter half press
PRESSED 188 <- "AF ON" button NX1
RELEASED 188 <- "AF ON" button NX1
PRESSED 125 <- shutter full press
PRESSED 126 <- shutter full press
RELEASED 126
RELEASED 125
Apr 10, 2016 at 11:25
otto k
It should be continously auto focusing while AF is pressed and when you release AF button half press should not refocus, just meter, full pressing should take photo as usual.
Apr 10, 2016 at 07:39
stf1x
By the way I have also an NX500, so could test it there, but again not sure what key to press to activate it and what behaviour to expect back
Apr 10, 2016 at 07:19
Hi,
This is what I did
Apr 10, 2016 at 07:08
sorry, what am I suppose to test ?
what have you implemented and what action shall I test ?
Apr 10, 2016 at 06:35
otto k
Yes, that's it, does it work?
Apr 10, 2016 at 04:58
stf1x
Re: NX500/NX1 - customizing function of keys (stf1x)
Anyway I was able to follow you instructuctions from the last message but not sure what I am suppose to test. Do I need to test a functionality on the camera (NX1) itself ?
I got this:
[root@drime5 ~]# killall keyscan
[root@drime5 ~]# /mnt/mmc/scripts/keyscan_bbaf /dev/event0 /dev/event1 /mnt/mmc/scripts/ bbaf
BB-AF ON
UserData is set
Hi,
I installed focus stack in my NX1. It works fine but when I try to use bluetooth or timer, it doesn't work anymore.
Otto, here's an idea - instead of statically linking to the libraries we want to call functions from, how about loading them dynamically like in the attached file.
There's only a small snag: compiles but when running it gives me
-sh: ./calldyn: No such file or directory
Thoughts?
edit: works if compiled with this:
arm-linux-gnueabihf-gcc -o calldyn calldyn.c --sysroot=../../nx500/mnt/rootfs/ libdl-2.13.so -Wl,-dynamic-linker,/lib/ld-2.13.so
Otto, FYI I opened a gofundme campaign for a NX500. If it succeeds and I can get a burner camera I will do some tests that I do not dare do right now.
I will start with messing with the hibernation image - if I manage to tweak it I we will be able to get rid of the bluetooth mod and your keyscan will be instantly available upon camera resume.
If you have other ideas, let us make a list here.
I was reading instruction how to install it...so i started my camera it ask number..so i enter 35766...and lcd went black and card led started to blink...after 15secs camera turned off. I DID not even entered last digit.
I was carefull so waited 5mins and did what instruction said... as i see mod was not installed, it on every boot ask for magic number. The problem is that i no more see live view, loooks like im with cap on, i can see taken pictures..fuck
EDIT: looks like live view doesnt work because of info file.. so ok now :) Delete this issue, sorry. i shit my pans a bit :DDD
Hi Vasille...just installed your mod... but looks like it doesn't save anything.
I set bitrates, then reboot camera i go to GUI (EV+EV) and i see it shows default values, so i make video and i see that indeed it's default values. Resolution too resets. i set HD and VGA to be 2.5k and now they gone. I only turned off camera.
Also i never get success message don't know does it have to be or not, but when i enter bitrate and press "confirm" it just closes.
@KinoSeed Hi, IIRC you can use
st app disp [lcd|evf|auto]
- control display select
in your scripts for NX1 to switch to back LCD.
Hi,
this is a great overview of what's possible with the high-end NXes, awesome job!
I'm the author of the Hacking the NX300 series and the janitor over at https://github.com/ge0rg/samsung-nx-hacks and I'd really like to merge the efforts.
I don't have much time to maintain the wiki, but I'd gladly give write access to the repository, or cooperate in any other meaningful way. There was some work on the NX300 front, especially reverse-engineering of the remote viewfinder protocol, that could be applicable when writing 3rd party remote-control apps....
Kudos,
ge0rg
@gitVasile @KinoSeed
Currently there are two types of auto run scripts:
In order to not complicate everything even more, I would suggest to separate them by convention by assigning them names in following fashion:
I think calling them "warm_" and "cold_" would give us a clearer layout and prevent confusion, but both work for me.
What do you think?
If/when we get a kamikaze camera I would try patching the zswap partition. Can't be THAT difficult.
which partition is it? - I have dd'd them and have offline copies that I could work with.
hey otto and vasile.
i don't know if anyone already thought about this, but is it possible to detect a recording start / record button press?
if so, one could run a timer for i.e. 74 minutes and then force a recording stop (and possibly start a new recording) so we could avoid having people loose a 74 minute recording because of corrupted file header.
just a quick idea. if it isn't possible, our only chance is to look for a way to fix the files.
How about a bitrate/fps/resolution UI that looks a bit close to the png I included in my v2.0 mod?
In its default state it would show what is the current value for each accessible setting, and clicking on the setting would bring up a menu for the user to input the override value.
Basically there would be a sort of active area for each changeable setting. If not enough space, it might have a screen for bitrates, another with resolutions and another for fps, all looking a bit like the png.
Do you think there would be enough space on the screen for something like that?
I could write a C function that would take as args camera model, target "box" and desired fps/resolution/bitrate, while the interface would do the interface :-) and call it to set the values.
IMO this would look cool and be easy to understand for everyone - I hope.
Thoughts?
Oto, pls what im missing... got camera (nx500). whenever i do sys_param movie size 2560_1440_30p in nx_cs.adj i have veird problem - it looks like lens cap would be ON -i see black. i see onscreen menus but cant see image. Talking about real time preview..
Also there is no greendots and touchscreen doest work.
But if i use other command in adj file-lets say telnetd -all good. WTF?
bitrate addresses look like are being shifted by 0x4f000, however it looks like there is different type of calculations now, and to top it off, it looks like even if you change those, they don't matter anymore (and are loaded in a different way)
changing resolution still works (on new addresses):
VGA to 2.5K
./poker $(pgrep di-camera-app) 0xe441c:5a8ea0e3 0xe4420:0aaca0e3
DC to 2.5K
./poker $(pgrep di-camera-app) 0xe43ec:5a8ea0e3 0xe43f0:0aaca0e3
basically everything but the bitrate updates is good to go
From what I gathered they actually communicate through shared memory and this is how the st command sends orders to the RTOS.
So in a sense st is equivalent to the di-camera-app in the sense that they both control the camera.
Or am I missing something?
Hello. I saw some time ago you made rsync. Can we make mod who whould execute rsync and tell rsync to sync (well only copy) whole sd card to usb HDD attached via OTG cable to nx camera?
This feature would be KILLER feature.
Hello Otto Vasile, sorry stupid topic, but maybe others have the same question as me. Im not upgradig my camera because of afraid of hidden shit samsung may put there.
Now i see Vasile makes his bitrate mod and looks like it's for 1.12 only. SO i guess if you guys upgreded than i can too. But is there ANY advantage of new Fw except from useless android fix.
SO far im not happy with nx500, color grading is just impossible, codec sucks. Minimal corections make many artifacts.
Otto, did you know that the camera, if turned off but without battery being pulled, actually hibernates?
Upon wakeup the memory remains patched - I tested it.
Only if the battery is pulled will the camera do a resume from somewher else (I guess from the zswap)
Can you check too on your camera?
I also looked a bit into /sys/power/bootmode:
it is 3 after a warm boot (no battery pull) and 2 after a cold boot (battery pull)
I think the BT script might be tuned as follows:
The issue is that BT is activated very late during resume process :-(
look at this:
[root@nx500 ~]# cat /usr/bin/hibernation.sh
# !/bin/sh
bootmode="`cat /sys/power/bootmode`"
if [ $bootmode -eq 4 ]; then
echo -e "\nbootshell set to cold-boot... \n"
/bin/touch /tmp/.hib_ready
exit
I wonder whether the bootmode is actually the one that tells the camera from where to resume.
Thoughts?
otto wrote:
:D
I was just experimenting with USB-OTG cable and NX500. telnetd on /opt survives USB-OTG cable plugging in and continues working (SD card is unmounted).
Unfortunatelly there are 3 modes for USB right now (available in /sys/bus/platform/devices/slp_multi/usb_mode/usb0/): f_mass_storage, f_mtp, f_sdb. While it's not impossible to create support, it would mean at least compiling the required kernel modules (should not be hard) and triggering the required mode (completely unknown).
It might be worth the effort (not only mass storage, this could potentially allow for external audio, etc) and I'm willing to examine it in the future.
Last night I was on dpreview and saw this of which I quote:
The NX500 will now read out a larger area of the sensor, which the company says will improve 1080/60p video quality.
I take this means the crop is NOT hardware.
All ye nx500 video crop haters, rejoice!
May sound stupid, but i use stabilizer, and this camera record button is in the ass... is there possibility to make mod so when i press rec button actual recording starts after some delay? :) Now video shakes while im re'hold stabilizer after i pressed rec. i can cut it in post but...maybe mod could be done? :)
I would like to ask if it is possible to modify usb connection.
My objective is to control 'video record button' and 'ok button' remotely via USB connection not via Samsung App using bluetooth.
If any of below is possible, it will help many videographers using a gimbal or a stabilizer.
1 or 2 are not meddling the function of physical shutter button on the NX1 or NX500 so it is great I can still use the buttons whenever I want to take a picture while 3 probably changes the function of the button in the system level.
reference for remote shutter release : http://www.instructables.com/id/Samsung-NX-DSLR-Camera-Trigger-Cable/
Thank you very much for reading this.
ls -l /opt/etc/.debugmode
-rw-r--r-- 1 root root 27 Apr 30 2015 /opt/etc/.debugmode
Wondering what would be the result of renaming this file and testing video recording - might bring some performance improvements.
Hi Otto!
Thanks for great work! Is is possible to acctivate focus peaking in "manual focus" with not Samsung lens? For instance, I have a Minolta lens with NX adaptator and I need to activate focus peaking.
Thanks a lot!
Pascal (France)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.