forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

OtherOS demo 1080i patch

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS3 Development
View previous topic :: View next topic  
Author Message
ps2devman



Joined: 09 Oct 2006
Posts: 265

PostPosted: Mon Jun 25, 2007 5:39 am    Post subject: OtherOS demo 1080i patch Reply with quote

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

in proto.h,
declare
Code:

#define _1080i_60Hz


in demo.c,
replace
Code:

#define NUM_BUFFERS 10

with
Code:

#ifdef _1080i_60Hz
#define NUM_BUFFERS 2
#else
#define NUM_BUFFERS 10
#endif


in av.c,
replace
Code:

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

with
Code:

#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:

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

with
Code:

#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!
Back to top
View user's profile Send private message
spacetug



Joined: 07 Sep 2007
Posts: 2

PostPosted: Fri Sep 07, 2007 10:38 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
ps2devman



Joined: 09 Oct 2006
Posts: 265

PostPosted: Sun Sep 16, 2007 6:14 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
spacetug



Joined: 07 Sep 2007
Posts: 2

PostPosted: Tue Sep 25, 2007 11:36 am    Post subject: Reply with quote

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:

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
Back to top
View user's profile Send private message
tsuba



Joined: 18 Sep 2007
Posts: 6

PostPosted: Sun Dec 23, 2007 3:18 am    Post subject: Reply with quote

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:

/* 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:

 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.
Back to top
View user's profile Send private message
ps2devman



Joined: 09 Oct 2006
Posts: 265

PostPosted: Sun Dec 23, 2007 5:03 am    Post subject: Reply with quote

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).
Back to top
View user's profile Send private message
nbauernf



Joined: 18 Nov 2008
Posts: 13
Location: Carnegie Mellon University

PostPosted: Tue Nov 18, 2008 11:46 am    Post subject: HDMI Head Reply with quote

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:

  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 */
Back to top
View user's profile Send private message
Warren



Joined: 24 Jan 2004
Posts: 173
Location: San Diego, CA

PostPosted: Thu Dec 18, 2008 5:46 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
nbauernf



Joined: 18 Nov 2008
Posts: 13
Location: Carnegie Mellon University

PostPosted: Sat Dec 20, 2008 9:21 am    Post subject: Reply with quote

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?
Back to top
View user's profile Send private message
J.F.



Joined: 22 Feb 2004
Posts: 2906

PostPosted: Sat Dec 20, 2008 4:32 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS3 Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group