500d development - page 147 - DSLR Hack development - CHDK Forum

500d development

  • 2487 Replies
  • 901244 Views
*

Offline a1ex

  • *****
  • 671
  • ML dev
Re: 500d development
« Reply #1460 on: 28 / June / 2011, 03:21:36 »
Advertisements
I've fixed a bug that caused the remote audio triggering to go off on the sound of the shutter when using the camera self timer. I'm not sure if I had to fix it in the audio trigger code, or to make remote_shot() do the appropriate waiting so it's "fixed" for all code (still haven't looked at the code deeply enough to know everything that depends on remote_shot()).

The bug is more complex, and I think the right fix is to make remote_shot wait until a picture is taken, even if the self-timer is active. I'll look into it.

Quote
There is also another bug, I think -- patched here: https://bitbucket.org/roaldfre/magic-lantern-for-500d/changeset/28208abed6d1
Nope, that's a feature :)

Quote
This would allow the 550D and 500D branch to use pretty much the exact same code, but with the appropriate header files differing in their values.

I'm actually thinking to borrow CHDK's approach of splitting camera-specific code (in platform directory), and be able to compile ML for all cameras from a single source tree.

In zebra.c, the code is written with the assumption that LiveView image buffer has the same size as BMP overlay buffer (in 550D, 720x480). This simplifies the code a bit (as there's no scaling to be done), but causes HDMI issues (where the buffer sizes vary a lot). But since we can force HDMI resolution back to SD (i.e. 720x480), I think we can still assume 1:1 scaling.

Also, I think it's worth trying to convert the code back to plain array addressing (instead of pointers); maybe the latest gcc (4.6.0) is able to optimize these loops.

Re: 500d development
« Reply #1461 on: 28 / June / 2011, 15:32:06 »
Theres a new T1i Firmware, just released, seems like nothing new...
"
Firmware Version 1.1.1 incorporates the following fixes.

    Fixes incorrect indications in the Arabic and Portuguese menu screens."

I wonder if anything else is added (doubt it), anyone wanna check it out?

*

Offline Coutts

  • *****
  • 538
  • www.flickr.com/couttsphotog
    • Flickr
Re: 500d development
« Reply #1462 on: 28 / June / 2011, 22:44:30 »
I think I have the mvr_config struct in dryos.h fixed up, I've spent about 10 hours on it now. Ours is pretty different from the 550d, i hope this works.

500d:
Code: [Select]
struct mvr_config
{
uint16_t debug_flag; // 0x00, 85f4, 1 = write debugmsg's
uint16_t qscale_mode; // 0x02, 85f6, 1 = QScale, 0 = CBR
uint16_t db_filter_a; // 0x04, 85f8, no effect
uint16_t db_filter_b; // 0x06, 85fa, no effect
int16_t def_q_scale; // 0x08, 85fc, works when qscale_mode = 1
int16_t qscale_limit_L; // 0x10, 85fe
int16_t qscale_limit_H; // 0x12, 8600
uint16_t time_const; // 0x14, 8602, unknown
uint32_t fullhd_20fps_opt_size_I;// 0x16, 8604, works when qscale_mode = 0
uint32_t fullhd_20fps_opt_size_P;// 0x1a, 8608
uint32_t D1_20fps; // 0x1e, 860c
uint32_t D2_20fps; // 0x1c, 8610
uint32_t x8610_unknown; // 0x20, 8614
uint32_t hd_30fps_opt_size_I; // 0x24, 8618
uint32_t hd_30fps_opt_size_P; // 0x28, 861c
uint32_t x861c_unknown; // 0x30, 8624
uint32_t x8624_unknown; // 0x34, 8628
uint32_t vga_30fps_opt_size_I; // 0x38, 862c
uint32_t vga_30fps_opt_size_P; // 0x3c, 8630
uint32_t vga_30fps_D1; // 0x40, 8634
uint32_t vga_30fps_D2; // 0x44, 8638
int32_t IniQScale; // 0x4c, 8640
int32_t actual_qscale_maybe; // 0x50, 8644
uint32_t IOptSize; // 0x54, 8648
uint32_t POptSize; // 0x58, 864c
uint32_t IOptSize2; // 0x5c, 8650
uint32_t POptSize2; // 0x60, 8654
uint32_t GopSize; // 0x64, 8658
uint32_t B_zone_NowIndex; // 0x68, 865c
uint32_t gop_opt_array_ptr; // 0x6c, 8660
uint32_t _D1; // 0x70, 8664
uint32_t _D2; // 0x74, 8668
uint32_t x8668_unknown; // 0x78, 866c -- 1080p = 0x9, 720p/480p = 0xE
uint32_t fullhd_20fps_gop_opt_0; // 0x7c, 8670
uint32_t fullhd_20fps_gop_opt_1; // 0x80, 8674
uint32_t fullhd_20fps_gop_opt_2; // 0x84, 8678
uint32_t hd_30fps_gop_opt_0; // 0x88, 867c
uint32_t hd_30fps_gop_opt_1; // 0x8c, 8680
uint32_t hd_30fps_gop_opt_2; // 0x90, 8684
uint32_t vga_30fps_gop_opt_0; // 0x94, 8688
uint32_t vga_30fps_gop_opt_1; // 0x98, 868c
uint32_t vga_30fps_gop_opt_2; // 0x9c, 8690
} __attribute__((aligned,packed));

550d:
Code: [Select]
struct mvr_config
{
uint16_t debug_flag; // 0x00, 67bc, 1 = write debugmsg's
uint16_t qscale_mode; // 0x02, 67be, 1 = QScale, 0 = CBR
uint16_t db_filter_a; // 0x04, 67c0, no effect
uint16_t db_filter_b; // 0x06, 67c2, no effect
int16_t def_q_scale; // 0x08, 67c4, works when qscale_mode = 1
int16_t qscale_related_1; // 0x0a, 67c6
int16_t qscale_related_2; // 0x0c, 67c8
int16_t qscale_related_3; // 0x0e, 67ca
int16_t qscale_limit_L; // 0x10, 67cc
int16_t qscale_limit_H; // 0x12, 67ce
uint16_t time_const; // 0x14, 67d0, unknown
uint16_t x67d0; // 0x16, 67d2
uint32_t fullhd_30fps_opt_size_I;// 0x18, 67d4, works when qscale_mode = 0
uint32_t fullhd_30fps_opt_size_P;// 0x1c, 67d8
uint32_t D1_30fps; // 0x20, 67dc
uint32_t D2_30fps; // 0x24, 67e0
uint32_t x67e4; // 0x28, 67e4
uint32_t fullhd_25fps_opt_size_I;// 0x2c, 67e8
uint32_t fullhd_25fps_opt_size_P;// 0x30, 67ec
uint32_t fullhd_25fps_D1; // 0x34, 67f0
uint32_t fullhd_25fps_D2; // 0x38, 67f4
uint32_t x67f8; // 0x3c, 67f8
uint32_t fullhd_24fps_opt_size_I;// 0x40, 67fc
uint32_t fullhd_24fps_opt_size_P;// 0x44, 6800
uint32_t fullhd_24fps_D1; // 0x48, 6804
uint32_t fullhd_24fps_D2; // 0x4c, 6808
uint32_t x680c; // 0x50, 680c
uint32_t hd_60fps_opt_size_I; // 0x54, 6810
uint32_t hd_60fps_opt_size_P; // 0x58, 6814
uint32_t hd_60fps_D1; // 0x5c, 6818
uint32_t hd_60fps_D2; // 0x60, 681c
uint32_t x6820; // 0x64, 6820
uint32_t hd_50fps_opt_size_I; // 0x68, 6824
uint32_t hd_50fps_opt_size_P; // 0x6c, 6828
uint32_t hd_50fps_D1; // 0x70, 682c
uint32_t hd_50fps_D2; // 0x74, 6830
uint32_t x6834_kinda_counter; // 0x78, 6834
uint32_t vga_60fps_opt_size_I; // 0x7c, 6838
uint32_t vga_60fps_opt_size_P; // 0x80, 683c
uint32_t vga_60fps_D1; // 0x84, 6840
uint32_t vga_60fps_D2; // 0x88, 6844
uint32_t x6848; // 0x8c, 6848
uint32_t vga_50fps_opt_size_I; // 0x90, 684c
uint32_t vga_50fps_opt_size_P; // 0x94, 6850
uint32_t vga_50fps_D1; // 0x98, 6854
uint32_t vga_50fps_D2; // 0x9c, 6858
uint32_t x685c; // 0xa0, 685c
int32_t another_def_q_scale; // 0xa4, 6860
int32_t IniQScale; // 0xa8, 6864
int32_t actual_qscale_maybe; // 0xac, 6868
uint32_t IOptSize; // 0xb0, 686c
uint32_t POptSize; // 0xb4, 6870
uint32_t IOptSize2; // 0xb8, 6874
uint32_t POptSize2; // 0xbc, 6878
uint32_t GopSize; // 0xc0, 687c
uint32_t B_zone_NowIndex; // 0xc4, 6880
uint32_t gop_opt_array_ptr; // 0xc8, 6884
uint32_t _D1; // 0xcc, 6888
uint32_t _D2; // 0xd0, 688c
uint32_t x6890_counter_maybe; // 0xd4, 6890
uint32_t fullhd_30fps_gop_opt_0; // 0xd8, 6894
uint32_t fullhd_30fps_gop_opt_1; // 0xdc, 6898
uint32_t fullhd_30fps_gop_opt_2; // 0xe0, 689c
uint32_t fullhd_30fps_gop_opt_3; // 0xe4, 68a0
uint32_t fullhd_30fps_gop_opt_4; // 0xe8, 68a4
uint32_t fullhd_25fps_gop_opt_0; // 0xec, 68a8
uint32_t fullhd_25fps_gop_opt_1; // 0xf0, 68ac
uint32_t fullhd_25fps_gop_opt_2; // 0xf4, 68b0
uint32_t fullhd_25fps_gop_opt_3; // 0xf8, 68b4
uint32_t fullhd_25fps_gop_opt_4; // 0xfc, 68b8
uint32_t fullhd_24fps_gop_opt_0; // 0x100, 68bc
uint32_t fullhd_24fps_gop_opt_1; // 0x104, 68c0
uint32_t fullhd_24fps_gop_opt_2; // 0x108, 68c4
uint32_t fullhd_24fps_gop_opt_3; // 0x10c, 68c8
uint32_t fullhd_24fps_gop_opt_4; // 0x110, 68cc
uint32_t hd_60fps_gop_opt_0; // 0x114, 68d0
uint32_t hd_60fps_gop_opt_1; // 0x118, 68d4
uint32_t hd_60fps_gop_opt_2; // 0x11c, 68d8
uint32_t hd_60fps_gop_opt_3; // 0x120, 68dc
uint32_t hd_60fps_gop_opt_4; // 0x124, 68e0
uint32_t hd_50fps_gop_opt_0; // 0x128, 68e4
uint32_t hd_50fps_gop_opt_1; // 0x12c, 68e8
uint32_t hd_50fps_gop_opt_2; // 0x130, 68ec
uint32_t hd_50fps_gop_opt_3; // 0x134, 68f0
uint32_t hd_50fps_gop_opt_4; // 0x138, 68f4
uint32_t vga_60fps_gop_opt_0; // 0x13c, 68f8
uint32_t vga_60fps_gop_opt_1; // 0x140, 68fc
uint32_t vga_60fps_gop_opt_2; // 0x144, 6900
uint32_t vga_60fps_gop_opt_3; // 0x148, 6904
uint32_t vga_60fps_gop_opt_4; // 0x14c, 6908
uint32_t vga_50fps_gop_opt_0; // 0x150, 690c
uint32_t vga_50fps_gop_opt_1; // 0x154, 6910
uint32_t vga_50fps_gop_opt_2; // 0x158, 6914
uint32_t vga_50fps_gop_opt_3; // 0x15c, 6918
uint32_t vga_50fps_gop_opt_4; // 0x160, 691c
} __attribute__((aligned,packed));


edit:
it works!! i think. I can use qscale and cbr now, but for some reason opt0 is 0, so "opt_set: err!" is displayed on the screen. 3x cbr buffered out after 9 seconds (class 6 card) but the bitrate of the video was 53mbps (not much happening in it, seems to be working). My repository is updated here:
https://bitbucket.org/coutts/magic-lantern-500d

So.. it works?? :P

I'll look at it more tomorrow, I'm throwing in the towel for today.
« Last Edit: 28 / June / 2011, 23:40:57 by Coutts »
Canon 5d
Canon 50mm f/1.8
Sigma 24mm f/1.8

Flickr

*

Offline a1ex

  • *****
  • 671
  • ML dev
Re: 500d development
« Reply #1463 on: 29 / June / 2011, 07:00:44 »
Almost there; you still need to improve your hex couting skills :)

