Force HDMI over Raspberry Pi Official LCD Screen
-
Hi everyone,
I'm new to the raspberry world so sorry in advance for my lack of knowledge.
I'm building a semi-portable retropie setup. I want to be able to play on the tiny screen but also to play on a TV with friends.
I bought a kit with a raspberry pi 3 model B and the official 7inch LCD screen.
I Flashed the SD card and installed retropie on it.It's working like a charm on the 7inch screen.
But when I connect the raspberry pi to my TV via HDMI It does not work.
I think the TV recognises the input as it turns grey (and doesn't not show "no input signal") but i still get retropie on the small screen and nothing on the TV screen.Is there a way to force the raspberry to go through HDMI when an HDMI cable is connected? And when it's not to use the LCD screen by default.
I found this thread
https://retropie.org.uk/forum/topic/5527/raspberry-pi-official-lcd-screen-or-hdmi-optionBut it's quite hard to understand with my lack of knowledge.
Thanks a lot in advance.
-
The response on that thread pretty much covers everything you need. You just need to follow it step by step as described.
It can't hot swap between HDMI and LCD but if you set it up as described it will check on boot to see if HDMI is connected and update config.txt in the boot partition with a copy of config_hdmi.txt. If HDMI is not present it will change config.txt to match config_lcd.txt
config_hdmi.txt and config_lcd.txt are essentially duplicates of config.txt but each tweaked with the specific settings for either the LCD display or HDMI output.
Happy to try and help guide you through it but you should give it a go yourself. Best way to learn :)
Langy
-
Thanks,
As I said I'm a noob.
For the script, can I make it on script editor (mac os x) and changing the file extension to .sh ?
I'll try this tonight. -
You can use any text editor you prefer.
If your doing it on the pi itself you can either do it within the Rasbian desktop in the text editor, or if you in the console you can type the following
mkdir initDisplay cd initDisplay nano initDisplay.sh
The first two lines create the folder we are going to put the script in and then changes to that folder
The third will open up the console text editor called nano with any empty file named initDisplay.sh.
nano is one of the go-to editors for modifying files within the console. There are others but I like it. :)
Once you've finished typing the code press Ctrl+X to exit and when prompted press 'Y' to save.
Langy
-
Very useful thank you!
I already used nano to modify config.txt but I did not know you could use it to write a script.
I keep you updated asap (probably next week cause I'll be abroad this week end)
Cheers -
So I tried but I was stuck.
I created the two different config.txt file (HDMI and lcd)But I'm stuck in the end of the tutorial
https://retropie.org.uk/forum/topic/5527/raspberry-pi-official-lcd-screen-or-hdmi-optionIt says to add the script in /etc/profil.d/10-*****.sh
and to add this/home/pi/displayBoot/initDisplay.sh
sleep 5before emulstation instruction.
Could you explain that part for me cause I don't really understand. $
I understand that this is to run the script before emulstation but I don't understand what to do.Thanks a lot in advance.
-
@Centrosome I'll have a look when I get home. I don't have access to my RetroPie atm.
-
Thanks Langy1987 did you figure out?
Thanks in advance -
Centrosome, did you ever figure this out?
I too made the same script but can not figure out how to get it to run at startup. I've tried adding the file's path to several files but nothing seems to work. -
anyone get this running?
If I power up the Pi with an HDMI cord attached the LCD display is flipped. If I run the script again it returns:
device_name=SNY-SONY_TV__00 #lcd_rotate=2
Without an HDMI plugged in the LCD is right side up. If I run the script again it returns:
[E] No device present
so the script is running but is not outputting the the TV. The TV detects the input and says raspberry but remains black.
Edit:
adding:
ignore_lcd=1
to the "config_hdmi.txt" file now turns off the LCD and switches to the TV.
-
Also there is a typo in the original post. When you edit the /etc/profile.d/10-*****.sh, it should be:
# switch between LCD and HDMI /home/pi/initDisplay/initDisplay.sh sleep 5
instead of /home/pi/displayBoot/initDisplay.sh
-
@sli4 let me know if you got it running. Did you make the files (initDisplay.sh, config_hdmi.txt and config_lcd.txt, hdmi.name) in windows? Is so you need to convert them by using:
sudo apt-get install dos2unix sudo dos2unix /home/pi/initDisplay/initDisplay.sh
I also converted the config files, however that was probably not necessary.
Also the original post is not really clear about the configs. You copy all the text from config.txt and paste it into config_hdmi and config_lcd. Inside config_hdmi.txt scroll down untill you see “#hdmi_drive=2” and remove “#” then scroll to the bottom and add “ignore_lcd=1”. In config_lcd.txt scroll to the bottom and add “lcd_rotate=2”.
-
I'm gonna try and get this working. I have been using the old "pull out the GPIO pin cable" trick on my handheld unit and whilst it works a charm, its a bit lame to not try and get it sorted properly.
-
@JDMDingo said in Force HDMI over Raspberry Pi Official LCD Screen:
Also there is a typo in the original post. When you edit the /etc/profile.d/10-*****.sh, it should be:
# switch between LCD and HDMI /home/pi/initDisplay/initDisplay.sh sleep 5
instead of /home/pi/displayBoot/initDisplay.sh
I had not gotten it to work. When i boot up i now get a bunch of errors about initDisplay.
I'm going to try thes again when i have access to the pi. for now i'm doing what the poster above me was doing and just pulling out the gpio cables. :/ -
@JDMDingo said in Force HDMI over Raspberry Pi Official LCD Screen:
@sli4 let me know if you got it running. Did you make the files (initDisplay.sh, config_hdmi.txt and config_lcd.txt, hdmi.name) in windows? Is so you need to convert them by using:
sudo apt-get install dos2unix sudo dos2unix /home/pi/initDisplay/initDisplay.sh
I also converted the config files, however that was probably not necessary.
Also the original post is not really clear about the configs. You copy all the text from config.txt and paste it into config_hdmi and config_lcd. Inside config_hdmi.txt scroll down untill you see “#hdmi_drive=2” and remove “#” then scroll to the bottom and add “ignore_lcd=1”. In config_lcd.txt scroll to the bottom and add “lcd_rotate=2”.
This is the clearest part of the thread. Thank you. I was getting very confused at the start.
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.