Difference between revisions of "Template:UbuntuFocalDesktop-Common"

From FriendlyELEC WiKi
Jump to: navigation, search
(updated by API)
 
(updated by API)
 
(5 intermediate revisions by the same user not shown)
Line 5: Line 5:
 
<br/>
 
<br/>
 
Root:<br/>
 
Root:<br/>
&nbsp;&nbsp;&nbsp;&nbsp;the root user account is disabled by default, you may configure the root password through the 'sudo passwd root' command.
+
&nbsp;&nbsp;&nbsp;&nbsp;User Name: root<br/>
 +
&nbsp;&nbsp;&nbsp;&nbsp;Password: fa<br/>
 +
===Turn off auto-sleep and screen saver===
 +
<syntaxhighlight lang="bash">
 +
sed -i 's/enableIdlenessWatcher=true/enableIdlenessWatcher=false/g' .config/lxqt/lxqt-powermanagement.conf
 +
echo "mode:          off" > ~/.xscreensaver
 +
sudo reboot
 +
</syntaxhighlight>
 +
===Set up auto login===
 +
Create dir and file:
 +
<syntaxhighlight lang="bash">
 +
sudo mkdir /etc/sddm.conf.d
 +
sudo vim /etc/sddm.conf.d/autologin
 +
</syntaxhighlight>
 +
The contents of the autologin file:
 +
<syntaxhighlight lang="bash">
 +
[Autologin]
 +
User=pi
 +
Session=lxqt.desktop
 +
Relogin=false
 +
</syntaxhighlight>
 +
Reboot.
 +
===Test Video Playback===
 +
* mpv
 +
<syntaxhighlight lang="bash">
 +
mpv ~/Videos/demo.mp4
 +
</syntaxhighlight>
 +
* GStreamer Command Line
 +
<syntaxhighlight lang="bash">
 +
gst-play-1.0 ~/Videos/demo.mp4 --videosink=xvimagesink
 +
</syntaxhighlight>
 +
For more details, please search and refer to the official documentation <<rockchip_user_guide_linux_gstreamer_en.pdf>>.
 +
===Audio Settings===
 +
====Switching Audio Output Channel====
 +
To switch the audio output channel, go to '''"System Tools"''' -> '''"Qterminal"''',enter the following command in the terminal to check available audio output channels:
 +
<syntaxhighlight lang="bash">
 +
export XDG_RUNTIME_DIR=/run/user/1000
 +
pactl list sinks short
 +
</syntaxhighlight>
 +
On the NanoPC-T6, the results appear as follows. The string beginning with alsa_output in the second column is the value we will use:
 +
<syntaxhighlight lang="bash">
 +
0      alsa_output.platform-dp0-sound.stereo-fallback  module-alsa-card.c      s16le 2ch 44100Hz      SUSPENDED
 +
1      alsa_output.platform-hdmi0-sound.stereo-fallback        module-alsa-card.c      s16le 2ch 48000Hz      SUSPENDED
 +
2      alsa_output.platform-hdmi1-sound.stereo-fallback        module-alsa-card.c      s16le 2ch 44100Hz      SUSPENDED
 +
3      alsa_output.platform-rt5616-sound.multichannel-output  module-alsa-card.c      s16le 2ch 44100Hz      SUSPENDED
 +
</syntaxhighlight>
 +
Use an editor to modify the PulseAudio configuration file:
 +
<syntaxhighlight lang="bash">
 +
sudo vim /etc/pulse/default.pa
 +
</syntaxhighlight>
 +
If you need to set the audio output to HDMI1, replace the following line at the end of the file:
 +
<syntaxhighlight lang="bash">
 +
set-default-sink alsa_output.platform-hdmi0-sound.stereo-fallback
 +
</syntaxhighlight>
 +
with:
 +
<syntaxhighlight lang="bash">
 +
set-default-sink alsa_output.platform-hdmi1-sound.stereo-fallback
 +
</syntaxhighlight>
 +