Offsets for FULLHD OPT are 0x10/0x14; others are correct (0x24/0x28, 0x38/0x3c). Also, make sure you have the right number of in-between variables (so the offset of each field in the structure should match the offset in the comment).

You also need to make a new constant, MOV_GOP_OPT_STEP = 3, and keep MOV_OPT_STEP = 5. I've assummed these two are equal; they are in 550D/60D/600D.


*

Offline Coutts

  • *****
  • 538
  • www.flickr.com/couttsphotog
    • Flickr
Re: 500d development
« Reply #1464 on: 29 / June / 2011, 15:17:30 »
alright it looks like q-scale and cbr should be working now (finally). Big thanks to Alex for everything (as usual :P ), seriously this whole project would be nowhere without him answering all of my questions.

This is what the final mvr_config struct looks like, it seems to be working now so I think this is finally it!!
Quote
struct mvr_config
{
   uint16_t      debug_flag;            // 0x00, 85f4, 1 = write debugmsg's
   uint16_t      qscale_mode;         // 0x02, 85f6, 1 = QScale, 0 = CBR
   uint16_t      db_filter_a;         // 0x04, 85f8, no effect
   uint16_t      db_filter_b;         // 0x06, 85fa, no effect
   int16_t         def_q_scale;         // 0x08, 85fc, works when qscale_mode = 1
   int16_t       qscale_limit_L;         // 0x0a, 85fe
   int16_t       qscale_limit_H;         // 0x0c, 8600
   uint16_t      time_const;            // 0x0e, 8602, unknown
   uint32_t      fullhd_20fps_opt_size_I;// 0x10, 8604, works when qscale_mode = 0
   uint32_t      fullhd_20fps_opt_size_P;// 0x14, 8608
   uint32_t      fullhd_20fps_D1;            // 0x18, 860c
   uint32_t      fullhd_20fps_D2;            // 0x1c, 8610
   uint32_t      x8610_unknown;         // 0x20, 8614
   uint32_t      hd_30fps_opt_size_I;   // 0x24, 8618
   uint32_t      hd_30fps_opt_size_P;   // 0x28, 861c
   uint32_t      hd_30fps_D1;         // 0x2c, 8620
   uint32_t      hd_30fps_D2;         // 0x30, 8624
   uint32_t      x8624_unknown;         // 0x34, 8628
   uint32_t      vga_30fps_opt_size_I;   // 0x38, 862c
   uint32_t      vga_30fps_opt_size_P;   // 0x3c, 8630
   uint32_t      vga_30fps_D1;         // 0x40, 8634
   uint32_t      vga_30fps_D2;         // 0x44, 8638
   uint32_t      x8638_unknown;         // 0x48, 863c
   int32_t       IniQScale;            // 0x4c, 8640
   int32_t       actual_qscale_maybe;   // 0x50, 8644
   uint32_t      IOptSize;            // 0x54, 8648
   uint32_t      POptSize;            // 0x58, 864c
   uint32_t      IOptSize2;            // 0x5c, 8650
   uint32_t      POptSize2;            // 0x60, 8654
   uint32_t      GopSize;            // 0x64, 8658
   uint32_t      B_zone_NowIndex;      // 0x68, 865c
   uint32_t      gop_opt_array_ptr;      // 0x6c, 8660
   uint32_t      _D1;               // 0x70, 8664
   uint32_t      _D2;               // 0x74, 8668
   uint32_t      x8668_unknown;         // 0x78, 866c -- 1080p = 0x9, 720p/480p = 0xE
   uint32_t      fullhd_20fps_gop_opt_0;   // 0x7c, 8670
   uint32_t      fullhd_20fps_gop_opt_1;   // 0x80, 8674
   uint32_t      fullhd_20fps_gop_opt_2;   // 0x84, 8678
   uint32_t      hd_30fps_gop_opt_0;      // 0x88, 867c
   uint32_t      hd_30fps_gop_opt_1;      // 0x8c, 8680
   uint32_t      hd_30fps_gop_opt_2;      // 0x90, 8684
   uint32_t      vga_30fps_gop_opt_0;   // 0x94, 8688
   uint32_t      vga_30fps_gop_opt_1;   // 0x98, 868c
   uint32_t      vga_30fps_gop_opt_2;   // 0x9c, 8690
} __attribute__((aligned,packed));



