Page 1 of 1

HOWTO: pepperflash in FireFox 2017

Posted: Thu Feb 09, 2017 4:30 am
by paulwratt
NOTE:
this may or may not work on Wheezy, as I believe libpepflashplayer.so is compiled for armv7 (>=rpi2). You will need to use Wheezy Back-Ports and their keys (to get them add the servers then do: apt-get update). But browse the server first to see if freshplayer is there (if not you can compile from source by grabing from Jessie Back-Ports including any patches).


there are other posts out there, but this one works atm (Feb 2017), all CODE objects listed below are console commands typed into a shell, unless otherwise stated at the appropriate time of usage (like after running leafpad)



install FireFox :

Code: Select all

sudo apt-get update
sudo apt-get install firefox-ers
add Jessie Back-Ports to your /etc/apt/sources.list :

Code: Select all

sudo leafpad /etc/apt/sources.list
add the following:

Code: Select all

# we wanted this: browser-plugin-freshplayer-pepperflash
deb http://ftp.debian.org/debian jessie-backports main contrib non-free
add their server keys to APT :

Code: Select all

gpg --keyserver pgpkeys.mit.edu --recv-key 8B48AD6246925553
gpg -a --export 8B48AD6246925553 | sudo apt-key add -
gpg --keyserver pgpkeys.mit.edu --recv-key 7638D0442B90D010
gpg -a --export 7638D0442B90D010 | sudo apt-key add -
install browser-plugin-freshplayer-pepperflash :

Code: Select all

sudo apt-get update
sudo apt-get install browser-plugin-freshplayer-pepperflash
(will also install 2x depends: libevent-core-2.0-5 & libevent-pthreads-2.0-5)


remove Jessie Back-Ports from your /etc/apt/source.list :

Code: Select all

sudo leafpad /etc/apt/source.list
change the following:

Code: Select all

