Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Instruction Guide Using the Vivaldi browser for Local Display
#1
Update 20210311 - This guide was written specifically for moOde 7.0.1. With the advent of moOde 7.1.0 we find new versions of chromium-browser and vivaldi-stable have been issued. The eventual memory exhaustion problem has been demonstrated in moOde 7.1.0 with chromium-browser 84.0.4147.141, 84.0.4147.105-rpt3, 88.0.4324.187-rpt1. The problem has also been demonstrated with vivaldi-stable 3.6.2165.40-1. Therefore, at the present time, there is no reason to install Vivaldi. The solution must be found elsewhere.

Background

Some users of moOde 7.0.1 on an RPi3B+  with Local Display enabled and with an HDMI display (*not* the 7-in Touch Display or other non-HDMI display) have experienced a system "lock out" after a lengthy idling period.

At least one failure mode has been traced to the chromium browser package installed in 7.0.1. This browser is used as the local Web client in moOde and is responsible for rendering what is seen on the local display. When the local display is enabled, an initial chromium process is started and spawns 8 more processes to handle various browser tasks. After a lengthy period in pause/idle mode, the type=renderer chromium process unexpectedly starts consuming memory to the point where other processes, including the system scheduler, begin experiencing difficulty, leading ultimately to at least temporary catatonia.

The root cause of this behavior has not yet been determined. It was not experienced with moOde 6.7.1, which is based on an earlier version of Raspberry Pi OS which in turn includes an earlier version of the Chromium browser. Also, it has not been determined whether the behavior occurs on RPi4B models which have more memory than the RPi3B+ and, if it does, whether the system is able to heal itself when more headroom is available or simply takes longer to lock out.

In the meantime an experiment has suggested that using the Vivaldi browser instead of the Chromium browser as the local client may ameliorate the situation.

Vivaldi is a cross-platform browser based on the same Chromium engine used in the full Chromium browser. The two browsers use this engine in different ways, which gave rise to the experiment. Fortunately, the APIs and options are similar, so that the substitution is nearly a "drop in" replacement.

Installing Vivaldi in moOde

This procedure is benign in the sense that it does no irreversible harm to your moOde installation.

The steps are performed from the command line of the moOde player under test, which of course must be using an HDMI display for the Local Display. Best to stay in the home directory of user "pi" but that's not essential if you know what you're doing.

1. Install the sole missing dependency

Code:
sudo apt install font-liberation

2. Download the 68MB Vivaldi browser package

Code:
wget https://downloads.vivaldi.com/stable/vivaldi-stable_3.5.2115.87-1_armhf.deb

This is the current version at the time of writing, but it's always worth checking on the Vivaldi download page. It's the package named Linux DEB ARM in the pull-down menu.

Note: at the time of writing there is only one ARM package---"armhf" meaning 32-bit binary. That's the one you want even if in future they also offer a 64-bit version (unless of course you've rebuilt moOde as a 64-bit clean system, in which case you've got the chops to do all this yourself).

3. Install the package


Code:
sudo dpkg -i vivaldi-stable_3.5.2115.87-1_armhf.deb


4. Modify moOde to use the Vivaldi browser

- make a backup of /home/pi/.xinitrc so you can recover if needed. (The naked "cd" command ensures you are in the /home/pi directory)


Code:
cd
sudo cp .xinitrc .xinitrc.chromium


- as root and using your favorite text editor (for example, "sudo nano .xinitrc"), change the invocation of "chromium-browser" to "vivaldi-stable" in .xinitrc, so that the line reads (note this is a single line no matter how it is displayed here)


Code:
vivaldi-stable --app=http://localhost/ --window-size=$SCREENSIZE --window-position=0,0 --no-first-run -enable-features=OverlayScrollbar --disable-infobars --disable-session-crashed-bubble

5. Reboot for good luck, or at least disable and then re-enable the Local Display.

[If you decide to change back

6. Restoring the stock configuration

- save the modified .xinitrc for possible future use

Code:
cd
sudo mv .xinitrc .xinitrc.vivaldi

- copy the stock configuration back

Code:
cd
sudo cp .xinitrc.chromium .xinitrc

Like before, reboot or at least disable and then re-enable the Local Display.]


Exercise the new browser

Try all the usual functions and features. Try to reproduce the conditions in which you previously experienced "lock up." Report your experiences to the Forum.

If you're a bithead, you'll have compared the two browsers for number and types of processes spawned, for memory and CPU consumption, yada yada yada. They differ. In someways the Vivaldi processes seem to be "heavier". As well, the initial vivaldi process spawns not one but two type=renderer processes.  Nevertheless, they don't seem ever to start binging on system resources at least in my first, 10-hour experiment.
Reply
#2
Thanks Kent,
I'm installing right now,
3) forgot an "h" in
Code:
...armf.deb

