terker
Posts: 4
Joined: Fri Apr 25, 2014 8:59 am

NTSC 59.94Hz on HDMI

Fri Apr 25, 2014 12:02 pm

Hello everyone,

I have been playing with the HDMI formats, but I am not able to get the PI to output for example 1920x1080 59.94Hz.interlaced. I have found a description of the hdmi_cvt command, but I get an error message when trying to use it, even with a format which is working using the normal hdmi_group and hdmi_mode settings. Does anyone know if the PI supports 59.94Hz at all?

Thanks in advance

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5106
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: NTSC 59.94Hz on HDMI

Fri Apr 25, 2014 5:10 pm

Yes, xbmc does this. See:
https://github.com/popcornmix/xbmc/comm ... f2b18be7ed

You need to send a property pair of HDMI_PROPERTY_PIXEL_CLOCK_TYPE, HDMI_PIXEL_CLOCK_TYPE_NTSC before changing hdmi mode.

You can't currently set that as the default hdmi mode you boot into, but I guess that could be added as a config.txt parameter. Can you explain why you need this?

terker
Posts: 4
Joined: Fri Apr 25, 2014 8:59 am

Re: NTSC 59.94Hz on HDMI

Fri Apr 25, 2014 6:05 pm

Thanks a lot for the quick answer.

I am testing broadcast equipment and are looking for a low cost, low power and small form factor solution for generating test signals primarily for the following formats: HD 1080i 50 / 59.94 , 720p 50 / 59.94 and SD 625i 50 / 525i 59.94. The idea is to use the Pi and a low cost HDMI to SDI converter to convert to SDI for the broadcast equipment. The best would be if it would be possible to change format without rebooting the Pi. I have tested out changing on the fly to some of the default formats on the Pi and that seems to work fine. I will check out XBMC.

terker
Posts: 4
Joined: Fri Apr 25, 2014 8:59 am

Re: NTSC 59.94Hz on HDMI

Tue Apr 29, 2014 5:27 am

I have tried to find out how to set the HDMI_PROPERTY_PIXEL_CLOCK_TYPE and HDMI_PIXEL_CLOCK_TYPE_NTSC but find very little about it. When searching I get hits in the vc_hdmi.h file where I also find things like:

typedef enum {
HDMI_RES_GROUP_INVALID = 0, /**< Initialised value */
HDMI_RES_GROUP_CEA = 1, /**< CEA - HDMI device */
HDMI_RES_GROUP_DMT = 2, /**< DMT - computer monitors */
HDMI_RES_GROUP_CEA_3D = 3 /**< CEA 3D mode (for 3D displays only) */
} HDMI_RES_GROUP_T;

Which i guess is the enums for setting:

hdmi_group = 2 for DMT or hdmi_group = 1 for CEA in the config.txt file of raspbian. (I have experimented with those and the hdmi_mode when trying out the non NTSC formats)

I can't find anything about which parameters (like hdmi_group) to set for HDMI_PROPERTY_PIXEL_CLOCK_TYPE and HDMI_PIXEL_CLOCK_TYPE_NTSC like described in enums below

* Pixel clock nudge factor
*/
typedef enum {
HDMI_PIXEL_CLOCK_TYPE_PAL = 0, /**< Use norminal pixel clock */
HDMI_PIXEL_CLOCK_TYPE_NTSC = 1, /**< Multiply norminal pixel clock by 1000/1001 to get the alternative frame rate e.g. 59.94Hz rather than 60, not applicable to all formats */
} HDMI_PIXEL_CLOCK_TYPE_T;

/**
* Property type
*/
typedef enum {
HDMI_PROPERTY_PIXEL_ENCODING = 0, /**< Set pixel encoding, value of property is HDMI_PIXEL_ENCODING_T, default is RGB full range (unless it is not supported) */
HDMI_PROPERTY_PIXEL_CLOCK_TYPE = 1, /**< See HDMI_PIXEL_CLOCK_TYPE_T, default is HDMI_PIXEL_CLOCK_TYPE_PAL */
HDMI_PROPERTY_CONTENT_TYPE = 2 /**< Set content type flag EDID_ContentType_T */
//More properties later...
} HDMI_PROPERTY_T;

Any ideas?

