RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login
    Please do not post a support request without first reading and following the advice in https://retropie.org.uk/forum/topic/3/read-this-first

    HDMI not working on TV when hooked to official "7 PI screen

    Scheduled Pinned Locked Moved Help and Support
    7 Posts 4 Posters 3.9k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • W
      walkonatyclb
      last edited by

      Hi I got the official 7 inch pi screen hooked up to my pie 3. When I hook my HDMI to my TV it stays lit up on the screen hooked to the pie. Just like the audio option in retro pie can I choose somewhere use HDMI connection if it's plugged in somewhere?

      Thanks.

      1 Reply Last reply Reply Quote 0
      • H
        Hyell
        last edited by

        Hello,
        I have the same issue with LCD screen.

        You have to change /boot/config.txt file.
        and had : ignore_lcd=1 to use HDMI.

        I have write a little script to automaticly detect HDMI plug. I'm at work for the moment, I can upload the script later If you want.

        1 Reply Last reply Reply Quote 0
        • W
          walkonatyclb
          last edited by

          OK and tell me how to input it. I'm a newbie.

          1 Reply Last reply Reply Quote 0
          • H
            Hyell
            last edited by

            Ok,
            In first you must copy your config.txt.

            cd /boot
            sudo cp config.txt config_hdmi.txt
            sudo cp config.txt config_lcd.txt
            

            config_hdmi.txt is for.. your hdmi config (put hdmi_drive=2 and ignore_lcd=1)
            config_lcd.txt is for your lcd config (put lcd_rotate=2)

            create script file :

            cd /home/pi
            vi initDisplay.sh
            

            copy :

            #!/usr/bin/env bash
            
            rm -f hdmi.name
            tvservice -n 2>hdmi.name
            HDMI_NAME=`cat hdmi.name`
            echo $HDMI_NAME
            if [ "$HDMI_NAME" == "[E] No device present" ]; then
            	LCD_ON=`cat /boot/config.txt | grep "hdmi_drive=2"`
            	if [ $LCD_ON == "hdmi_drive=2" ]; then
            			echo "reboot avec la configuration LCD"
            			sudo rm -f /boot/config.txt
            			sudo cp /boot/config_lcd.txt /boot/config.txt
            			#sudo cp /usr/share/alsa/alsa.conf.lcd /usr/share/alsa/alsa.conf
            			sudo reboot -n
            	fi
            else
            	HDMI_ON=`cat /boot/config.txt | grep "lcd_rotate=2"`
            	echo $HDMI_ON
            	if [ $HDMI_ON == "lcd_rotate=2" ]; then
            			echo "reboot avec la configuration HDMI"
            			sudo rm -f /boot/config.txt
            			sudo cp /boot/config_hdmi.txt /boot/config.txt
            			#sudo cp /usr/share/alsa/alsa.conf.hdmi /usr/share/alsa/alsa.conf
            			sudo reboot -n
            	fi
            fi
            

            give execution rigth to the script :

            sudo chmod 755 initDisplay.sh
            

            Launch script at Pi boot.
            You can add the script in this file :
            /etc/profile.d/10-emulationstation.sh

            /home/pi/initDsiplay
            sleep 5
            [ "`tty`" = "/dev/tty1" ] && emulationstation
            

            How it's work :
            tvservice -n check if you got a HDMI plug.
            if yes, it's check if you got lcd_rotate=2 on your config.txt file. if yes, it copy the hdmi config.txt and reboot pi with good settings.
            It's the same for LCD display.

            it's not a perfect solution, but it's working fine for me.

            Note : you can also change audio conf.
            Note 2 : I use lcd_rotate=2 and hdmi_drive=2, you can change it by : "HDMI_CONFIG" and "LCD_CONFIG" if you put these keyword on the good config_display.txt :)

            1 Reply Last reply Reply Quote 1
            • L
              Loatman
              last edited by

              I had the same issue. I did something very low tech as a solution. if you disconnect power to the screen (i.e. remove the jumper), the signal will go to the TV. Promise :-). I put a rocker switch on the power cable as a "display" switch. So when I use the screen, the switch is powered on. When I want to use the HDMI to the TV, i hit the rocker switch (cutting power to the Pi Screen) and the signal goes to the HDMI cable. It is not very techie, but it works well and the display rocker switch works every time. Let me know if you want me to post pics. Enjoy the day!

              1 Reply Last reply Reply Quote 0
              • W
                walkonatyclb
                last edited by

                I was Googling and see a lot of electrical rocker switches. Any suggestions?

                Thank you

                S 1 Reply Last reply Reply Quote 0
                • S
                  slajerek @walkonatyclb
                  last edited by slajerek

                  Thanks for the script. I made some tweaks, put it in /opt/initDisplay/initDisplay.sh and start it via /etc/rc.local instead. I added a check to not do endless loop if something breaks, so for the second time when PI is booted the configuration is not checked. In addition if there's a file called /opt/initDisplay/skipcheck the check is also not performed, plus I added delay of 3 seconds before reboot. So if something is wrong, user is able to quickly SSH into the PI and make it skip the script on next reboot.

                  Note that now script checks if below lines exist in /boot/config.txt to distinguish which config is present:

                  for HDMI: # this is config HDMI
                  for LCD: # this is config LCD

                  I added that lines in first line of the config. Here's tweaked script:

                  #!/usr/bin/env bash
                  
                  ROOT_FOLDER=/opt/initDisplay
                  
                  if [ -f $ROOT_FOLDER/skipcheck ]; then
                          exit 0
                  fi
                  
                  if [ -f $ROOT_FOLDER/justbooted ]; then
                          rm $ROOT_FOLDER/justbooted
                          exit 0
                  fi
                  
                  timeout=3
                  
                  rm -f hdmi.name
                  tvservice -n > $ROOT_FOLDER/hdmi.name 2>&1
                  HDMI_NAME=`cat $ROOT_FOLDER/hdmi.name`
                  
                  echo $HDMI_NAME
                  if [ "$HDMI_NAME" == "[E] No device present" ]; then
                          LCD_ON=`cat /boot/config.txt | grep "# this is config HDMI"`
                          if [ "$LCD_ON" == "# this is config HDMI" ]; then
                                          echo "reboot to configuration LCD, press ESC to cancel"
                                          sudo rm -f /boot/config.txt
                                          sudo cp /boot/config_lcd.txt /boot/config.txt
                                          #sudo cp /usr/share/alsa/alsa.conf.lcd /usr/share/alsa/alsa.conf
                  
                                          while [ "$timeout" -gt "0" ]; do
                                                  echo -n " $timeout"
                                                  if read -n1 -t1 -r -s x; then
                                                          echo "  ...canceled"
                                                          exit 0
                                                  fi
                                                  let timeout--
                                          done
                  
                                          echo "skip reboot" > $ROOT_FOLDER/justbooted
                  
                                          echo "  Reboot now!"
                                          sudo reboot -n
                          else
                                  echo "LCD/HDMI configuration OK (no HDMI)"
                          fi
                  else
                          HDMI_ON=`cat /boot/config.txt | grep "# this is config LCD"`
                          echo $HDMI_ON
                          if [ "$HDMI_ON" == "# this is config LCD" ]; then
                                          echo "reboot to configuration HDMI, press ESC to cancel"
                                          sudo rm -f /boot/config.txt
                                          sudo cp /boot/config_hdmi.txt /boot/config.txt
                                          #sudo cp /usr/share/alsa/alsa.conf.hdmi /usr/share/alsa/alsa.conf
                  
                                          while [ "$timeout" -gt "0" ]; do
                                                  echo -n " $timeout"
                                                  if read -n1 -t1 -r -s x; then
                                                          echo "  ...canceled"
                                                          exit 0
                                                  fi
                                                  let timeout--
                                          done
                  
                                          echo "skip reboot" > $ROOT_FOLDER/justbooted
                  
                                          echo "  Reboot now!"
                                          sudo reboot -n
                  
                          else
                                  echo "LCD/HDMI configuration OK (HDMI $HDMI_NAME)"
                          fi
                  fi
                  
                  1 Reply Last reply Reply Quote 2
                  • First post
                    Last post

                  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.