Tuesday, July 27, 2021

Raspberry Pi 4B Composite Video Output

    Raspberry Pi is a single board computing product which was developed with a focus to improving computing skills among school children's in developing countries. Its a really good platform to learn hardware, coding, Linux and much more.


    Raspberry pi board supports HDMI and VGA ports to connect to display units. In older models there is a separate RCA socket to pull composite Video output . While on Raspberry Pi4 B and later versions the RCA socket was dropped and composite video is forwarded along with audio socket on the 4 pole TRRS socket. But in Pi Zero there is an unpopulated header labelled "TV" which outputs composite video.

    Raspberry Pi can be used as a low cost desktop by adding a display unit like Monitor and input interface units like Mouse and Keyboard. Now a days HDMI ports are commonly found in most of the digital TV's and Monitors but there are still scenarios where people cant afford a digital TV and still managing with old analog TV. Here we will be discussing on how to use the composite video output from Pi and display it on old analog TV with at least having RCA AV input.

    In order to connect Raspberry Pi 4B with analog TV, we need one TRRS to RCA converter cable and few changes in display settings of Pi. The converter cable can be easily available from online stores but it can be easily built using an old 3.5 mm mobile phone earphone and three RCA plug. First we will see how to make one TRRS to RCA connector and its connection.

TRRS to RCA connection (Only Right Channel Audio used)

Next we will discuss how to configure Raspberry Pi 4B to make composite video output. HDMI is the default video output port in an out of box Pi. To enable forced output in composite port we need to do some changes in the config.txt file of Pi. We can do it in multiple ways.

1. Directly modifying the config.txt file in SD card by inserting it in another computer.
  • Open the folder the boot partition and open "config.txt" file.
  • Add a line "enable_tvout=1" without quotes and save the file.
  • Insert the SD card in Pi, connect the RCA connector to TV and TRRS plug to Pi.
  • Power on the TV and then Power on the Pi.
2. Using SSH
  • Create a blank file with name "ssh" without quotes and extension in boot partition folder.
  • Insert the SD card in Pi, connect the RCA connector to TV and TRRS plug to Pi.
  • Power on the TV and then Power on the Pi.
  • Open CMD in windows and SSH to Pi.
    • ssh username@IP                    eg: ssh pi@192.168.45.149
    • Enter user password and login
  • Open config.txt file as su using command sudo nano /boot/config.tx.
  • Add a line "enable_tvout=1" without quotes.
  • Save the file using Ctrl + O
  • Type Y and click Enter
  • Exit Nano using Ctrl +X
  • Reboot the Pi using command reboot
  • Pi will restart and you can see display on screen.
3. Using GUI raspi-config.
  • SSH to Pi using above method.
  • Open raspi-config as su using sudo raspi-config
  • Go to Advanced Options -> HDMI/Composite and select V2 Enable composite
  • Seclect 'OK' using left arrow key and click Enter.
  • Confirm by clicking 'OK' again.
  • Reboot the Pi.

Screen resolution can be also adjusted as per requirement using GUI once OSS screen starts appearing on Display. Also if above method fails to display, we can add additional command to set the type of TV signal which Pi need to generate to make it compatible with world TV standards like PAL and NTSC.

For the we need to add another command line in config.txt file in addition to above mentioned one using same procedure.

sdtv_mode=0 the value can be changed according to type of TV system used.

sdtv_mode settings




No comments:

Post a Comment