hdmi_group=2 - 指定 DMT 視訊格式
hdmi_mode=87 - 指定解析度,網路上查不到,估計是廠商
hdmi_timings=480 0 40 10 80 800 0 13 3 32 0 0 0 60 0 32000000 3
#dtoverlay=ads7846,cs=1,penirq=25,penirq_pull=2,speed=50000,keep_vref_on=0,swapx
dtoverlay=ads7846_waveshare - 掛載廠商提供的觸控驅動模組
hdmi_drive=1 -
display_rotate=3 - LCD轉270度
disable_splash=1 - 取消廠商開機畫面
關於觸控模組,需要從廠商網站下載,複製ads7846_waveshare.dtbo到overlay目錄中。
tc@piCorePlayer:~$ pcp bu - 備份資料檔
重開機可以看見漂亮的選單介面了!
不過發現點選觸控滑鼠游標會亂跑,參照網路上的說明需要對觸控校正。
tc@piCorePlayer:~$ sudo rm /usr/local/etc/pointercal - 刪除觸控校正舊資料
tc@piCorePlayer:~$ sudo TSLIB_FBDEVICE=/dev/fb0 TSLIB_TSDEVICE=/dev/input/event0 ts_calibrate - 觸控校正
tc@piCorePlayer:~$ sudo TSLIB_FBDEVICE=/dev/fb0 TSLIB_TSDEVICE=/dev/input/event0 ts_test - 觸控測試
新的pointercal產生,把它加入備份清單,修改/opt/.filelist
加入一行
/usr/local/etc/pointercal
tc@piCorePlayer:~$ pcp bu - 備份一下
檢視/usr/local/etc/init.d/pcp_startup.sh 搜尋jivelite發現以下幾行:
#-------------------------------------------------------------------------------
# Start Jivelite.
#-------------------------------------------------------------------------------
if [ "$JIVELITE" = "yes" ]; then
echo -n "${BLUE}Starting Jivelite...${NORMAL}"
eventno=$( cat /proc/bus/input/devices | awk '/FT5406 memory based drive
if [ x"" != x"$eventno" ]; then
export JIVE_NOCURSOR=1
export TSLIB_TSDEVICE=/dev/input/$eventno
export SDL_MOUSEDRV=TSLIB
export SDL_MOUSEDEV=$TSLIB_TSDEVICE
fi
export HOME=/home/tc
# Alternative jivelite script, mainly used for waveshare devices. Locat
if [ -x ${TCEMNT}/tce/jivelite.sh ]; then
sudo -E -b ${TCEMNT}/tce/jivelite.sh >/dev/null 2>&1
echo " ${GREEN}Done.${NORMAL}"
elif [ -x /opt/jivelite/bin/jivelite.sh ]; then
sudo -E -b /opt/jivelite/bin/jivelite.sh >/dev/null 2>&1
echo " ${GREEN}Done.${NORMAL}"
else
echo "${RED}There is a problem with the Jivelite installation. P
fi
有幾點要留意的是 這個程式會自動抓觸控的裝置,但是搜尋的是FT5406,不是Ads7846,想要改這行指令卻被防寫,不知道怎麼解開,網上其他人的建議是另外在建立一個jivelite.sh 在/mnt/mmcblk0p2/tce目錄中.
首先先了解觸控裝置是否被偵測到
tc@piCorePlayer:~$ cat /proc/bus/input/devices
I: Bus=0000 Vendor=0000 Product=0000 Version=0000
N: Name="ADS7846 Touchscreen"
P: Phys=spi0.1/input0
S: Sysfs=/devices/platform/soc/3f204000.spi/spi_master/spi0/spi0.1/input/input0
U: Uniq=
H: Handlers=mouse0 event0
B: PROP=0
B: EV=b
B: KEY=400 0 0 0 0 0 0 0 0 0 0
B: ABS=1000003
新增的jivelite.sh內容是從/opt/jivelite/bin目錄下複製而來,內容如下:
#!/bin/sh
export LOG=/var/log/jivelite.log
if [ -f /usr/local/sbin/config.cfg ]; then
source /usr/local/sbin/config.cfg
fi
if [ ! -z ${JL_FRAME_BUFFER} ]; then
export SDL_FBDEV=$JL_FRAME_BUFFER
echo "Using $SDL_FBDEV as frame buffer device." >> $LOG
fi
if [ -z ${JL_FRAME_RATE} ]; then
JL_FRAME_RATE=22
fi
export JIVE_FRAMERATE=$JL_FRAME_RATE
echo "Frame rate set to $JIVE_FRAMERATE frames per second." >> $LOG
if [ -z ${JL_FRAME_DEPTH} ]; then
JL_FRAME_DEPTH=32
fi
/usr/sbin/fbset -depth $JL_FRAME_DEPTH >> $LOG
echo "Frame buffer color bit depth set to $JL_FRAME_DEPTH." >> $LOG
if [ ! -z ${SDL_TOUCHSCREEN} ]; then
export JIVE_NOCURSOR=1
fi
export JIVE_NOCURSOR=1 - 隱藏滑鼠游標
export HOME=/home/tc
export SDL_VIDEODRIVER=fbcon
export SDL_FBDEV=/dev/fb0
export SDL_MOUSEDEV=/dev/input/event0 - 這裡的裝置號是先前偵測的數字
export SDL_MOUSEDRV=TSLIB
while true; do
sleep 3
/opt/jivelite/bin/jivelite >> $LOG 2>&1
done
|
隨著音樂的律動而變化,視覺效果真不錯! |
|
沒撥放音樂時換顯示日期和時間! |