User avatar
GTR2Fan
Posts: 1601
Joined: Sun Feb 23, 2014 9:20 pm
Location: South East UK

Re: NTSC 59.94Hz on HDMI

Tue Apr 29, 2014 7:29 am

terker wrote:I have been playing with the HDMI formats, but I am not able to get the PI to output for example 1920x1080 59.94Hz.interlaced.
Possibly a silly question, but have you checked that the Pi's 60Hz isn't actually 59.94Hz with a precision frequency counter? It's common industry practice to call 59.94Hz '60Hz' as a form of short-hand.
Pi2B Mini-PC/Media Centre: ARM=1GHz (+3), Core=500MHz, v3d=500MHz, h264=333MHz, RAM=DDR2-1200 (+6/+4/+4+schmoo). Sandisk Ultra HC-I 32GB microSD card on '50=100' OCed slot (42MB/s read) running Raspbian/KODI16, Seagate 3.5" 1.5TB HDD mass storage.

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5106
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: NTSC 59.94Hz on HDMI

Tue Apr 29, 2014 11:09 am

GTR2Fan wrote:
terker wrote:I have been playing with the HDMI formats, but I am not able to get the PI to output for example 1920x1080 59.94Hz.interlaced.
Possibly a silly question, but have you checked that the Pi's 60Hz isn't actually 59.94Hz with a precision frequency counter? It's common industry practice to call 59.94Hz '60Hz' as a form of short-hand.
No there are distinct frequencies for 59.94Hz and 60Hz

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5106
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: NTSC 59.94Hz on HDMI

Tue Apr 29, 2014 11:10 am

terker wrote:Any ideas?
I'll add a command line option to tvservice to choose ntsc freqs.

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5106
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: NTSC 59.94Hz on HDMI

Tue Apr 29, 2014 11:35 am

Okay, I've added a new command line option (-t) to tvservice. Will be in next firmware update.

Code: Select all

pi@raspberrypi:~ $ tvservice 
Usage: tvservice [OPTION]...
  -p, --preferred                   Power on HDMI with preferred settings
  -e, --explicit="GROUP MODE DRIVE" Power on HDMI with explicit GROUP (CEA, DMT, CEA_3D_SBS, CEA_3D_TB)
                                      MODE (see --modes) and DRIVE (HDMI, DVI)
  -t, --ntsc                        Use NTSC frequency for HDMI mode (e.g. 59.94Hz rather than 60Hz)
  -c, --sdtvon="MODE ASPECT"        Power on SDTV with MODE (PAL or NTSC) and ASPECT (4:3 14:9 or 16:9)
  -o, --off                         Power off the display
  -m, --modes=GROUP                 Get supported modes for GROUP (CEA, DMT)
  -M, --monitor                     Monitor HDMI events
  -s, --status                      Get HDMI status
  -a, --audio                       Get supported audio information
  -d, --dumpedid <filename>         Dump EDID information to file
  -j, --json                        Use JSON format for --modes output
  -n, --name                        Print the device ID from EDID
  -h, --help                        Print this information
pi@raspberrypi:~ $ tvservice -e "CEA 16"
Powering on HDMI with explicit settings (CEA mode 16)
pi@raspberrypi:~ $ tvservice -s
state 0x12001a [HDMI CEA (16) RGB lim 16:9], 1920x1080 @ 60.00Hz, progressive
pi@raspberrypi:~ $ vcgencmd measure_clock pixel
frequency(29)=148500000
pi@raspberrypi:~ $ tvservice -t -e "CEA 16"
Setting property 1 with params 1, 0
Powering on HDMI with explicit settings (CEA mode 16)
pi@raspberrypi:~ $ tvservice -s
state 0x12001a [HDMI CEA (16) RGB lim 16:9], 1920x1080 @ 59.94Hz, progressive
pi@raspberrypi:~ $ vcgencmd measure_clock pixel
frequency(29)=148352000

User avatar
GTR2Fan
Posts: 1601
Joined: Sun Feb 23, 2014 9:20 pm
Location: South East UK

Re: NTSC 59.94Hz on HDMI

Tue Apr 29, 2014 11:46 am