# we wanted this: browser-plugin-freshplayer-pepperflash
#deb http://ftp.debian.org/debian jessie-backports main contrib non-free
(note the #)

Code: Select all

sudo apt-get update
(stops further conflicts and erroneous package installs from Debian based Jessie Back-Ports)



get libpepflashplayer.so, of which there are a few options:

1. get it with Chromium-Browser & Rpi-Chromium-Mods :

Code: Select all

sudo apt-get install rpi-chromium-mods
(will also install chromium-browser (v55) if not already installed)
- version: 24.0.0.186
- location: /usr/lib/chromium-browser/libpepflashplayer.so

2. get it from flash21.tar.xz in this post
(following install instructions, used only for Chromium-Browser v54)
- version: 21.0.0.182
- location: /usr/lib/chromium-browser/plugins/21.0.0.182-r1/libpepflashplayer.so

3. get it from PepperFlash-12.0.0.77-armv7h.tar.gz as mentioned in this post:

Code: Select all

wget https://s3.amazonaws.com/pcduino/Tools/PepperFlash-12.0.0.77-armv7h.tar.gz
tar -xzf PepperFlash-12.0.0.77-armv7h.tar.gz
- version: 12.0.0.77
- location: /usr/lib/PepperFlash/libpepflashplayer.so



add ~/.config/freshwrapper.conf:

Code: Select all

leafpad ~/.config/freshwrapper.conf
save with the following contents (my .conf):

Code: Select all

# Configuration options for FreshPlayerPlugin

# This configuration file is optional. Wrapper will search for it first
# in ~/.config/freshwrapper.conf, then in /etc/freshwrapper.conf.
# If wrapper fails to find configuration, it will use default values,
# which you can find below

# Audio buffer is used to continuously provide sound adapter with data.
# Values too low may lead to buffer underruns and stuttering.  Values
# too high will lead to noticeable latency. Usually plugin selects size
# on its own, but you may override bounds here

# lower bound for audio buffer size, in milliseconds
audio_buffer_min_ms = 20

# higher bound of audio buffer size, in milliseconds
audio_buffer_max_ms = 500

# output sound through JACK. If enabled, only JACK will be tried, and if
# your machine doesn't have it, there would be no sound, and no sync
audio_use_jack = 0

# whenever to automatically connect application ports to system ones.
# If you set this to one, no sound would be produces until you make
# connection some way
jack_autoconnect_ports = 1

# JACK server name. Omit the option to use default value
#
# jack_server_name = "default"

# starts JACK server on demand
jack_autostart_server = 1

# Path to the Pepper Flash plugin.
# If the option is absent, freshwrapper will search for Pepper Flash in
# a number of locations where it could be. Usually that's enough, but if
# not, you should manually enter the right path. Multiple paths could
# be specified, separated by colon.
pepperflash_path = "/opt/google/chrome/PepperFlash/libpepflashplayer.so"
#pepperflash_path = "/opt/google/chrome/pepper/libpepflashplayer.so"
#pepperflash_path = "/usr/lib/PepperFlash/libpepflashplayer.so"
#pepperflash_path = "/usr/lib/chromium-browser/libpepflashplayer.so"
#pepperflash_path = "/usr/lib/chromium-browser/plugins/21.0.0.182-r1/libpepflashplayer.so"

# "Command-line" arguments for Flash
#flash_command_line = "enable_hw_video_decode=1,enable_stagevideo_auto=1"
flash_command_line = "enable_stagevideo_auto=1"

# enable 3d and stage 3d
#enable_3d = 1
enable_3d = 0

# enable hardware-accelerated video decoding. Requires 3d to really work
enable_hwdec = 0

# when set to 1, limits output to warnings and errors only
quiet = 0

# When multiple monitors with different resolutions are used, size
# of fullscreen window can vary. But some Flash movies request these
# parameters once at startup and rely on them to be correct. By default,
# if zeros are used here, freshwrapper will select minimal width and
# height across all monitors.
fullscreen_width = 0
fullscreen_height = 0

# Enables DNS query case randomization to partially protect against DNS
# poisoning attacks. It was reported that some Mikrotik routers do not
# support this trick. Set parameter to 0 if you have an affected model
randomize_dns_case = 0

# scaling factor (floating point value) used to convert screen pixels
# to device independent pixels. You may need it for displays with
# high DPI
device_scale = 1

# method org.freedesktop.ScreenSaver.SimulateUserActivity() in KDE 5 seems
# to have no effect unless GetSessionIdleTime() called afterwards. Set
# parameter to 1 to call latter
quirk_plasma5_screensaver = 0

# whenever to use windowed plugin mode
enable_windowed_mode = 1

# whenever XEmbed used in windowed mode (if browser advertises its support)
enable_xembed = 1

# if set to 1, fullscreen window will be kept always above browser, and hidden
# from taskbar and pager
tie_fullscreen_window_to_browser = 1

# enable using of VA-API for hardware accelerated video decoding
enable_vaapi = 0

# enable using of VDPAU for hardware accelerated video decoding
enable_vdpau = 0

# microseconds to wait after vsync event
vsync_afterwait_us = 0

# fullscreen transition delay, in milliseconds
fs_delay_ms = 300

# wait for vertical blank event before drawing on screen
enable_vsync = 1

# how close in time two clicks should be to treat them as a doubleclick
double_click_delay_ms = 400

# show version and git commit hash (if was available) of freshwrapper
# in the context menu (right mouse button menu)
show_version_info = 0

# probe video capture devices for their names and capabilities
probe_video_capture_devices = 0

# use XRender to blend images
#enable_xrender = 1
enable_xrender = 0

NOTES:
I am not 100% sure, but I believe the rendering fix is achieved by the last line enable_xrender = 0, as this was the only change I made this morning, after turning off a whole lot of stuff last night:
compare with: /usr/share/doc/browser-plugin-freshplayer-pepperflash/freshwrapper.conf.example
You will see I have a lot of remarked (#) paths for pepperflash_path, the one I am successfully running atm is 12.0.0.77
(/opt/google/chrome/PepperFlash/libpepflashplayer.so).
I am not 100% sure if the version of libpepflashplayer.so affects freshplayer, which is listed in FireFox (about:plugins) as:

Code: Select all

    Version: 13.1.2.3
    State: Enabled
    Shockwave Flash 13.1 r2
It works for me, and I am not willing to play with it atm, least it break again (strange render pattern), but it may not be version dependant.


BTW, you can find and (visually) compare all installed libpepflashplayer.so with the following command:

Code: Select all

sudo find / -name libpepflashplayer.so | xargs ls -l
(the sudo just stops find from throwing permission garbage out in your console)


Please post results of your successful ~/.config/freshwrapper.conf settings and tweaks, to help others eliminate unnecessary testing.


Cheers
Paul

PS this will probably get flash working with any browser core that checks and uses /usr/lib/mozilla/plugins/flash-mozilla.so like Minimal Kiosk Browser, and any FireFox derivitives like IceWeasel (if you still have it) or WebKit derivitives (using libwebkit). Epiphany (older name), Epiphany-Browser (now called Web) blocks Freshplayer which also uses Xembed, so it should be unblocked in code (like gnash & nspluginwrapper)

Re: HOW TO: pepperflash in FireFox 2017

Posted: Thu Feb 09, 2017 1:37 pm
by gkreidl
Thanks, worked like a charm.
But adding the debian backports repository is dangerous. It's better to download the package directly
http://ftp.debian.org/debian/pool/contr ... _armhf.deb
and install the file with gdebi (to get the dependencies).

Edit: And WOW ... flash now also works in kweb!

Re: HOW TO: pepperflash in FireFox 2017

Posted: Wed Feb 15, 2017 1:15 am
by paulwratt
BTW, which version did you get running (the latest v24?)

NOTE: on any back-ports repository.

Technically speaking its not dangerous, unless you DON'T use apt-get as you package installer frontend, but use another GUI type. Even then Synaptic WILL ask you (as apt-get does).

to understand why its simpler to temporarily add the Jessie Back-Ports repo:

Code: Select all

browser-plugin-freshplayer-pepperflash requires:
libevent-core-2.0-5, libevent-pthreads-2.0-5
Now as a matter of course (standard use), ANY package handler should ask you if you WANT to install those 2 extra packages (unless you have already told it to answer Yes to, or Force, the installtion process).

As proof of concept (and safety), with the back-ports repo (re)enabled temporarily, try:

Code: Select all

sudo apt-get install {insert-back-ports-only-gtk-app-name}
and see what you get. I chose firejail (because it was not in my Feb 2017 Jessie repo), here is an explanation of:
"what the hell are all those other libraries for" and "dont I already have most of them installed"
Any GUI app that runs on X Windows, doesn't just depend on the GTK or QT libraries they are built with, but also the X libraries those GUI libraries were built with, and some X libraries are the same with regards to graphics/display and/or sound drivers.

In my firejail example, it 1st depends on FireFox, and apt-get will by default want to choose the back-ports build, which depends on (the back-ports build of) GTK+ v2, which depends on (the back-ports build of) X Windows, etc, etc.
"But isn't X Windows and GTK already installed on (most) GUI based OS's like Raspbian?"
Well if its required libraries are NAMED different then the package installer presumes the libarary to be a totally different physical entity. And that is one fundamental difference between Debian and Ubuntu, even though Ubuntu is based on Debian, the same was as any (Debian based) back-ports is.

To get back to the specific requires mentioned in the first CODE block above, on Debian 8, which is what Raspbian Jessie is based on libevents already exists, as does libpthreads, but for some reason, usually because the back ported package no longer compiles 100% with current versions of those libraries, a new set of similar but not the same libraries is needed to avoid conflicts, and in Jessie Back-Ports case most of those non-conflicting libraries are from Debian Wheezy or earlier.

So to reitterate, any non-OS specific repository can be disasterous if you dont read what is be asked of you with regards to installing extra packages. Most often this will be fine, EXCEPT where development (*-dev) packages are concerned.

If you temporarily add the Jessie Back-Ports, making sure your package only installs the bare minimum extra packages, then disable that repo again, you will not have any problems (as is outlined in the OP).

In place of this, you can always install from source, which requires a complete OS build tool-chain, development libraries, plus their binary counterparts, and (often but not always) enough understanding to successfully compile the source when when something goes wrong with the build process. This is often a daunting process, even for a seasoned programmer with background on another platform. It should not be, as practice makes perfect, as long as you understand how to read, write, know how to copy and paste, an reference any of your changes to the code itself.

But thats a whole nother thread post, for which these forums are littered with examples, and was not the intention of this OP. The packages "are" available, "heres" how to get them, "heres" what to do to make everything work. When its fairly simple what needs to be done, it almost DEMANDS someone posting a thread to help others.

On one final side note, if you are interested in permanently running multiple (often incompatible) repositories, then you may be interested in Bedrock Linux, of which I believe there is one BerryBoot OS already available that use it (with Raspbian, Debian and Ubuntu, Jessie repos).

Cheers

Paul
"Power to the Users that be,
not, User to the Powers that be"

Re: HOW TO: pepperflash in FireFox 2017

Posted: Wed Feb 15, 2017 10:17 am
by gkreidl
To answer your question: I'm using the pepperflash version supplied by the foundation with chromium_mods.

I don't think it's a good idea to install packages with apt-get which require other packages while connected to another respository.
You might end up with packages which are not compatible with the Raspbian+Foundation system we all use.

I've installed quite a number of packages from other repositories in the past (e . g. Firefox from Ubuntu 14.04 before we got Firfox-ESR), but have always been using the secure method: Download the package(s), check dependencies with gdebi and install them if all dependencies are met.

Re: HOWTO: pepperflash in FireFox 2017

Posted: Sun Mar 19, 2017 5:30 am
by paulwratt
gkreidl wrote:To answer your question: I'm using the pepperflash version supplied by the foundation with chromium_mods.
Great, thanks for that - thats version 24.0.0.186 (or maybe 25 by now).
gkreidl wrote:I don't think it's a good idea to install packages with apt-get which require other packages while connected to another respository.
You might end up with packages which are not compatible with the Raspbian+Foundation system we all use.
Hence the second post explain why is NOT unsafe.
gkreidl wrote:I've installed quite a number of packages from other repositories in the past (e . g. Firefox from Ubuntu 14.04 before we got Firfox-ESR), but have always been using the secure method: Download the package(s), check dependencies with gdebi and install them if all dependencies are met.
this is exactly what apt-get install does, even across different repositories, it will notify you of a conflict

Back-port repos are specifically created to avoid any possible package name conflicts. There is no problem with having any number of libraries of exactly the same version on your system, as long as they are either named differently or in a different location (eg QT & GTK without X support, MUST be in a different location from /usr/lib, unless your OS does not support X Windows in any form, then it does not really matter)

The conflicts you are talking about (_package_name_ replaces _x_) can also be avoided in the way BedRock Linux or NixOS does, which is the whole point of Ubuntu's new package system (which also contains the required libraries as used at compile time).

The main problem with conflicts is not editing the generic locations (PREFIX=) when compiling from source, and package maintainers forcing replaces (see my next post).

Paul

Re: HOWTO: pepperflash in FireFox 2017

Posted: Sun Mar 19, 2017 5:42 am
by paulwratt
I can confirm that the OP technique works for Devuan Pi too

I manually extracted /usr/lib/chromium-browser/libpepflashplayer.so from the Raspbian's rpi-chromium-mods package, as I did not want any of the extra stuff they supplied.

In this case, one extra library was required:
libevent-core-2.0-5, libevent-pthreads-2.0-5, libva-x11-1

Possibly because Devuan is designed to superceed Jessie, ALL those libraries came for Devuan's repo, and not the Jessie Back-ports repo, so that was an unexpected bonus

Paul