should be
Code:
armhf.deb
Reply
#3
Oops. That's what I get for typing instead of copy/paste.

Fixed. Thanks,
Kent
Reply
#4
it does not work for me, it stays stuck here (see pic) if you can read it.


Attached Files Thumbnail(s)
   
Reply
#5
(01-10-2021, 09:19 PM)Alaini93 Wrote: it does not work for me, it stays stuck here (see pic) if you can read it.

I see I forgot that the work on the .xinitrc file must be done as root because of its permissions in a stock moOde install. Sigh. I've amended the guide accordingly.

However, because of this error on my part you should have received a "permission denied" error or something similar when you tried to save .xinitrc after editing it as user "pi". Did you? If so, what did you do then?

Your posted screen image suggests that you rebooted with either no .xinitrc file or an unreadable one, so that the local display client couldn't start.

Can you still see the moOde WebUI on a computer/phone/tablet? Can you still ssh into your player from another computer? --- the answer to both of these questions should be yes.

Assuming that I'm correct in my interpretation of what I see, then the remedy is to ssh into the moOde player and correct the .xinitrc file or its permissions.

Maybe first you should post here the outputs you get from these two commands after ssh'ing to the player

Code:
ls -la /home/pi/.xinitrc
cat /home/pi/.xinitrc

Regards,
Kent
Reply
#6
Hi Kent,
I always used "sudo" when editing file, don't know if it's a good habit.
And yes I can access ssh, and browse, just no local UI.
Now I changed again xinitrc with vivaldi and I get the screen stuck at "Ooops: Teminated".
Just this one line at the top.
Also I have the Moode splashscreen enable (maybe a problem).

here is what I get:


Code:
pi@moode:~ $ ls -la /home/pi/.xinitrc
-rwxr-xr-x 1 pi pi 1181 Jan 10 21:22 /home/pi/.xinitrc
pi@moode:~ $ cat /home/pi/.xinitrc
#!/bin/bash
#
# moOde audio player (C) 2014 Tim Curtis
# http://moodeaudio.org
#
# This Program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
# This Program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
# 2020-04-24 TC moOde 6.5.0
#
#

# Turn off display power management
xset -dpms

# Screensaver timeout in secs or 'off' for no timeout
xset s 60

# Capture screen size
SCREENSIZE="$(fbset -s | awk '$1 == "geometry" { print $2","$3 }')"

# Launch chromium browser
# --disk-cache-dir=/dev/null
vivaldi-stable --app=http://localhost/ --window-size=$SCREENSIZE --window-position=0,0 --no-first-run -enable-features=OverlayScrollbar --disable-infobars --disable-session-crashed-bubble

no hurry, I'll be back home tomorrow by 6pm EST

Thanks for your time.
Reply
#7
@Alaini93

Quote:Also I have the Moode splashscreen enable (maybe a problem).

 Seriously? A two-year old out-of-band software hack that was developed on moOde 4.2 and you neglected to tell us? You must be a difficult patient for your doctor.  Tongue

I seem to recall I thought at the time there was something either not right or not needed in that procedure---I was experimenting with the framebuffer at the time for a different kind of display---but I'd have to go rummage through old notes to see what my issue was if I had one.

Nevertheless, I just tried it on my test player. It seems to still work on moOde 7.0.1 and doesn't interfere with my use of Vivaldi. Your issue must lie elsewhere.

Always using sudo when you edit is a terrible practice but I can understand the motivation. A lot of files in moOde are owned by root including some which don't need to be.

For all that, your /home/pi/.xinitrc is marked owner=pi, group=pi whereas the distributed version is owner=root, group=root. It does not matter in this case, but in general changing file permissions or file ownership is a bad thing.

As for the content of your .xinitrc file, nothing jumps out at me.

I don't know what to suggest you try next.


Regards,
Kent
Reply
#8
(01-11-2021, 02:19 PM)TheOldPresbyope Wrote: @Alaini93

Quote:Also I have the Moode splashscreen enable (maybe a problem).

 Seriously? A two-year old out-of-band software hack that was developed on moOde 4.2 and you neglected to tell us? You must be a difficult patient for your doctor.  Tongue

Yes splashscreen works fine, but I'm waiting for you to update the mod.  Smile

Ok, no problem I will deal with chromium. I used to leave it on because of the clock on the 2nd screen.

That's weird that it cannot open vivaldi, I don't have any problem switching between browser in Windows Big Grin
Reply


Forum Jump: