Hacking devices can/will void your warranty and can turn your expensive consumer electronics into worthless trash if you don't know what you're doing. This blog is for information purposes only, and if you try to hack into your own consumer electronics, you do so at your own risk. The device I'm currently hacking is the Canon SX10 IS camera.

Monday, February 22, 2010

Direct screen control

I am now able to control every pixel on the screen. Apparently they chose the R5G6B5 bitmap format for a reason -- it's the native storage format for the screen.

DG_GetSurfaceDesc (m_hSurface, &surfDesc);
DG_Lock(m_hSurface, 0, 0, unitRect.width, unitRect.height, 0);
x = horizonal value from 0 - 1920 (for 1080I)
y = vertical value from 0 - 1080 (for 1080I)
*((uint16_t *)((uint8_t *)surfDesc.lpsurface + (y*surfDesc.lPitch)) + x) = 0xffff;
// format is r5, g6, b5
DG_Unlock(m_hSurface);

edit: It was quite easy to switch it to a higher color format by just changing it from Format_16 to Format_32 when the surface was being created. It does not affect the video, it only applies to the overlay surfaces. But the SDK has Format_16 as the default, possibly inserted there by Ellion.

11 comments:

  1. Thanks Joman100
    It seems that we are close to have a open source firmware.
    Thanks again for your great work.

    ReplyDelete
  2. Hi,
    Good news , for your success story....but I have a RTD1262 player .... do you think that code will run on 'all' realtek boards ?

    Is your idea to create a 'driver' or firmware in order to have video out usable for all linux application ?

    Did you try to 'chroot' and run a 'normal' distro ?

    ReplyDelete
  3. Everything I have done so far should work on other RTD 1262/1282 players. There will need to be some customization to get it working. For example, the GPIO numbers may have to change. I know I have at least one wrong on mine because the recording light comes on and stays on. Also, when I add in the remote control capabilities, the specific codes will need to be adjusted to work for other players.

    Creating a display driver is not my goal. That's an area I am totally unfamiliar with.

    I figure out this stuff and include samples of it in the HelloWorld-JC source that anybody can "git" from the opensphd sourceforge project. So if somebody else wants to create a display driver and try to get the entire environment installed, that's fine and dandy with me. But my efforts are focused on getting all the information so I can create a simple media player running that shows CD/movie posters for selecting and playing movies, and can still record from the audio/video-in ports on the ScreenPlay.

    ReplyDelete
  4. Ok Joman100,
    ( my name is gigirock)

    I'm interesting in the way to use and compile standard and wellknow players with our devices as vlc for example....
    So what I need is how to interface video and audio to the system in other hand a driver....
    I will start from your work and we will see

    Bye and thank you

    ReplyDelete
  5. R5G6B5 means only 16 bit color. Is that all for available colors?

    ReplyDelete
  6. For the graphical overlay it appears to be using 16 bit color. The video undereath obviously goes higher.

    There appears to be options for higher colors. There is a enum for PIXEL_FORMAT that gives other formats, including 888A. The GetSurfaceHandle that is defined for the Ellion (and likely for the Iomega) defaults to Color_Format, which comes from DirectGraphics.h. it has a #define COLOR_FORMAT_16 embedded and appears to allow other formats. So this could probably be changed to COLOR_FORMAT_32. I'll experiment around with that tonight and see what happens.

    ReplyDelete
  7. Hi Joman, ltns...

    I'm interested to see how your investigation into increasing the pixel format goes - I notice the Xtreamer pro (which is using 1283 same as original xtreamer) is apparently abel to use a higher colour depth so there must be something to it (unless this is SDK3 based).

    Hope to see you over in #xtreamer again sometime soon.

    'CaP

    ReplyDelete
  8. I was able to switch over to 24 bit color by just changing the default used in GetSurfaceHandle. I switched it to Format_32 and that puts it in A/8/8/8 format. But the alpha did not appear to make it transparent. It's possible that it will blend with some of the other layers if I use more than one overlay layer, but it did not blend with the video background.

    ReplyDelete
  9. CaP - I'm not gone from the discussion in xtreamer, I actually check it every day. I just don't have anything for the xtreamer folks to test yet, but I do plan on having something soon.

    ReplyDelete
  10. Great news - Very impressed with the progress already. Thanks for keeping us in mind and let me know if you need anything testing.

    'CaP

    ReplyDelete
  11. Not sure if it has any relevance by tghe way, but all of these realtek devices use #ff00ff for a transparency mask. - Just in case it has any bearing.

    'CaP

    ReplyDelete