Wow! You're quick! :P
Pi2B Mini-PC/Media Centre: ARM=1GHz (+3), Core=500MHz, v3d=500MHz, h264=333MHz, RAM=DDR2-1200 (+6/+4/+4+schmoo). Sandisk Ultra HC-I 32GB microSD card on '50=100' OCed slot (42MB/s read) running Raspbian/KODI16, Seagate 3.5" 1.5TB HDD mass storage.

terker
Posts: 4
Joined: Fri Apr 25, 2014 8:59 am

Re: NTSC 59.94Hz on HDMI

Wed Apr 30, 2014 7:02 am

That's really brilliant :D Thanks a lot!
Does this apply to Raspbian, RaspBMC or both? Looks like RaspBMC is based on Raspbian, but are they connected together update wise in some way?
It's not urgent for me, but if possible it would be nice with a rough indication of when you expect a new firmware update to be released

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5106
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: NTSC 59.94Hz on HDMI

Wed Apr 30, 2014 12:49 pm

terker wrote:That's really brilliant :D Thanks a lot!
Does this apply to Raspbian, RaspBMC or both? Looks like RaspBMC is based on Raspbian, but are they connected together update wise in some way?
It's not urgent for me, but if possible it would be nice with a rough indication of when you expect a new firmware update to be released
xbmc already supported ntsc frequencies. On frodo you couldn't choose them for the GUI, but it would switch when playing a video (if "adjust display refresh rate to match video was enabled").
Latest gotham builds allow selecting them in the gui which is useful if most of your files are 23.97, you can set the default refresh to that and avoid some hdmi switches.

New firmware won't be long - there's normally one or two updates a week. Follow:
https://twitter.com/RPF_Dev_Updates

if you want to know about firmware updates.

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5106
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: NTSC 59.94Hz on HDMI

Thu May 01, 2014 2:20 pm

Firmware is updated with this feature.

Malignus
Posts: 3
Joined: Sat Sep 20, 2014 9:06 am

Re: NTSC 59.94Hz on HDMI

Sat Sep 20, 2014 9:11 am

I don't know what I'm doing wrong. I found this page and was excited to see that it was already posted as I'm a broadcast engineer looking for the same solution. However, when I enter

Code: Select all

tvservice -t
followed by

Code: Select all

tvservice -s
, I see
state 0x12001a [HDMI CEA (5) RGB lim 16:9], 1920x1080 @ 60.00Hz, interlaced
.

I had already finagled with the config.txt file in /boot to force HDMA group 4, but I restored the file back to default once I wasn't getting what I wanted. Help, please?

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5106
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: NTSC 59.94Hz on HDMI

Sun Sep 21, 2014 11:54 am

Malignus wrote:I don't know what I'm doing wrong. I found this page and was excited to see that it was already posted as I'm a broadcast engineer looking for the same solution. However, when I enter

Code: Select all

tvservice -t
followed by

Code: Select all

tvservice -s
, I see
state 0x12001a [HDMI CEA (5) RGB lim 16:9], 1920x1080 @ 60.00Hz, interlaced
.
"-t" should be added to a hdmi mode change command

E.g.

Code: Select all

pi@raspberrypi:~ $ tvservice -e "CEA 4"
Powering on HDMI with explicit settings (CEA mode 4)
pi@raspberrypi:~ $ tvservice -s
state 0x12001a [HDMI CEA (4) RGB lim 16:9], 1280x720 @ 60.00Hz, progressive
pi@raspberrypi:~ $ tvservice -t -e "CEA 4"
Powering on HDMI with explicit settings (CEA mode 4)
pi@raspberrypi:~ $ tvservice -s
state 0x12001a [HDMI CEA (4) RGB lim 16:9], 1280x720 @ 59.94Hz, progressive

Malignus
Posts: 3
Joined: Sat Sep 20, 2014 9:06 am

Re: NTSC 59.94Hz on HDMI

Sun Sep 21, 2014 3:53 pm

Thank you so much! Works like a much-needed charm. :)

yasamoka
Posts: 1
Joined: Sun Aug 09, 2015 1:37 am

Re: NTSC 59.94Hz on HDMI

Sun Aug 09, 2015 1:55 am

Hello,

This topic has been very helpful for me, so thank you to all those involved, particularly dom for including the much-appreciated NTSC mode switch (-t).