If anyone wants to test it out, recording is still a bit unstable and you will probably get err70 unless you turn off other settings like wb save. I am pulling relatively high numbers with CBR, so it appears to be working. this isn't an official release or anything, but feel free to try it out.

:D
Canon 5d
Canon 50mm f/1.8
Sigma 24mm f/1.8

Flickr

Re: 500d development
« Reply #1465 on: 29 / June / 2011, 17:24:30 »
I was wonder for the future, when developers get to work in frame rate, if it is too much ask to take into account a 25 fps too?
I sow the wiki and 25 fps is not in.
Thanks!
« Last Edit: 01 / July / 2011, 20:29:17 by Rolink »

*

Offline Coutts

  • *****
  • 538
  • www.flickr.com/couttsphotog
    • Flickr
Re: 500d development
« Reply #1466 on: 30 / June / 2011, 08:12:14 »
Judging by how much goes into frame rate selection (just take a look at that mvr_config struct), it's not going to be easy. It's not just a simple property that needs to be changed like iso or shutter speed, so  framerate adjustment isn't looking possible in the short term at least (unless someone else wants to try).
Canon 5d
Canon 50mm f/1.8
Sigma 24mm f/1.8

Flickr

Re: 500d development
« Reply #1467 on: 30 / June / 2011, 15:18:45 »
@ Coutts

