weixin_39593354
weixin_39593354
2020-12-31 23:45

Swap File on mSD

Hi!! First of all, congrats for such amazing project, it brings a lot of features to our cameras.

Do you think is there any chance to get working an swap file on the mSD?? There's no too much room, neither on ram or storage. The storage can be supplied by the mSD, and the memory using a swap file over there, or a partition.

What do you think?

Regards

Edit : i've tried but it lacks, at least, mkswap and swapon/swapoff commands.

该提问来源于开源项目:roleoroleo/yi-hack-MStar

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

17条回答

  • weixin_39528525 weixin_39528525 4月前

    I think is not a good idea to create a swap space on SD. The SD card is terribly slow and not suggested for this purpose. The frequent write operations can wear out flash cells quickly and destroy the memory. Finally, as you already noted, the compiled busybox doesn't contain the swap programs. And the space available in the root partition is too little to add other components.

    点赞 评论 复制链接分享
  • weixin_39593354 weixin_39593354 4月前

    You are right on the SD comments. But you don't need to use root partition in order to add commands or programs, you can use it from SD. Can you point me to the crosscompiler to try to compile a more complet busybox? It's not only useful just for swap.

    Edit : btw, can you point me to any basic instructions about the camera and the firmware. For example : In the SD there's a records directory where the camera is recording in a directory by hour, one mp4 file by minute with a size of about 11M. This is from camera firm or hack? Is there any way to control/configure it? For example just 1 file for hour, or change the resolution/codec param. Stop it, just record when movement detect, etc ...

    Tia

    Regards

    点赞 评论 复制链接分享
  • weixin_39528525 weixin_39528525 4月前

    Here the cross-compiler: https://dl.openipc.org/SDK/MStar/MStar-MSC3XX-SDK-toolchain.tgz You could use my sources and edit directly the busybox .config to create another busybox binary,

    I can't point you to any instruction but ask me and I will try to answer. For example: the recording procedure is a feature of the original firmware. All the control features (that I know) are exposed in the app and in the configuration web page:

    • Recording without Cloud
    • Save video when a motion is detected
    • Detection sensitivity
    点赞 评论 复制链接分享
  • weixin_39593354 weixin_39593354 4月前

    Thank you very much for the info. I've used the docker environment and i've succesfully compile busybox with swap support... It's just about 200 Bytes bigger. ...now what don't have support is the kernel... :( Compile, and test, the kernel are bigger words!!! Maybe i will try :)

    About the files on /tmp/sd/record : - I cannot control when it must record, or not. I tested with motion detector, without... i cannot trigger the motion detector, or very few times. And with any configuration it records all the time. How do you have it configured and whats the behavior. - Is there any way to make the files longer, not just 1 minute (about 11Mb) - Is there any way to control the quality or codec parameters of the MP4 files

    点赞 评论 复制链接分享
  • weixin_39528525 weixin_39528525 4月前

    Build the kernel is a problem. No sources and no /proc/config...

    I don't know if it's useful but you can send a motion start event using ipc (also stop events). I didn't change the motion behavior, I only replicated the controls you have on the app. I think there is now way to change the file size, video duration or quality (for my knowledge).

    点赞 评论 复制链接分享
  • weixin_39593354 weixin_39593354 4月前

    The sources of the kernel are with the SDK.

    Thank you for the info i will make some test.

    点赞 评论 复制链接分享
  • weixin_39528525 weixin_39528525 4月前

    Yes but the SDK is generic for the platform.

    点赞 评论 复制链接分享
  • weixin_39593354 weixin_39593354 4月前

    I think i could work... If i compile the kernel, could you help me to boot it?

    点赞 评论 复制链接分享
  • weixin_39528525 weixin_39528525 4月前

    Yes, I will investigate the mtd tomorrow.

    点赞 评论 复制链接分享
  • weixin_39593354 weixin_39593354 4月前

    ok, thank you. I'll report on progress.

    点赞 评论 复制链接分享
  • weixin_39528525 weixin_39528525 4月前

    On my cam the kernel is /dev/mtd1 It's a normal uboot format. I suggest you to make a backup of the flash if you can.

    点赞 评论 复制链接分享
  • weixin_39593354 weixin_39593354 4月前

    Looking at a boot log we have :

    
    +++++++++++++++++++   check one.bin    +++++++++++++++++++ 
    ------>setenv filesize 0 
    ------>fatsize mmc 0 one.bin 
        one.bin Not exist(fatsize err) 
    
    +++++++++++++++++++   check one_y25    +++++++++++++++++++ 
    ------>setenv filesize 0 
    ------>fatsize mmc 0 one_y25 
        one_y25 Not exist(fatsize err) 
    
    +++++++++++++++++++   check uboot_y25    +++++++++++++++++++ 
    ------>setenv filesize 0 
    ------>fatsize mmc 0 uboot_y25 
        uboot_y25 Not exist(fatsize err) 
    
    +++++++++++++++++++   check kernel_y25    +++++++++++++++++++ 
    ------>setenv filesize 0 
    ------>fatsize mmc 0 kernel_y25 
        kernel_y25 Not exist(fatsize err) 
    
    +++++++++++++++++++   check sys_y25    +++++++++++++++++++ 
    ------>setenv filesize 0 
    ------>fatsize mmc 0 sys_y25 
        sys_y25 Not exist(fatsize err) 
    
    +++++++++++++++++++   check home_y25    +++++++++++++++++++ 
    ------>setenv filesize 0 
    ------>fatsize mmc 0 home_y25 
        home_y25 Not exist(fatsize err) 
    
    

    Is this the way your firmware install works? If uboot finds these files it will flash? Do you have any boot log from a 9FUS 4.5.0 (y203c)? Do you have any boot log that finds any of these files? to see what it makes with them. Meanwhile i will dig on the uboot srcs.

    Regards

    Edit: i'm thinking in install kernel by this way. If this code flash the kernel, we can always reflash the original kernel again. The other option would be that it would not flash the kernel but simply execute it without flashing ... it could also work ...

    点赞 评论 复制链接分享
  • weixin_39528525 weixin_39528525 4月前

    Yes, this is the way my fw install. At the moment I use only sys and home but you could try kernel also. If uboot is ok you can reflash your original fw (if you have a backup of the kernel).

    点赞 评论 复制链接分享
  • weixin_39593354 weixin_39593354 4月前

    Thank you!!

    I've make a backup of the original kernel with :

    dd of="/tmp/sd/kernel.bin" if=/dev/mtd/mtd1 bs=16k conv=sync

    So i think we have all to test kernel safety. Just we need to compile some of them :) I hope to have enought time tomorrow to try it.

    Regards

    点赞 评论 复制链接分享
  • weixin_39593354 weixin_39593354 4月前

    Just a little update : I have a new Kernel Image. Tomorrow i will make some test.

    点赞 评论 复制链接分享
  • weixin_39593354 weixin_39593354 4月前

    Well... It really flash the kernel just having a file called kernel_y203c on the / of the sd... Now let's see if it can recover a briked cam :) . . . Recovered!!

    I think i will need to open the cam and wire it to PC to see what's going on. But it will have to wait more time...

    点赞 评论 复制链接分享
  • weixin_39528525 weixin_39528525 4月前

    Closed due to inactivity.

    点赞 评论 复制链接分享

相关推荐