Save the file and restart the system for the changes to take effect, or restart the PulseAudio service:
 +
<syntaxhighlight lang="bash">
 +
pulseaudio -k
 +
pulseaudio --start
 +
</syntaxhighlight>
 +
====Multi-Device Audio Output====
 +
Edit the PulseAudio configuration file:
 +
<syntaxhighlight lang="bash">
 +
sudo vim /etc/pulse/default.pa
 +
</syntaxhighlight>
 +
Scroll to the end of the file, delete any line that starts with set-default-sink, and add the following lines at the end:
 +
<syntaxhighlight lang="bash">
 +
load-module module-combine-sink sink_name=combined slaves=alsa_output.platform-hdmi0-sound.stereo-fallback,alsa_output.platform-hdmi1-sound.stereo-fallback
 +
set-default-sink combined
 +
</syntaxhighlight>
 +
Restart the system. With this configuration, audio will output simultaneously to both the HDMI0 and HDMI1 interfaces.

Latest revision as of 09:52, 1 November 2024

1 Account & Password

Regular Account:
    User Name: pi
    Password: pi

Root:
    User Name: root
    Password: fa

2 Turn off auto-sleep and screen saver

sed -i 's/enableIdlenessWatcher=true/enableIdlenessWatcher=false/g' .config/lxqt/lxqt-powermanagement.conf
echo "mode:           off" > ~/.xscreensaver
sudo reboot

3 Set up auto login

Create dir and file:

sudo mkdir /etc/sddm.conf.d
sudo vim /etc/sddm.conf.d/autologin

The contents of the autologin file:

[Autologin]
User=pi
Session=lxqt.desktop
Relogin=false

Reboot.

4 Test Video Playback

  • mpv
mpv ~/Videos/demo.mp4
  • GStreamer Command Line
gst-play-1.0 ~/Videos/demo.mp4 --videosink=xvimagesink

For more details, please search and refer to the official documentation <<rockchip_user_guide_linux_gstreamer_en.pdf>>.

5 Audio Settings

5.1 Switching Audio Output Channel

To switch the audio output channel, go to "System Tools" -> "Qterminal",enter the following command in the terminal to check available audio output channels:

export XDG_RUNTIME_DIR=/run/user/1000
pactl list sinks short

On the NanoPC-T6, the results appear as follows. The string beginning with alsa_output in the second column is the value we will use:

0       alsa_output.platform-dp0-sound.stereo-fallback  module-alsa-card.c      s16le 2ch 44100Hz       SUSPENDED
1       alsa_output.platform-hdmi0-sound.stereo-fallback        module-alsa-card.c      s16le 2ch 48000Hz       SUSPENDED
2       alsa_output.platform-hdmi1-sound.stereo-fallback        module-alsa-card.c      s16le 2ch 44100Hz       SUSPENDED
3       alsa_output.platform-rt5616-sound.multichannel-output   module-alsa-card.c      s16le 2ch 44100Hz       SUSPENDED

Use an editor to modify the PulseAudio configuration file:

sudo vim /etc/pulse/default.pa

If you need to set the audio output to HDMI1, replace the following line at the end of the file:

set-default-sink alsa_output.platform-hdmi0-sound.stereo-fallback

with:

set-default-sink alsa_output.platform-hdmi1-sound.stereo-fallback

Save the file and restart the system for the changes to take effect, or restart the PulseAudio service:

pulseaudio -k
pulseaudio --start

5.2 Multi-Device Audio Output

Edit the PulseAudio configuration file:

sudo vim /etc/pulse/default.pa

Scroll to the end of the file, delete any line that starts with set-default-sink, and add the following lines at the end:

load-module module-combine-sink sink_name=combined slaves=alsa_output.platform-hdmi0-sound.stereo-fallback,alsa_output.platform-hdmi1-sound.stereo-fallback
set-default-sink combined

Restart the system. With this configuration, audio will output simultaneously to both the HDMI0 and HDMI1 interfaces.