Wednesday, August 21, 2013

RPi to 50" plasma display

Yesterday, I explained how I copied my Raspbian from one 4GB SDCard to another of size 8GB.
Now I wanted this for a new RPi that I intended to hook up to my new Panasonic 50" Plasma TV.

To get the display to show up on the TV (of course, it's a HDMI to HDMI connection), some changes were necessary to the file /boot/config.txt
There's a wonderful how-to that explains how this is done on the RPi forum.

In my case, I went through the following steps:

1. First, you need to get a display.
When I connected the RPi to one of the HDMI inputs (HDMI3) on the TV, I got no display.
So, open up /boot/config.txt. I did this by removing the SDCard, and transferring it to the card reader on my trusty (but quite old, now) EeePC901 and opened the /boot partition in Ubuntu.
There I was able to edit the config.txt file and uncommented the lines:

 #hdmi_safe=1
#hdmi_force_hotplug=1

Replacing the card in the RPi and booting it now gave me a display, albeit in 640x480 resolution.

2. Next, you need to set up a more usable screen resolution.
Make sure you're in VGA mode (by setting hdmi_group=1 and hdmi_mode=1 if you've changed them from the config.txt settings above) and run the following commands.

But, because the VGA mode is very awkward, I found it much more convenient to ssh into Raspbian from another RPi but it could be from anywhere (except, of course, Windows) and run the commands from there.

tvservice –m CEA
which gave me

Group CEA has 1 modes:  (prefer) mode 31: 1920x1080 @ 50Hz 16:9, clock:148MHz progressive 3D:TopBot|SbS-HH
The next command
tvservice -m DMT
gave me the following output
Group DMT has 0 modes:

Then, as suggested in the linked HDMI setup post, I ran this command
tvservice –d somefile
followed by
 edidparser somefile
which gave me the following very large output:
Enabling fuzzy format match...Parsing plasma...HDMI:EDID version 1.3, 1 extensions, screen size 128x72 cmHDMI:EDID features - videodef 0x80 !standby !suspend !active off; colour encoding:RGB444|YCbCr422; sRGB is not default colourspace; preferred format is native; does not support GTFHDMI:EDID found monitor name descriptor tag 0xfcHDMI:EDID monitor name is Panasonic-TVHDMI:EDID found monitor range descriptor tag 0xfdHDMI:EDID monitor range offsets: V min=0, V max=0, H min=0, H max=0HDMI:EDID monitor range: vertical is 23-61 Hz, horizontal is 15-68 kHz, max pixel clock is 150 MHzHDMI:EDID monitor range does not support GTFHDMI:EDID found preferred CEA detail timing format: 1920x1080p @ 50 Hz (31)HDMI:EDID found CEA detail timing format: 1920x1080p @ 60 Hz (16)HDMI:EDID established timing I/II bytes are 21 08 00HDMI:EDID found DMT format: code 4, 640x480p @ 60 Hz in established timing I/IIHDMI:EDID found DMT format: code 9, 800x600p @ 60 Hz in established timing I/IIHDMI:EDID found DMT format: code 16, 1024x768p @ 60 Hz in established timing I/IIHDMI:EDID standard timings block x 8: 0x3140 4540 6140 8180 0101 0101 0101 0101 HDMI:EDID found DMT format: code 4, 640x480p @ 60 Hz (4:3) in standard timing 0HDMI:EDID found DMT format: code 9, 800x600p @ 60 Hz (4:3) in standard timing 1HDMI:EDID found DMT format: code 16, 1024x768p @ 60 Hz (4:3) in standard timing 2HDMI:EDID found DMT format: code 35, 1280x1024p @ 60 Hz (5:4) in standard timing 3HDMI:EDID parsing v3 CEA extension 0HDMI:EDID monitor support - underscan IT formats:yes, basic audio:yes, yuv444:yes, yuv422:yes, #native DTD:2HDMI:EDID found CEA detail timing format: 1920x1080i @ 50 Hz (20)HDMI:EDID found CEA detail timing format: 1920x1080i @ 60 Hz (5)HDMI:EDID found DMT detail timing format: 1366x768p @ 60 Hz (81)HDMI:EDID found CEA format: code 31, 1920x1080p @ 50Hz (native)HDMI:EDID found CEA format: code 16, 1920x1080p @ 60Hz (native)HDMI:EDID found CEA format: code 20, 1920x1080i @ 50Hz HDMI:EDID found CEA format: code 5, 1920x1080i @ 60Hz HDMI:EDID found CEA format: code 32, 1920x1080p @ 24Hz HDMI:EDID found CEA format: code 33, 1920x1080p @ 25Hz HDMI:EDID found CEA format: code 34, 1920x1080p @ 30Hz HDMI:EDID found CEA format: code 19, 1280x720p @ 50Hz HDMI:EDID found CEA format: code 4, 1280x720p @ 60Hz HDMI:EDID found CEA format: code 18, 720x576p @ 50Hz HDMI:EDID found CEA format: code 3, 720x480p @ 60Hz HDMI:EDID found CEA format: code 22, 1440x576i @ 50Hz HDMI:EDID found CEA format: code 7, 1440x480i @ 60Hz HDMI:EDID found audio format 2 channels PCM, sample rate: 32|44|48 kHz, sample size: 16 bitsHDMI:EDID found HDMI VSDB length 26HDMI:EDID HDMI VSDB has physical address 3.0.0.0HDMI:EDID HDMI VSDB supports AI:yes, dual link DVI:noHDMI:EDID HDMI VSDB deep colour support - 48-bit:no 36-bit:yes 30-bit:yes DC_yuv444:yesHDMI:EDID HDMI VSDB max TMDS clock 190 MHzHDMI:EDID HDMI VSDB content type support: game|cinema|photo|textHDMI:EDID HDMI VSDB supports 3D formatsHDMI:EDID HDMI VSDB 3D_Mask: 0x019cHDMI:EDID HDMI VSDB 3D_Structure_All: 0x8141HDMI:EDID HDMI VSDB explicit 3D mode: 2D VIC order 0 (CEA 31), 3D struct 0x06, 3D detail 0x00HDMI:EDID HDMI VSDB explicit 3D mode: 2D VIC order 1 (CEA 16), 3D struct 0x06, 3D detail 0x00HDMI:EDID HDMI VSDB explicit 3D mode: 2D VIC order 0 (CEA 31), 3D struct 0x08, 3D detail 0x00HDMI:EDID HDMI VSDB explicit 3D mode: 2D VIC order 1 (CEA 16), 3D struct 0x08, 3D detail 0x00HDMI:EDID HDMI VSDB explicit 3D mode: 2D VIC order 9 (CEA 18), 3D struct 0x06, 3D detail 0x00HDMI:EDID HDMI VSDB explicit 3D mode: 2D VIC order 10 (CEA 3), 3D struct 0x06, 3D detail 0x00HDMI:EDID HDMI VSDB explicit 3D mode: 2D VIC order 9 (CEA 18), 3D struct 0x08, 3D detail 0x00HDMI:EDID HDMI VSDB explicit 3D mode: 2D VIC order 10 (CEA 3), 3D struct 0x08, 3D detail 0x00HDMI:EDID found Video Capability DB length 2HDMI:EDID video capability: CE:3 IT:2 PT:0 QS:1HDMI:EDID extended data block tag 0x05 length 3 not supportedHDMI:EDID adding mandatory support for CEA (1) 640x480p @ 60HzHDMI:EDID adding mandatory support for CEA (2) 720x480p @ 60HzHDMI:EDID adding mandatory support for CEA (17) 720x576p @ 50HzHDMI:EDID VSDB 3D legend:FP=frame packing, F-Alt=Field Alternative, L-Alt=Line AlternativeSbS-Full=Side by Side Full, Ldep=L Depth, Ldep+Gfx=L Depth + Graphics DepthTopBot=Top and Bottom, SbS-HH=Side by Side half horizontalSbS-OLOR=Side by Side odd left odd right, SbS-OLER=Side by Side odd left even rightSbS-ELOR=Side by Side even left odd right, SbS-ELER=Side by Side even left even rightHDMI:EDID CEA (32) 1920x1080p 24Hz 3D supports: FP|TopBot|SbS-HH|SbS-OLOR|SbS-OLER|SbS-ELOR|SbS-ELERHDMI:EDID CEA (4) 1280x720p 60Hz 3D supports: FP|TopBot|SbS-HH|SbS-OLOR|SbS-OLER|SbS-ELOR|SbS-ELERHDMI:EDID CEA (5) 1920x1080i 60Hz 3D supports: FP|TopBot|SbS-HH|SbS-OLOR|SbS-OLER|SbS-ELOR|SbS-ELERHDMI:EDID CEA (19) 1280x720p 50Hz 3D supports: FP|TopBot|SbS-HH|SbS-OLOR|SbS-OLER|SbS-ELOR|SbS-ELERHDMI:EDID CEA (20) 1920x1080i 50Hz 3D supports: FP|TopBot|SbS-HH|SbS-OLOR|SbS-OLER|SbS-ELOR|SbS-ELERHDMI:EDID CEA (31) 1920x1080p 50Hz 3D supports: TopBot|SbS-HH|SbS-OLOR|SbS-OLER|SbS-ELOR|SbS-ELERHDMI:EDID CEA (16) 1920x1080p 60Hz 3D supports: TopBot|SbS-HH|SbS-OLOR|SbS-OLER|SbS-ELOR|SbS-ELERHDMI:EDID CEA (33) 1920x1080p 25Hz 3D supports: noneHDMI:EDID CEA (34) 1920x1080p 30Hz 3D supports: noneHDMI:EDID CEA (18) 720x576p 50Hz 3D supports: TopBot|SbS-HH|SbS-OLOR|SbS-OLER|SbS-ELOR|SbS-ELERHDMI:EDID CEA (3) 720x480p 60Hz 3D supports: TopBot|SbS-HH|SbS-OLOR|SbS-OLER|SbS-ELOR|SbS-ELERHDMI:EDID CEA (22) 1440x576i 50Hz 3D supports: noneHDMI:EDID CEA (7) 1440x480i 60Hz 3D supports: noneHDMI:EDID filtering formats with pixel clock > 162 MHz or h. blanking > 1023HDMI:EDID best score mode initialised to CEA (1) 640x480p @ 60 Hz with pixel clock 25 MHz (score 0)HDMI:EDID best score mode is now CEA (1) 640x480p @ 60 Hz with pixel clock 25 MHz (score 61864)HDMI:EDID best score mode is now CEA (2) 720x480p @ 60 Hz with pixel clock 27 MHz (score 66472)HDMI:EDID CEA mode (3) 720x480p @ 60 Hz with pixel clock 27 MHz has a score of 66472HDMI:EDID best score mode is now CEA (4) 1280x720p @ 60 Hz with pixel clock 74 MHz (score 135592)HDMI:EDID DMT mode (4) 640x480p @ 60 Hz with pixel clock 25 MHz has a score of 43432HDMI:EDID best score mode is now CEA (5) 1920x1080i @ 60 Hz with pixel clock 74 MHz (score 3773832)HDMI:EDID CEA mode (7) 1440x480i @ 60 Hz with pixel clock 27 MHz has a score of 45736HDMI:EDID DMT mode (9) 800x600p @ 60 Hz with pixel clock 40 MHz has a score of 53800HDMI:EDID best score mode is now CEA (16) 1920x1080p @ 60 Hz with pixel clock 148 MHz (score 4898248)HDMI:EDID DMT mode (16) 1024x768p @ 60 Hz with pixel clock 65 MHz has a score of 72185HDMI:EDID CEA mode (17) 720x576p @ 50 Hz with pixel clock 27 MHz has a score of 66472HDMI:EDID CEA mode (18) 720x576p @ 50 Hz with pixel clock 27 MHz has a score of 66472HDMI:EDID CEA mode (19) 1280x720p @ 50 Hz with pixel clock 74 MHz has a score of 117160HDMI:EDID CEA mode (20) 1920x1080i @ 50 Hz with pixel clock 74 MHz has a score of 4232360HDMI:EDID CEA mode (22) 1440x576i @ 50 Hz with pixel clock 27 MHz has a score of 45736HDMI:EDID best score mode is now CEA (31) 1920x1080p @ 50 Hz with pixel clock 148 MHz (score 5336040)HDMI:EDID CEA mode (32) 1920x1080p @ 24 Hz with pixel clock 74 MHz has a score of 124532HDMI:EDID CEA mode (33) 1920x1080p @ 25 Hz with pixel clock 74 MHz has a score of 128680HDMI:EDID CEA mode (34) 1920x1080p @ 30 Hz with pixel clock 74 MHz has a score of 149416HDMI:EDID DMT mode (35) 1280x1024p @ 60 Hz with pixel clock 108 MHz has a score of 103643HDMI:EDID DMT mode (81) 1366x768p @ 60 Hz with pixel clock 85 MHz has a score of 3062945HDMI 
:EDID preferred mode remained as CEA (31) 1920x1080p @ 50 Hz with pixel clock 148 MHzHDMI:EDID has HDMI support and audio support 
edid_parser exited with code 0
As is indicated in this last output and the output from the very first command, Mode 31 (CEA) 1920x1080p @ 50Hz is the favoured mode for my set up.