that is pretty sad to hear that... 30fps that we have are useless in any kind of amateur cinematography...i guess if nothing works in the region of frame rates after so much that you've and others done trying to perfect our beloved 500D...i might be moving to 550D some time down the road...which i would be really hesitant to do...


*

Offline Coutts

  • *****
  • 538
  • www.flickr.com/couttsphotog
    • Flickr
Re: 500d development
« Reply #1468 on: 30 / June / 2011, 15:34:46 »
@ Coutts

that is pretty sad to hear that... 30fps that we have are useless in any kind of amateur cinematography...i guess if nothing works in the region of frame rates after so much that you've and others done trying to perfect our beloved 500D...i might be moving to 550D some time down the road...which i would be really hesitant to do...
you can down sample to 24fps in post processing, obviously it won't be as good as native 24fps footage, but it's still a fix for us.
Canon 5d
Canon 50mm f/1.8
Sigma 24mm f/1.8

Flickr

Re: 500d development
« Reply #1469 on: 01 / July / 2011, 20:28:18 »
Hey Coutts,
wasn't a direct question for you so I'm editing previous post.
It seems you are alone here, I hope that no.
I changed/edited the Wishlist in the wiki, but I don't really know if I have rights to do that.
I can see through mvr_config, but i can't help.
Thanks anyway!
« Last Edit: 01 / July / 2011, 20:31:09 by Rolink »

 

Related Topics