OtherOS demo 1080i patch

Technical discussion on the newly released and hard to find PS3.

Moderators: cheriff, emoon

Post Reply
ps2devman
Posts: 259
Joined: Mon Oct 09, 2006 3:56 pm

OtherOS demo 1080i patch

Post by ps2devman »

1080i 60Hz patch :
(I'm using a component to vga box, and 1080i is great on my plasma TV)

in proto.h,
declare

Code: Select all

#define _1080i_60Hz
in demo.c,
replace

Code: Select all

#define NUM_BUFFERS 10
with

Code: Select all

#ifdef _1080i_60Hz
#define NUM_BUFFERS 2
#else
#define NUM_BUFFERS 10
#endif
in av.c,
replace

Code: Select all

static const unsigned char avb_param_ntsc_cmd[] = {
... 480i stuff
};
with

Code: Select all

#ifdef _1080i60Hz
static const unsigned char avb_param_ntsc_cmd[] = {

  2, 5, /* av command version */
  0, 148, /* Length following this length field */
  4, 0, 0, 1, /* command id:  AVB_PARAM */

  0, 2, /* number of video packets */
  0, 0, /* number of audio packets */
  0, 2, /* number of av video packets */
  0, 0, /* number of av audio packets */

  /* pkt_video_mode x 2 */

  2, 5,
  0, 44,
  1, 0, 0, 2, /* command id:  VIDEO_MODE */
  0, 0, 0, 0, /* head A */
  0, 0, 0, 0, 
  0, 0, 0, 7, /* 1080I_60HZ  8=1080I_50Hz */
  0, 0, 0x7, 0x80, /* w=1920 */
  0, 0, 0x4, 0x38, /* h=1080 */
  0, 0, 0x1e, 0, /* pitch=7680 (4*w) */
  0, 0, 0, 0,
  0, 0, 0, 7, /* A8R8G8B8 */
  0, 0, 0, 0,
  0, 0, 0, 0,

  2, 5,
  0, 44,
  1, 0, 0, 2, /* command id:  VIDEO_MODE */
  0, 0, 0, 1, /* head B */
  0, 0, 0, 0, 
  0, 0, 0, 7, /* 1080I_60HZ  8=1080I_50Hz */
  0, 0, 0x7, 0x80, /* w=1920 */
  0, 0, 0x4, 0x38, /* h=1080 */
  0, 0, 0x1e, 0, /* pitch=7680 (4*w) */
  0, 0, 0, 0,
  0, 0, 0, 7, /* A8R8G8B8 */
  0, 0, 0, 0,
  0, 0, 0, 0,

  /* pkt_av_video_cs x 2 */

  2, 5,
  0, 16,
  0, 1, 0, 1, /* command id:  AV_VIDEO_CS */
  0, 0, /* avport HDMI 0 */
  0, 3, /* av_vid 1080I_60HZ  8=1080I_50Hz */
  0, 1, /* av_cs_out YUV444-8 */
  0, 0, /* av_cs_in RGB-8 */
  0, /* dither off */
  0, /* bitlen_out 8 */
  0, /* super_white off */
  1, /* aspect 4:3 */

  2, 5,
  0, 16,
  0, 1, 0, 1, /* command id:  AV_VIDEO_CS */
  0, 16, /* avport AVMULTI 0 */
  0, 3, /* av_vid 1080I_60HZ  8=1080I_50Hz */
  0, 1, /* av_cs_out YUV444-8 */
  0, 0, /* av_cs_in RGB-8 */
  0, /* dither off */
  0, /* bitlen_out 8 */
  0, /* super_white off */
  1, /* aspect 4:3 */

};
#else
static const unsigned char avb_param_ntsc_cmd[] = {
... 480i stuff
};
#endif


and replace

Code: Select all

    av_width = 720;
    av_height = 480;
    av_pitch = 2880;
with

Code: Select all

#ifdef _1080i60Hz
    av_width = 1920;
    av_height = 1080;
    av_pitch = 1920*4;
#else
    av_width = 720;
    av_height = 480;
    av_pitch = 2880;
#endif
Marcus, your scrolling text is soooo small now... Funny!
spacetug
Posts: 2
Joined: Fri Sep 07, 2007 10:32 am

Post by spacetug »

Hello there,

How do I turn the output to the hdmi port (@720p) ?

There is any place where I can get the array values to config those things??


Thanks
ps2devman
Posts: 259
Joined: Mon Oct 09, 2006 3:56 pm

Post by ps2devman »

I don't have HDMI compatible screen and my components to VGA box (and/or screen) doesn't support 720p, so I can't really add support for that myself.

But... in PS3 Linux kernel source (ps3av.c/.h) it appears that...

For VIDEO_MODE packet :
720p 60Hz is mode 9
720p 50Hz is mode 10
w=1280
h=720
pitch=4*w (I guess)

For AV_VIDEO_CS packet :
720p 60Hz is mode 2
720p 50Hz is mode 7


So, feel free to try (& fry?) yourself... at your own risk. Good luck.
spacetug
Posts: 2
Joined: Fri Sep 07, 2007 10:32 am

Post by spacetug »

Hello

Only to make an update.
It apears one must have to issue a HDMI mode command to set default HDMI mode in order to enable the HDMI out.

something like:

Code: Select all

static const unsigned char video_hdmi_mode_cmd[] = {
    2, 5,
    0, 8,  //size
    0, 0x04, 0, 0x01, // PS3AV_CID_AV_HDMI_MODE
    0xFF, /* in: hdmi_mode */
    0, // reserved
    0, //reserved
    0, //reserved
};
and then I called it after audio, video and av inits; and before that avb_param thing, but I doesn't conduct any deep test to see order safety.

Well may be it was a coincidence, but before this no image after a image.
But the text does not render correctly (i was modifing the mcload, not the demo).

Thanks
tsuba
Posts: 6
Joined: Tue Sep 18, 2007 4:13 am

Post by tsuba »

I have tested out the values from ps2devman for 720p 60hz, they work.
(I'm using also a component to vga box on a monitor)
Here are the changes you need to make.

In av.c add:

Code: Select all

/* 720p 60 hz*/
static const unsigned char avb_param_pal_cmd2[] = {
  2, 5, /* av command version */
  0, 148, /* Length following this length field */
  4, 0, 0, 1, /* command id:  AVB_PARAM */
  0, 2, /* number of video packets */
  0, 0, /* number of audio packets */
  0, 2, /* number of av video packets */
  0, 0, /* number of av audio packets */
  /* pkt_video_mode x 2 */
  2, 5,
  0, 44,
  1, 0, 0, 2,
  0, 0, 0, 0, /* head A */
  0, 0, 0, 0, 
  0, 0, 0, 9, /* 720p */
  0, 0, 0x5, 0x0, /* w=1280 */
  0, 0, 0x2, 0xd0, /* h=720 */
  0, 0, 0x14, 0x0, /* pitch=5120 */
  0, 0, 0, 0,
  0, 0, 0, 7, /* XRGB */
  0, 0, 0, 0,
  0, 0, 0, 0,
  2, 5,
  0, 44,
  1, 0, 0, 2,
  0, 0, 0, 1, /* head B */
  0, 0, 0, 0, 
  0, 0, 0, 9, /* 720p */
  0, 0, 0x5, 0x0, /* w=1280 */
  0, 0, 0x2, 0xd0, /* h=720 */
  0, 0, 0x14, 0x0, /* pitch=5120 */
  0, 0, 0, 0,
  0, 0, 0, 7, /* XRGB */
  0, 0, 0, 0,
  0, 0, 0, 0,
  /* pkt_av_video_cs x 2 */
  2, 5,
  0, 16,
  0, 1, 0, 1,
  0, 0, /* avport HDMI 0 */
  0, 2, /* av_vid 720p */
  0, 1, /* av_cs_out YUV444-8 */
  0, 0, /* av_cs_in RGB-8 */
  0, /* dither off */
  0, /* bitlen_out 8 */
  0, /* super_white off */
  1, /* aspect 4:3 */
  2, 5,
  0, 16,
  0, 1, 0, 1,
  0, 16, /* avport AVMULTI 0 */
  0, 2, /* av_vid 720p */
  0, 1, /* av_cs_out YUV444-8 */
  0, 0, /* av_cs_in RGB-8 */
  0, /* dither off */
  0, /* bitlen_out 8 */
  0, /* super_white off */
  1, /* aspect 4:3 */
};
In the method void av_init().
Before the switch set mode on 3.
Add in the switch case 3.

Code: Select all

 int mode = get_boot_vmode();
    ...
 mode =3;

switch(mode) {
  ...
case 3:
    DBG("PAL 60Hz\n 720p");
    av_command(avb_param_pal_cmd2, sizeof(avb_param_pal_cmd2));
    av_width = 1280;
    av_height = 720;
    av_pitch = 5120;
    av_fps = 60;
    break;
 ...

In demo.c set NUM_BUFFERS on 2.
#define NUM_BUFFERS 2

Tthe code from spacetug is in this demo not needed. Adding it doesn't change anything noticeable.

If it is needed i can also make patch like ps2devman with a #define.
ps2devman
Posts: 259
Joined: Mon Oct 09, 2006 3:56 pm

Post by ps2devman »

Many thanks

(Reminder for all : These posts above are for marcus' other os demo v1.0, the one that doesn't use RSX. For v1.1, much more work is needed).
nbauernf
Posts: 11
Joined: Tue Nov 18, 2008 11:35 am
Location: Carnegie Mellon University

HDMI Head

Post by nbauernf »

FYI: To sync to the HDMI head the 1080i code works (as long as the monitor supports 1080i). My monitor did not support the original resolution over HDMI. One thing to remember is that you probably do not want to output to YUV444-8 if you're using the HDMI head. Just change the av_cs_out to RGB-8 and it should work for you.

Code: Select all

  0, 0, /* avport HDMI 0 */
  0, 3, /* av_vid 1080I_60HZ  8=1080I_50Hz */ 
  0, 0, /* av_cs_out RGB-8 */
  0, 0, /* av_cs_in RGB-8 */ 
Warren
Posts: 175
Joined: Sat Jan 24, 2004 8:26 am
Location: San Diego, CA

Post by Warren »

There should be no reason to switch it to YUV unless you have some weird non-standard display that only does RGB over HDMI. Setting HDMI to RGB instead of YUV will disable picture adjustments on some TVs.
nbauernf
Posts: 11
Joined: Tue Nov 18, 2008 11:35 am
Location: Carnegie Mellon University

Post by nbauernf »

Hmm... That's weird. I was using an HDMI to DVI converter hooked up to a Dell Monitor (which is supposed to decode HDMI signals). It was not connected to my HDTV (which would probably more correctly handle it). Maybe that was why?
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

Remember that the consumer PS3s always use HDCP over HDMI. If your TV doesn't handle HDCP over DVI, you won't be able to use it with an HDMI -> DVI adapter.
Post Reply