[FIX] [HELIUM] [HYDROGEN] Video Recording Fix

Search This thread

ajsmsg78

Senior Member
Dec 6, 2008
5,319
4,765
Selden, NY
Huawei MediaPad X2
Xiaomi Poco F3
Last edited:

nijel8

Senior Member
Dec 24, 2011
2,423
5,659
All over US
Google Pixel 5a
Thanks for trying. Just reporting... On CM13 third edition hydrogen fix doesn't work.The very first time it recorded video with no sound, then on second attempt it recorded just the first frame and no sound. Reboot doesn't help.
 

ajsmsg78

Senior Member
Dec 6, 2008
5,319
4,765
Selden, NY
Huawei MediaPad X2
Xiaomi Poco F3
Thanks for trying. Just reporting... On CM13 third edition hydrogen fix doesn't work.The very first time it recorded video with no sound, then on second attempt it recorded just the first frame and no sound. Reboot doesn't help.

Try it on Resurrection Remix and let me know if it works on there. I don't have a Hydrogen so I can't test. There are also so many more options in Resurrection Remix that I don't even want to use plain CM13.
 
Last edited:

Survivor1990

Senior Member
Oct 18, 2015
81
12
Tried it right now. RR V2 : Video works but playback seems to be 4x faster than normal. And no Sound.
I really hope you find the problem. It's simple the best phone I eher had.
 

nijel8

Senior Member
Dec 24, 2011
2,423
5,659
All over US
Google Pixel 5a
I have researched/experimented with the video recording bug and I am pretty sure this is the problem.
That is exactly what happens on CM13 based ROMs on Mi Max. I have replicated it by rebooting with usb connected and recording works... dies after usb disconnect and device wakes from deep sleep. I even did dirty remux of brocken recording on my PC and it proved all video frames were there but with incorrect duration.
So looks like we have to wait and hope Xiaomi to fix the device firmware/kernel? part that causes the deep sleep problem on CM(very unlikely) or release source code.
As you probably know the list of all vendor files pulled from miui to build CM is based on the official CM device tree for Note 3 Pro(kenzo) which has very similar hardware... They even pull many of those files for kenzo from Mi Max miui base( android_device_xiaomi_kenzo/proprietary-files.txt). I compared the camera firmwares for both and it is exactly the same bit-by-bit. And yet kenzo CM13 don't have that problem. So it must be some other firmware part or kernel issue.
Also wondering why as far as I know miui doesn't have that problem using same firmware/kernel!? Must be something in the camera app or framework or something...
 
Last edited:
  • Like
Reactions: eseregin and TEKME

cmk7128

Senior Member
Aug 4, 2008
318
69
I have researched/experimented with the video recording bug and I am pretty sure this is the problem.
That is exactly what happens on CM13 based ROMs on Mi Max. I have replicated it by rebooting with usb connected and recording works... dies after usb disconnect and device wakes from deep sleep. I even did dirty remux of brocken recording on my PC and it proved all video frames were there but with incorrect duration.
So looks like we have to wait and hope Xiaomi to fix the device firmware/kernel? part that causes the deep sleep problem on CM(very unlikely) or release source code.
As you probably know the list of all vendor files pulled from miui to build CM is based on the official CM device tree for Note 3 Pro(kenzo) which has very similar hardware... They even pull many of those files for kenzo from Mi Max miui base( android_device_xiaomi_kenzo/proprietary-files.txt). I compared the camera firmwares for both and it is exactly the same bit-by-bit. And yet kenzo CM13 don't have that problem. So it must be some other firmware part or kernel issue.
Also wondering why as far as I know miui doesn't have that problem using same firmware/kernel!? Must be something in the camera app or framework or something...

If I have time I will try to build xposed module to intercept the video and fix the first frame duration as dirty/temporary fix(as explained in the link).

EDIT: Ok... As prove of concept build xposed module for testing. It fixes recorded videos but needs some tuning... The first few audio samples are cut off in the repair process and audio gets out of sync. Have to figure out how to fix that...
Just install the attached apk, enable the module in xposed installer and reboot. That's it. Just record as usual. Works with CM and RR(not tested) build-in Camera apps only(for now...).

Seems to work on CM13 (3rd version) on my Hydrogen but only if the recorded videos are saved in internal storage (the camera apps non responsive if saving to sdcard). Thanks for putting this fix out, really appreciated.
 
  • Like
