Comments (6)
ok after a bit more experimentation, this is certainly a pinmux'ing issues
when majestic starts, and I'm assuming it opens gpio ports, the pinmuxing is reset to 0 for the pins, which is wrong (at least for hi3518ev100) for gpio. Per datasheet, these should be set to 1 to use gpio function of these pins.
root@openipc-hi3518ev100:~# #GPIO9_1, GPIO73
root@openipc-hi3518ev100:~# devmem 0x200F00CC
0x00000000
root@openipc-hi3518ev100:~# #GPIO9_4, GPIO76
root@openipc-hi3518ev100:~# devmem 0x200F00D8
0x00000000
root@openipc-hi3518ev100:~# #GPIO9_5, GPIO77
root@openipc-hi3518ev100:~# devmem 0x200F00DC
0x00000000
root@openipc-hi3518ev100:~# #GPIO9_7, GPIO79
root@openipc-hi3518ev100:~# devmem 0x200F00E4
0x00000000
Interestingly, after majestic is started, if I manually set the pinmuxes on these, it works.
root@openipc-hi3518ev100:~# devmem 0x200F00CC 32 0x1
root@openipc-hi3518ev100:~# devmem 0x200F00D8 32 0x1
root@openipc-hi3518ev100:~# devmem 0x200F00DC 32 0x1
root@openipc-hi3518ev100:~# devmem 0x200F00E4 32 0x1
But when majestic is restarted, the pinmuxes are reset to 0 (non-working).
I'm not sure what the convention is for these - if the pinmuxing is supposed to be set as a default on the OS, or if this is something the application (majestic) is supposed to do when opening gpio ports (but I have no idea how majestic is interacting with gpios, e.g. sysfs, devmem, syscalls, etc)
also unfortunately, these hi3518ev100/hi3516cv100 are stuck on a very ancient kernel (3.0.8), so not sure how much this might be related to why this isnt working
from majestic.
also possibly interesting
with majestic running a fresh config with no nightMode pins defined:
ipctool reginfo:
...
muxctrl_reg50 0x200f00c8 0x1 reserved [GPIO9_0]
muxctrl_reg51 0x200f00cc 0x1 reserved [GPIO9_1]
muxctrl_reg52 0x200f00d0 0x1 reserved [GPIO9_2]
muxctrl_reg53 0x200f00d4 0x1 reserved [GPIO9_3]
muxctrl_reg54 0x200f00d8 0x1 reserved [GPIO9_4]
muxctrl_reg55 0x200f00dc 0x1 reserved [GPIO9_5]
muxctrl_reg56 0x200f00e0 0x1 reserved [GPIO9_6]
muxctrl_reg57 0x200f00e4 0x1 reserved [GPIO9_7]
...
after setting majestic settings:
.nightMode.irSensorPin: 77
.nightMode.irCutPin1: 76
.nightMode.irCutPin2: 79
.nightMode.backlightPin: 73
when majestic restarts, output of ipctool reginfo:
muxctrl_reg50 0x200f00c8 0x1 reserved [GPIO9_0]
muxctrl_reg51 0x200f00cc 0x1 reserved [GPIO9_1]
muxctrl_reg52 0x200f00d0 0x1 reserved [GPIO9_2]
muxctrl_reg53 0x200f00d4 0x1 reserved [GPIO9_3]
muxctrl_reg54 0x200f00d8 0 [reserved] GPIO9_4
muxctrl_reg55 0x200f00dc 0x1 reserved [GPIO9_5]
muxctrl_reg56 0x200f00e0 0x1 reserved [GPIO9_6]
muxctrl_reg57 0x200f00e4 0 [reserved] GPIO9_7
it seems that something about the way majestic opens/configures the gpios/regs is causing the pinmux to get reset for the irCutPin1
& irCutPin2
pins
furthermore, enabling nightMode and night mode api, and then calling nightmode on also changes the pinmux registers in this way
muxctrl_reg50 0x200f00c8 0x1 reserved [GPIO9_0]
muxctrl_reg51 0x200f00cc 0 [reserved] GPIO9_1
muxctrl_reg52 0x200f00d0 0x1 reserved [GPIO9_2]
muxctrl_reg53 0x200f00d4 0x1 reserved [GPIO9_3]
muxctrl_reg54 0x200f00d8 0 [reserved] GPIO9_4
muxctrl_reg55 0x200f00dc 0 [reserved] GPIO9_5
muxctrl_reg56 0x200f00e0 0x1 reserved [GPIO9_6]
muxctrl_reg57 0x200f00e4 0 [reserved] GPIO9_7
from majestic.
ok after a bit of exploration into the majestic binary w/ cutter, I can see that there is some function which sets up the pin mux according to some configuration table in the code. (set_mux_reg, mux_gpio, ?).
If I patch the table for my muxctrl register addresses it works.
So I'm sure that this has to do with some hardcoded pinmux table in majestic codebase.
At least for hi3518 it seems like all the GPIO9_0 through GPIO9_7 should certainly have a pinmux value of 1, selecting the alternate "gpio" pin function, rather than the primary "nand flash data pins" function.
from majestic.
Thanks for your research, it looks impressive.
We will try to fix the issue soon and give you the information for testing.
In any case, we are very happy to have you with us.
from majestic.
looks like this has been resolved on recent builds of majestic master branch
from majestic.
Done
from majestic.
Related Issues (20)
- Text format IQ profiles not working HOT 4
- UDP/TCP Socket leaks after majestic config reload HOT 1
- Video bitrate setting stuck to 4096 on first start, loaded correctly after reload config HOT 2
- Non-monotonic DTS in output stream
- Broken audio in NETIP/ONVIF with AAC codec
- Camera reboots by watchdog
- RTSP server fails to start HOT 2
- gk7205v300 + imx335 /usr/sbin/motion.sh not executed HOT 7
- Changing the Severity of logging don't take effect to sending JPEG. HOT 1
- Exposure no more work? HOT 4
- Segfault when streaming from h264 endpoint HOT 2
- RTMP reconnection and timeout settings HOT 2
- Can you add sensor IMX335 to hi3516dv100
- RTSP client connection causes segmentation fault on XM530 HOT 7
- gk7205v300 + imx 355 - image issue "Autoadjust image param scAttrContrField" HOT 1
- Why is the recorded video overwritten? HOT 1
- Incorrect audio codec settings break majestic (no web access to the application) HOT 2
- Sensor resoluiton detection error XM530 and OV9732 HOT 1
- Outgoing streams test for RTMP server HOT 1
- Majestic exits with segmentation fault when motion detection is on. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from majestic.