git clone https://github.com/ksv1986/luvcview
cd luvcview
View the usage of luvcview:
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
2.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:
2.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
2.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:
2.12 WiringPi and Python Wrapper
2.13 Switch audio default output device
2.13.1 View the current default output device
On the terminal of the non-root user, enter the following command:
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
2.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%
2.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
2.13.4 View settings have taken effect
cat /var/lib/pulse/*-default-sink
2.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.
2.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:[email protected]:554/live/main" ! rtph264depay ! decodebin ! rkximagesink
Change the address after rtsp:// to the real address.
2.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:
2.16 Screen saver and auto sleep related settings
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.
2.17 Install Scratch
enter the following command:
sudo apt-get install scratch:arm64
2.18 Install Arduino IDE
enter the following command:
sudo apt-get install arduino:arm64
2.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/
2.20 Login to the desktop as the root user
Edit the /root/.profile file:
Replace with the following:
if [ -n "$BASH_VERSION" ]; then
if [ -f "$HOME/.bashrc" ]; then
. "$HOME/.bashrc"
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
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:
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
3 Update Log
3.1 August-23-2018