Reactions: ajsmsg78

nijel8

Senior Member
Dec 24, 2011
2,423
5,659
All over US
Google Pixel 5a
Seems to work on CM13 (3rd version) on my Hydrogen but only if the recorded videos are saved in internal storage (the camera apps non responsive if saving to sdcard). Thanks for putting this fix out, really appreciated.

I should've not called it a fix, it's just a dirty hack... I still can't find a way to sync audio/video properly. That sdcard problem is probably related to much lower write speeds.
 

cmk7128

Senior Member
Aug 4, 2008
318
69
I should've not called it a fix, it's just a dirty hack... I still can't find a way to sync audio/video properly. That sdcard problem is probably related to much lower write speeds.

Thanks for the explanation. Hopefully there will be a permanent fix to the video recording problem in due course. For now, your hack will come in handy.
 

zelipukin

Senior Member
Aug 24, 2009
159
40
Jackson
You may want to look at CPUAwake code. with CPUAwake enabled there is no problem with camera after deep sleep and overnight battery drain is still the same (0-1%). It will be great to make "dirty hack" independent from any app (xposed , cpuawake) as a piece of code (somewhere in boot.img inits?). Thank you. as for "no sound" in my patches/builds(some stock miui audio-related files files) I have no problem with it but in some cameras "mono" should be choosen as an audio source. or it could be only "mono" - never tried them separate.
 
  • Like
Reactions: nijel8

nijel8

Senior Member
Dec 24, 2011
2,423
5,659
All over US
Google Pixel 5a
You may want to look at CPUAwake code. with CPUAwake enabled there is no problem with camera after deep sleep and overnight battery drain is still the same (0-1%). It will be great to make "dirty hack" independent from any app (xposed , cpuawake) as a piece of code (somewhere in boot.img inits?). Thank you. as for "no sound" in my patches/builds(some stock miui audio-related files files) I have no problem with it but in some cameras "mono" should be choosen as an audio source. or it could be only "mono" - never tried them separate.

Yep, my initial test confirms CPUAwake keeps video recording working after device wake up... Thank you for your discovery:good:
I tried a similar idea initiating wakelock before recording but it didn't work...
Is CPUAwake open source? Can't find any code...
 
Last edited:

zelipukin

Senior Member
Aug 24, 2009
159
40
Jackson
I think if we open the hood (UI) there is a single line that tells to the system something like: "system, dont do this !"
somewhere in smalis. cant find it. even worse - dont understand smalis
 

nijel8

Senior Member
Dec 24, 2011
2,423
5,659
All over US
Google Pixel 5a
I think if we open the hood (UI) there is a single line that tells to the system something like: "system, dont do this !"
somewhere in smalis. cant find it. even worse - dont understand smalis

I actually examined CPUAwake code and it uses android native wake lock acquire() call so nothing special there. And it doesn't release the wake lock till disabled. Don't like that... Trying to find better solution... We'll see...
 

nijel8

Senior Member
Dec 24, 2011
2,423
5,659
All over US
Google Pixel 5a
Let me know if this fixes video recording on CM based ROMs...
Add these two lines to /system/build.prop:
Code:
media.camera.ts.monotonic=0
#[STRIKE]persist.camera.HAL3.enabled=true[/STRIKE]
... and do full reboot(not just soft). USB disconnected... Test video recording, if it works leave device with screen off for 5 minutes, test recording again. It should work(fixed:D)...
EDIT: I should've mentioned it will only work if video recording was working for you after fresh reboot but brakes when device wakes up from deep sleep... This means all early CM based ROMs are out... they didn't have any video recording working at all or no sound...

EDIT 2: Second line is not needed. Only first line keeps video recording working after deep sleep...
 
Last edited:

Skalexs

Senior Member
Jul 26, 2015
184
73
Here is a fix for the video recording not working. This fix works on my Stock Global ROM for the Helium. It may work on CM13 based roms but there may be bugs. This works on the 64/128gb Chinese Helium and the 32gb Chinese Hydrogen.

Helium:
https://drive.google.com/file/d/0B5I_q70mNuR4Vk1xOXQyZ3pfUkE/view?usp=sharing