So with that knowledge, I added the following lines to /boot/config.txt
sdtv_mode=2 
sdtv_aspect=3 
hdmi_force_hotplug=1 
config_hdmi_boost=4 
hdmi_group=1 
hdmi_mode=31
On reboot, the display showed as a very nice 1080p @ 50Hz with the sole exception that the display didn't quite stretch to the screen edges.
However, this was easily resolved by adding the following lines to /boot/config.txt
overscan_left=0 
overscan_right=0 
overscan_top=-24 
overscan_bottom=-24
Now, the display was perfect.......and very, very big.

Performance?
Well, so far I'm very happy with it.
I'm using a LogiTech K400r combined keyboard and touchpad which works perfectly and is ideal for for computer control from a reclining position on the living room sofa, or the floor for that matter.

Additionally, I have been able to successfully overclock, without any overvolting, considerably higher than on my other 512 MB RPi.
On this latter, I couldn't go higher than arm_freq=875 without a boot failure.
On the new Pi, however, I can run stably with arm_freq=940, core_freq=450 and sdram_freq=400

Sound works great with all sound going via HDMI to the TV's speakers.
Shell-FM sounds wonderful from the Pi.

I've mentioned before that I type in both English (layout=US) and Brazilian Portuguese (layout=BR) and always have both layouts available in any OS that I use.
In Raspbian on my older 512 MB RPi, where I use Fluxbox as the window manager, following this guide I modified the file /etc/default/keyboard to include the lines:
XKBMODEL="pc105"
XKBLAYOUT="us,br"
XKBVARIANT=","
XKBOPTIONS="grp:alt_shift_toggle"
and this, in conjunction with the keyboard switcher indicator works perfectly.

However, although what I use in my new RPi is an exact clone of Raspbian from the other RPi, and everything else works flawlessly, I can no longer use Alt-Shift to switch keyboard layouts.
And up to now, I have been unable to resolve or understand this problem.

However, I found a workaround here.
This involved making a simple bash script (~/Scripts/layout_toggle) with the following input:

#! /bin/bash 
CURR_LAYOUT=$(setxkbmap -query | grep layout | cut -d ":" -f 2 | sed -e 's/ //g') [[ $CURR_LAYOUT == "us" ]] && setxkbmap -layout br || setxkbmap -layout us
making it executable and then adding a line to ~/.fluxbox/keys as follows

Mod4 Mod1 k  :ExecCommand /home/paul/Scripts/layout_toggle
Now, by pressing Win+Alt+k I can toggle between my keyboard layouts when I want.
So, why didn't I use Alt+Shift to toggle the layouts?
Well, I did, but it just didn't work.
Again, I don't yet understand why










No comments:

Post a Comment