I am currently running XBian, a custom image that boots into Kodi directly. I added a custom resolution in config.txt for 1920x1080p 48Hz: "hdmi_cvt=1920 1080 48 3 0 0 1". This works wonderfully. I can select 48.00Hz even from the Kodi settings themselves. 23.976FPS video switches automatically to the 48Hz resolution.

I then tried to set a decimal number instead of 48: 47.952, in order to get an NTSC refresh rate that is a multiple of 23.976. The number got truncated to 47Hz.

Then, after I discovered this topic, I tried the -t switch and if I manually switch to the newly defined custom resolution of 1920x1080p 48Hz, then read back the set refresh rate using "tvservice -s", I get 47.95Hz, so that's awesome. However, Kodi can only select 48.00Hz. This is understandable, since the -t switch works when manually selecting a particular display mode.

My question is: Is there a way to define the custom resolution itself as an NTSC resolution, and have 1920x1080p 47.95Hz selectable from Kodi (in this case - or for that matter, any application that can read the available display modes and set the resolution / refresh rate from within)?

If a solution is not present, for those reading, the alternative, I guess, would be to force 47.95Hz to run on bootup with a small script, and then Kodi would keep that refresh rate with 23.976FPS content, switch to 50Hz for 25FPS content, and switch to 59.94Hz for 29.97FPS content. However, I do not know yet if Kodi can switch back to the now "default" 47.952FPS, or if it simply switches back to 48Hz (making this alternative pointless). This is because I am testing all of this on a desktop monitor that considers 47.952Hz "out of range" but accepts 48Hz (*shakes head*). Another disadvantage of this method is that higher refresh rates, such as 59.94Hz, simply feel more responsive for the UI, so keeping the UI at the highest refresh rate available is the best scenario here.

Most TVs should support 23.976Hz and there would be no problem with video playback, however there is good reason to be able to refresh at 47.952Hz for 23.976FPS content:
1) Some TVs do not support 23.976Hz
2) Most desktop monitors simply refuse to go that low
3) Flicker and pixel decay is very possible particularly if the TV does not internally refresh at 47.952Hz when receiving a 23.976Hz signal
4) The UI is much more responsive if the display is kept at 47.952Hz. 23.952Hz is immensely sluggish and any additional input latency starts creating a worse experience.
5) HFR video is becoming a thing, and pretty soon we might have a good amount of 48 / 60FPS content, so it pays to have 47.952Hz itself working perfectly with auto-switching in Kodi (or for that matter any other player).

Awaiting feedback from you guys! And thanks in advance :)

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5106
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: NTSC 59.94Hz on HDMI

Sun Aug 09, 2015 4:59 pm

@yasamoka
if you are able to compile kodi, then change:
https://github.com/xbmc/xbmc/blob/maste ... I.cpp#L639
to become:

Code: Select all

if (tv->frame_rate == 24 || tv->frame_rate == 30 || tv->frame_rate == 48 || tv->frame_rate == 60)
which should give you an ntsc version of 48Hz.

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5106
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: NTSC 59.94Hz on HDMI

Mon Aug 10, 2015 1:29 pm

@yasamoka the latest Milhouse nightly OpenELEC build contains this change if you want to try it. See here.

danielmiller82
Posts: 1
Joined: Tue Aug 16, 2016 5:59 pm

Re: NTSC 59.94Hz on HDMI

Tue Aug 16, 2016 6:04 pm

I have been able to run

Code: Select all

pi@raspberrypi:~ $ tvservice -t -e "CEA 4"
successfully, but when i reboot the raspi, it defaults back to 60hz. How do I make it persistent? Or at very least, how do I set this command to run on boot?

dave312
Posts: 6
Joined: Sun Dec 13, 2015 7:44 pm

Re: NTSC 59.94Hz on HDMI

Sun Jun 18, 2017 10:12 pm

Thanks to everyone for this thread! Solved a problem that had perplexed me for quite some time!

FYI for some reason -p didn't make it sticky between boots for me. But you can add the tvservice command to /etc/rc.local and it works just fine.

Code: Select all

tvservice -t -e "CEA 5"
...at the end of rc.local will kick it into 1080i59.94 right at boot.

Dave

Return to “Beginners”

Who is online

Users browsing this forum: No registered users and 51 guests