Hydrogen:
https://drive.google.com/file/d/0B5I_q70mNuR4ZmlKOGx6Qjlid1k/view?usp=sharing
Deleted
Found the fix in the rr mods folder
Thanks!
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 9
    Here is a fix for the video recording not working. This fix works on my Stock Global ROM for the Helium. It may work on CM13 based roms but there may be bugs. This works on the 64/128gb Chinese Helium and the 32gb Chinese Hydrogen.

    Helium:
    https://drive.google.com/file/d/0B5I_q70mNuR4Vk1xOXQyZ3pfUkE/view?usp=sharing

    Hydrogen:
    https://drive.google.com/file/d/0B5I_q70mNuR4ZmlKOGx6Qjlid1k/view?usp=sharing
    2
    I have researched/experimented with the video recording bug and I am pretty sure this is the problem.
    That is exactly what happens on CM13 based ROMs on Mi Max. I have replicated it by rebooting with usb connected and recording works... dies after usb disconnect and device wakes from deep sleep. I even did dirty remux of brocken recording on my PC and it proved all video frames were there but with incorrect duration.
    So looks like we have to wait and hope Xiaomi to fix the device firmware/kernel? part that causes the deep sleep problem on CM(very unlikely) or release source code.
    As you probably know the list of all vendor files pulled from miui to build CM is based on the official CM device tree for Note 3 Pro(kenzo) which has very similar hardware... They even pull many of those files for kenzo from Mi Max miui base( android_device_xiaomi_kenzo/proprietary-files.txt). I compared the camera firmwares for both and it is exactly the same bit-by-bit. And yet kenzo CM13 don't have that problem. So it must be some other firmware part or kernel issue.
    Also wondering why as far as I know miui doesn't have that problem using same firmware/kernel!? Must be something in the camera app or framework or something...
    2
    Let me know if this fixes video recording on CM based ROMs...
    Add these two lines to /system/build.prop:
    Code:
    media.camera.ts.monotonic=0
    #[STRIKE]persist.camera.HAL3.enabled=true[/STRIKE]
    ... and do full reboot(not just soft). USB disconnected... Test video recording, if it works leave device with screen off for 5 minutes, test recording again. It should work(fixed:D)...
    EDIT: I should've mentioned it will only work if video recording was working for you after fresh reboot but brakes when device wakes up from deep sleep... This means all early CM based ROMs are out... they didn't have any video recording working at all or no sound...

    EDIT 2: Second line is not needed. Only first line keeps video recording working after deep sleep...
    1
    I have researched/experimented with the video recording bug and I am pretty sure this is the problem.
    That is exactly what happens on CM13 based ROMs on Mi Max. I have replicated it by rebooting with usb connected and recording works... dies after usb disconnect and device wakes from deep sleep. I even did dirty remux of brocken recording on my PC and it proved all video frames were there but with incorrect duration.
    So looks like we have to wait and hope Xiaomi to fix the device firmware/kernel? part that causes the deep sleep problem on CM(very unlikely) or release source code.
    As you probably know the list of all vendor files pulled from miui to build CM is based on the official CM device tree for Note 3 Pro(kenzo) which has very similar hardware... They even pull many of those files for kenzo from Mi Max miui base( android_device_xiaomi_kenzo/proprietary-files.txt). I compared the camera firmwares for both and it is exactly the same bit-by-bit. And yet kenzo CM13 don't have that problem. So it must be some other firmware part or kernel issue.
    Also wondering why as far as I know miui doesn't have that problem using same firmware/kernel!? Must be something in the camera app or framework or something...

    If I have time I will try to build xposed module to intercept the video and fix the first frame duration as dirty/temporary fix(as explained in the link).

    EDIT: Ok... As prove of concept build xposed module for testing. It fixes recorded videos but needs some tuning... The first few audio samples are cut off in the repair process and audio gets out of sync. Have to figure out how to fix that...
    Just install the attached apk, enable the module in xposed installer and reboot. That's it. Just record as usual. Works with CM and RR(not tested) build-in Camera apps only(for now...).

    Seems to work on CM13 (3rd version) on my Hydrogen but only if the recorded videos are saved in internal storage (the camera apps non responsive if saving to sdcard). Thanks for putting this fix out, really appreciated.
    1
    Let's get back on-topic here thanks guys...