Simple RPF Touchscreen Zynthian

From ZynthianWiki
Jump to: navigation, search

How to get Zynthian working with a minimal amount of parts and no rotary encoders, no soldering etc., using the Official Raspberry Pi Foundation 7" Touchscreen.

This page is still being developed. Still trying to get it to work, and get these instructions exactly correct. Use at your own risk. Please edit this page if you have corrections. The Zynthian SD image won’t work without a proper audio device (DAC). The RBPi integrated “audio device” is not suitable because it sounds poor and has latency. The SD image is pre-configured to work with HifiBerry DAC+, although you can use any DAC that works with RBPi (i.e. any I2S device). These instructions will attempt to configure the Zynthian image to work with the RBPi integrated “audio device” (even though it has poor performance) or an inexpensive USB audio adapter.

Forum posting on this topic: https://discourse.zynthian.org/t/official-rbpi-touchscreen-7/430/23

Parts:

  • RASPBERRY PI 3 MODEL B $35 MCM Part #83-17300
  • RASPBERRY PI TOUCH DISPLAY $60 MCM Part #83-16872
  • 5.1VDC 2.5A Regulated AC Power Adapter $5.99 MCM Part #28-19338
  • MicroSD Card 16GB or larger
  • USB Audio Adapter based on the CM109 (Google: usb sound card cm109)

(also you should use/borrow a USB or Bluetooth keyboard, and an optional USB or Bluetooth mouse - temporarily to configure software)

Setup

  1. Download “Gorgona” SD Image for Zynthian for RBPi3 (8 GB) (you need bittorrent software (free) to download this)
  1. Flash the software on to the MicroSD card using Etcher https://etcher.io/ (free software works on Mac, Windows or Linux)
  2. Enable SSH by placing a file named ssh, without any extension, onto the boot partition of the MicroSD card. (The only "folder" you see if you view the contents of the SDcard on a PC)
  3. Connect the touch display to the Raspberry Pi using the included instructions
  4. Insert the MicroSD card into the Raspberry Pi
  5. Connect the Raspberry Pi to your local router using a Ethernet cable (or connect using WiFi - see below)
  6. Connect the power Adapter to the Raspberry Pi and plug it into the wall.
  7. The Raspberry Pi will boot up Zynthian.
  8. To configure, connect to Zynthian using a web browser.

Connecting to your Zynthian box http://wiki.zynthian.org/index.php/Accessing_Zynthian_from_your_computer

Configure Zynthian software

Use a web browser to access your Zynthian box's admin web page . Depending on your setup you might try to just use http://zynthian.local/ - if that doesn't work You need to enter the IP address of your Zynthian.

  1. Login to your Zynthian's admin webpage (password: raspberry)

ZynLogin.png

  1. Change the display to Generic HDMI, and set lcd_rotate=2 in the Config.

HDMI.JPG

  1. Change the Audio device to USB device. Need to provide the proper device name in the Jackd Options: replace hw:0 with the correct device name. Find the device name by giving the Linux command: aplay -L at the command line

ZynAudio.png

  1. Change the Wiring to DUMMIES

ZynWiring.png

- update zynthian software from the admin menu
- update zynthian library from the admin menu
- restart GUI (or reboot) from the admin menu
cd /zynthian/zynthian-sys/scripts
./update_zynthian.sh
./update_zynthian.sh        (yes run it twice)
./update_zynthian_data.sh

Step 1: Edit fb1 to fb0 in all these files:

nano /etc/systemd/system/zynthian.service
nano /zynthian/zynthian-sys/sbin/splash-screen.sh
nano /zynthian/zynthian-sys/sbin/zynthian.sh
nano /zynthian/zynthian-ui/zynthian.sh
nano /zynthian/zynthian-ui/zynthian_gui_config.py

Step 2: Edit boot/config.txt

nano /boot/config.txt

Edit the following lines according to your screen or set to None and it will auto detect. Try None first if that does not work then put in screen width and height.

framebuffer_width=1024
framebuffer_height=600

comment out both lines

#dtoverlay=pitft28-capacitive,rotate=90,speed=32000000,fps=20
#dtoverlay=pitft28-resistive,rotate=90,speed=32000000,fps=20

If you are running the HDMI screen from the USB port add this line to the end of the file. changes the output voltage on all 4 usb combined from 600mA to double that, 1200mA. which is need for external hd or powering hdmi monitors. Note use a 2A power supply or greater.

max_usb_current=1

Add those lines at the end of the file suggested by the manufacture if None or framebuffer settings from above did not work. For example: 7" Waveshare display - the values below should be adjusted according to your screen

hdmi_goup=2
hdmi_mode=1
hdmi_mode=87
hdmi_cvt 1024 600 60 6 0 0 0

Step 3: Edit Configure X11

nano /etc/X11/xorg.conf.d/99-pitft.conf

edit the file to look like this:

Section "Device"
Identifier "HDMI"
Driver "fbdev"
Option "fbdev" "/dev/fb0"
EndSection

Step 4: Reboot

shutdown -r now

Alternate set of instructions

  • If you do not have an Ethernet cable connection to the Internet, configure WiFi by (How to do this?).
  1. use a program like PuTTY on a PC to connect to the Pi via ssh. username: root, password: raspberry
  2. Ensure the Raspbian operating system is up to date by connecting your Pi to the internet and running the following commands in the terminal:
sudo apt-get update
sudo apt-get upgrade
sudo rpi-update

Install a text editor

apt-get install nano

1. Update

   cd /zynthian/zynthian-sys; git checkout .
   cd /zynthian/zynthian-ui; git checkout .
   cd /zynthian/zynthian-sys/scripts/
   ./update_zynthian.sh
   ./update_zynthian.sh #Yes twice - first run returns an error on a fresh installation
   ./update_zynthian_data.sh
   ./update_zynthian_recipes.sh
   ./update_zynthian_sys.sh

2. Edit fb1 to fb0 in all three files:

nano /etc/systemd/system/zynthian.service
nano /zynthian/zynthian-sys/sbin/splash-    screen.sh
nano /zynthian/zynthian-sys/scripts/zynthian_envars.sh

3. Also here:

nano /zynthian/zynthian-sys/etc/systemd/zynthian.service
# Find and modify the following line  
Environment=FRAMEBUFFER=/dev/fb0

4. Edit boot/config.txt

nano /boot/config.txt

Edit the following lines according to your screen

framebuffer_width=1024
framebuffer_height=600

comment out both lines

#dtoverlay=pitft28-capacitive,rotate=90,speed=32000000,fps=20
#dtoverlay=pitft28-resistive,rotate=90,speed=32000000,fps=20

Add these lines at the end of the file (the values below should be adjusted according to your screen)

max_usb_current=1
hdmi_goup=2
hdmi_mode=1
hdmi_mode=87
hdmi_cvt 1024 600 60 6 0 0 0

5. Configure X11

cd /etc/X11/xorg.conf.d/

remove all files except 99-pitft.conf

edit the config

nano 99-pitft.conf

the file should look like this

Section "Device"
  Identifier "HDMI"
  Driver "fbdev"
  Option "fbdev" "/dev/fb0"
EndSection

6. In order to increase font size:

   nano /zynthian/zynthian-ui/zynthian_gui_config.py


Find and modify the following lines

   topbar_height=48
   font_topbar=(font_family,18)
   font_listbox=(font_family,16)
   font_ctrl_title_maxsize=18