Difference between revisions of "Template:FriendlyDesktop-Contents"
(updated by API) |
(updated by API) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 69: | Line 69: | ||
===4K Video Playing=== | ===4K Video Playing=== | ||
====Play with Qt Player with Hardware Decoding==== | ====Play with Qt Player with Hardware Decoding==== | ||
− | FriendlyDesktop has integrated a Qt5-VideoPlayer utility. This utility has support for Rockchip's gstreamer plug-in and supports 4K video playing with hardware decoding. You can start it by following the steps below: | + | FriendlyDesktop has integrated a [https://github.com/friendlyarm/rk-player-qt Qt5-VideoPlayer] utility. This utility has support for Rockchip's gstreamer plug-in and supports 4K video playing with hardware decoding. You can start it by following the steps below: |
On FriendlyDesktop's main window open "Sound & Video" and click on "Qt5-VideoPlayer".<br /> | On FriendlyDesktop's main window open "Sound & Video" and click on "Qt5-VideoPlayer".<br /> | ||
<br /> | <br /> | ||
On the player's main window click on the bottom left's "Open" button to load a video file and double-click on its name on the file list to start video playing. Here is how it looks like. You can set the display window to full screen and adjust the volume:<br /> | On the player's main window click on the bottom left's "Open" button to load a video file and double-click on its name on the file list to start video playing. Here is how it looks like. You can set the display window to full screen and adjust the volume:<br /> | ||
[[File:Friendlydesktop-player.jpg|frameless|480px]]<br /> | [[File:Friendlydesktop-player.jpg|frameless|480px]]<br /> | ||
+ | Qt5-VideoPlayer source code: https://github.com/friendlyarm/rk-player-qt<br /> | ||
====Play with Linux Command==== | ====Play with Linux Command==== | ||
Line 164: | Line 165: | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
pactl set-default-sink alsa_output.platform-rt5651-sound.stereo-fallback | pactl set-default-sink alsa_output.platform-rt5651-sound.stereo-fallback | ||
− | pactl set- | + | </syntaxhighlight> |
+ | Set default volume to 20%: | ||
+ | <syntaxhighlight lang="bash"> | ||
+ | pactl -- set-sink-volume alsa_output.platform-rt5651-sound.stereo-fallback 20% | ||
</syntaxhighlight> | </syntaxhighlight> | ||
====Set hdmi as the default output device==== | ====Set hdmi as the default output device==== | ||
Line 170: | Line 174: | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
pactl set-default-sink alsa_output.platform-hdmi-sound.stereo-fallback | pactl set-default-sink alsa_output.platform-hdmi-sound.stereo-fallback | ||
− | |||
</syntaxhighlight> | </syntaxhighlight> | ||
==== View settings have taken effect ==== | ==== View settings have taken effect ==== |
Latest revision as of 06:54, 12 December 2022
Contents
- 1 Account & Password
- 2 WiFi Connection
- 3 HDMI/DP LCD Resolution
- 4 Adjust HDMI overscan
- 5 eDP LCD Display Rotation
- 6 Test OpenGL ES
- 7 4K Video Playing
- 8 Work with USB Camera
- 9 File Transfer with Bluetooth
- 10 Install OpenCV
- 11 Develop Qt Applications
- 12 WiringPi and Python Wrapper
- 13 Switch audio default output device
- 14 Play RTSP video stream (or IP Camera)
- 15 Chromium web browser
- 16 Screen saver and auto sleep related settings
- 17 Install Scratch
- 18 Install Arduino IDE
- 19 Start the program automatically at startup
- 20 Login to the desktop as the root user
1 Account & Password
Regular Account:
User Name: pi Password: pi
Root:
User Name: root Password: fa
2 WiFi Connection
Click on the icon on the top right in the FriendlyDesktop's main window, select your wanted WiFi hotspot and proceed with prompts
3 HDMI/DP LCD Resolution
Open the system's menu and go to Perferences -> Monitor Settings to customize your settings.
Recommended resolution: 1920x1080@60Hz
4 Adjust HDMI overscan
Open the command line terminal and enter the command to operate, Note:
1) You need to login to the desktop;
2) If you are using ssh terminal, please use the same username as the desktop login. The default is pi. You cannot use the root user. you also need to assign the DISPLAY variable:
export DISPLAY=:0.0
4.1 Query which resolutions the display supports
xrandr -q
4.2 Set resolution
For example set to 1920X1080@60Hz:
xrandr --output HDMI-1 --mode 1920x1080 --refresh 60
4.3 Adjust the HDMI overscan
For example, the transformation scaling horizontal coordinates by 0.8, vertical coordinates by 1.04 and moving the screen by 35 pixels right and 19 pixels down:
xrandr --output HDMI-1 --transform 0.80,0,-35,0,1.04,-19,0,0,1
4.4 Automatic adjustment at boot
Edit ~/.config/autostart/lxrandr-autostart.desktop,Write the full xrandr command to the key at the beginning of "Exec= as shown below:
[Desktop Entry] Type=Application Name=LXRandR autostart Comment=Start xrandr with settings done in LXRandR Exec=sh -c 'xrandr --output HDMI-1 --mode 1920x1080 --refresh 50 --transform 1.04,0,-35,0,1.05,-30,0,0,1' OnlyShowIn=LXDE
5 eDP LCD Display Rotation
If you want to rotate an eDP LCD's display you can do it by commanding "xrotate.sh" to rotate its display to 90/180/270 degrees. You can rotate display clockwise by 90 degrees by running the following command as root. This command calls lightdm to make your change effective immediately:
sudo xrotate.sh -m CW -r
For more details about its options you can run "xrotate -h".
Note: this command doesn't support HDMI display's rotation. If you want to rorate an HDMI's display you need to refer to X11's tech documents and make changes in "/etc/X11/xorg.conf".
Note: when you play a video with hardware decoding your player's display window doesn't rotate with your LCD's display
6 Test OpenGL ES
You can test it by clicking on the Terminator icon to start a commandline utility in the System Tools and run the following commands:
taskset -c 4-5 glmark2-es2
7 4K Video Playing
7.1 Play with Qt Player with Hardware Decoding
FriendlyDesktop has integrated a Qt5-VideoPlayer utility. This utility has support for Rockchip's gstreamer plug-in and supports 4K video playing with hardware decoding. You can start it by following the steps below:
On FriendlyDesktop's main window open "Sound & Video" and click on "Qt5-VideoPlayer".
On the player's main window click on the bottom left's "Open" button to load a video file and double-click on its name on the file list to start video playing. Here is how it looks like. You can set the display window to full screen and adjust the volume:
Qt5-VideoPlayer source code: https://github.com/friendlyarm/rk-player-qt
7.2 Play with Linux Command
You can play it by running the following command in a commandline utility:
gst-player.sh
By default its voice will be output to audio jack. You can locate this script by commanding "which gst-player.sh". You can customize its behavior by making changes in this script.
8 Work with USB Camera
Insert the USB camera (such as Logitech C270/C920) into the development board. Double click the "USB Camera" icon on desktop will pop up the luvcview gui (need to use the 2019/05/11+ version firmware).
the luvcview tool is an open source software that you can compile yourself:
git clone https://github.com/ksv1986/luvcview cd luvcview make
View the usage of luvcview:
./luvcview -h
Parameter Description:
luvcview version 0.2.1 Usage: uvcview [-h -d -g -f -s -i -c -o -C -S -L -l -r] -h print this message -d /dev/videoX use videoX device -g use read method for grab instead mmap -w disable SDL hardware accel. -f video format default jpg others options are yuv jpg -i fps use specified frame interval -s widthxheight use specified input size -c enable raw frame capturing for the first frame -C enable raw frame stream capturing from the start -S enable raw stream capturing from the start -o avifile create avifile, default video.avi -L query valid video formats -l query valid controls and settings -r read and set control settings from luvcview.cfg
To preview USB camera (640x360@30fps), you can use the following command:
./luvcview -d /dev/video8 -i 30 -s 640x360
As you can see from the output of luvcview, hardware acceleration has been turned on:
pi@NanoPC-T4:/etc/xrdp$ luvcview -d /dev/video8 -i 30 -s 640x360 luvcview version 0.2.1 interval: 30 fps Hardware acceleration available video /dev/video8
9 File Transfer with Bluetooth
Click on the "Preferences" in the main window's menu to start Bluetooth Manager and click on "Search" to search surrounding Bluetooth devices. Click on your wanted device, pair the device with your board and you will be able to do file transfer, here is how it looks like:
10 Install OpenCV
OpenCV has been pre-installed in FriendlyCore/FriendlyDesktop (Version after 201905) and does not require manual installation.
Please refre this link: https://github.com/friendlyarm/install-opencv-on-friendlycore/blob/rk3399/README.md
11 Develop Qt Applications
FriendlyDesktop has a Qt 5.10.0 which supports RK3399's OpenGL ES and Gstreamer 1.0 hardware acceleration and a QtCreator IDE which is ready and can be used to compile and run applications. Here is how it looks like:
When running the Qt app, you need to specify the platform parameter to xcb as follows:
./HelloQt --platform xcb
12 WiringPi and Python Wrapper
13 Switch audio default output device
13.1 View the current default output device
On the terminal of the non-root user, enter the following command:
pactl info -vvv
The information displayed contains the following, indicating that the current audio output is directed to the headset:
Default Sink: alsa_output.platform-rt5651-sound.stereo-fallback
The information displayed contains the following, indicating that the current audio output is to HDMI:
Default Sink: alsa_output.platform-hdmi-sound.stereo-fallback
13.2 Set headphone jack as the default output device
On the terminal of the non-root user, enter the following command:
pactl set-default-sink alsa_output.platform-rt5651-sound.stereo-fallback
Set default volume to 20%:
pactl -- set-sink-volume alsa_output.platform-rt5651-sound.stereo-fallback 20%
13.3 Set hdmi as the default output device
On the terminal of the non-root user, enter the following command:
pactl set-default-sink alsa_output.platform-hdmi-sound.stereo-fallback
13.4 View settings have taken effect
cat /var/lib/pulse/*-default-sink
13.5 Temporary switching during playback
This method is only valid for the current playback process:
Open the menu "Sound & Video" -> "PulseAudio Volume Control", click the "Built-in Audio Stereo" button on the interface to switch between different output devices, such as switching between HDMI and headphone jack.
14 Play RTSP video stream (or IP Camera)
Open a command line terminal and enter the following command:
gst-launch-1.0 rtspsrc location="rtsp://admin:12345@192.168.1.120:554/live/main" ! rtph264depay ! decodebin ! rkximagesink
Change the address after rtsp:// to the real address.
15 Chromium web browser
Chromium web browser has enabled hardware acceleration by default, supports WebGL, and can view hardware acceleration details by entering the URL chrome://gpu, as shown below:
The screen saver configuration file is /etc/xdg/autostart/xset_command.desktop. The default factory settings are that the screen saver and DPMS are both closed. You can change the configuration by modifying this file.
17 Install Scratch
enter the following command:
sudo apt-get install scratch:arm64
18 Install Arduino IDE
enter the following command:
sudo apt-get install arduino:arm64
19 Start the program automatically at startup
Put the desktop file in the ~/.config/autostart/ directory, for example:
cp /usr/share/applications/org.qt-project.qtcreator.desktop ~/.config/autostart/
20 Login to the desktop as the root user
Edit the /root/.profile file:
sudo vim /root/.profile
Replace with the following:
if [ -n "$BASH_VERSION" ]; then if [ -f "$HOME/.bashrc" ]; then . "$HOME/.bashrc" fi fi if [ -d "$HOME/bin" ] ; then PATH="$HOME/bin:$PATH" fi
Run the following command to modify the lightdm configuration file and change the automatically logged-in user name to root:
sudo sed -i 's/autologin-user=pi/autologin-user=root/g' /usr/share/lightdm/lightdm.conf.d/20-defaultsession.conf
Run the reboot command to restart:
sudo reboot
If you want to log in, the desktop icons and configuration are the same as the pi user, you can copy the relevant directory from the /home/pi directory:
sudo rm -rf /root/Desktop /root/Pictures /root/.config sudo cp -af /home/pi/Desktop /home/pi/Pictures /home/pi/.config /root/ sudo chown root:root /root/Desktop /root/Pictures /root/.config