Flash problems on Linux?
Monday, December 14, 2009 12:52:31 PM
Flash works in other browsers but not Opera.
Firstly you need to ensure that Adobe Flash plugin file 'libflashplayer.so' is detected by Opera. If you have Flash installed but it is not being picked up then the first thing you need to do is find out where it is installed. Your can use the following command to help you:
find / -name 'libflashplayer.so' 2> /dev/null
When have found the path to 'libflashplayer.so' add this to Opera via "Tools > Preferences > Advanced > Content > Plug-in options... > Change path... > Add...".
If Opera still does not display Flash, then try running the following 'ldd <path to libflashplayer.so>', i.e. if you have 'libflashplayer.so' installed in '/usr/lib/mozilla/plugins' then type this:
You should receive some results back. What you are looking for is any lines that state 'not found', e.g.:
libnss3.so => not found libsmime3.so => not found libssl3.so => not found libplds4.so => not found libplc4.so => not found libnspr4.so => not found
These are dependencies of the Adobe Flash plugin that are not found on your system. You will need to find the packages that provide these missing libraries for each of the 'not found' lines and install them. After installing, running the 'ldd <path to libflashplayer.so>' command again to ensure no further libraries are missing. Once all dependencies are satisfied Opera should work with Flash.
Some users have reported that they have working Flash in another browser even though not all the dependencies are statisfied. There are three ways this could happen.
- Your other browser is using a different copy of the Adobe Flash plugin, which has its dependencies satisfied.
- Your other browser is using an alternative Flash plugin (e.g. Gnash or SWFdec).
- Your other browser's package includes some of the library dependencies itself.
You should catch the first two issues when you searched for 'libflashplayer.so' on your system earlier in the guide. If you found more than one 'libflashplayer.so' then try running the ldd command against each one in turn to see if any of them have all their dependencies fulfilled. If they do, you should make sure this is the plugin file that is found in one of the Opera plugin paths.
If 'libflashplayer.so' is not found on your system or it is a symlink to a library that is obviously Gnash or SWFdec then you will need to install Adobe Flash. Either install Adobe Flash via your native package manager and check the location that 'libflashplayer.so' was installed to (making sure this is added to the Opera Plugin paths), or download the Linux Flash tarball package from Adobe's website, extract 'libflashplayer.so' and place it in '/usr/lib/opera/plugins' or another appropriate location.
The last issue is potentially the most confusing. My Opera user Robertugo was the first one to bring it to my attention. He noted that the Firefox package on his distro of choice (SliTaz Linux) bundled some of the required libraries within '/usr/lib/firefox/'. He resolved his own issue by creating symlinks to each of the missing libraries in turn, e.g. if he received 'libnss3.so => not found' he could do the following as root:
ln -s /usr/lib/firefox/libnss3.so /usr/lib/libnss3.so
This should work for other users as well who find themselves in a similar situation, however it is not the ideal way to fix the problem. It is better to install the relevant packages for your distro that provide these libraries natively within the standard library directory. Yes this will cause duplication of libraries, but Adobe Flash will not break if you happen to remove Firefox at a later stage.
Flash stops responding to clicks
Firstly, I should point out that this is not an Opera specific issue. Users of other browsers and indeed other types of software have been hitting this of late. That said, to work around it in Opera try starting Opera as follows:
$ GDK_NATIVE_WINDOWS=1 opera &
You can make this more permanent by adding the line "export GDK_NATIVE_WINDOWS=1" early on in the Opera wrapper script (typically found here: '/usr/bin/opera').
Some users report that the above fix isn't working for them every time. This appears to be due to the fact that sometimes this variable gets reset before it is passed to the Opera plugin wrapper. This can happen when Opera calls other Gtk processes (e.g. when activating the "File > Open" dialog on a Gnome based system) before calling the operapluginwrapper/Flash.
You can actually check if this is happening as follows. Start Opera with the variable set and load a single page that contains Flash (e.g. a YouTube video). Then run the following command on the terminal:
$ ps ax | grep operapluginwrapper
Note the process ID for the wrapper and then run the following:
$ grep GDK_NATIVE_WINDOWS /proc/[PID]/environ
You will need to replace [PID] with the actual operapluginwrapper process id, e.g. if the PID was 2655, then:
$ grep GDK_NATIVE_WINDOWS /proc/2655/environ
If the variable is set then 'Binary file /proc/[PID]/environ matches' will echo back. If it is unset then you will receive no feedback.
If you find that the GDK_NATIVE_WINDOWS is becoming unset then the best workaround is to set the variable as close to the source of the issue as possible. Here is how that can be done on 64bit and 32bit Linux.
On 64bit Linux it is slightly easier in that we actually provide two Opera plugin wrappers (one 64bit and one 32bit) and call whichever is most appropriate. The file '/usr/lib/opera/operapluginwrapper' is actually therefore just a shell script that calls the appropriate wrapper. Hence you can simply add "export GDK_NATIVE_WINDOWS=1" to the start of this script on a new line after the initial '#!/bin/sh'.
For 32bit users who installed the G3 (gcc4-qt3) packages (most users), you can follow the same instructions as for 64bit Linux. If you are using G2 (gcc3-qt3) or G4 (gcc4-qt4) packages on 32bit Linux, a couple of extra steps are needed as the file '/usr/lib/opera/operapluginwrapper' is a binary file and not a shell script, hence it cannot be edited directly. Firstly (using the root user or prefixing with sudo) rename the operapluginwrapper as follows:
# mv /usr/lib/opera/operapluginwrapper /usr/lib/opera/operapluginwrapper-ia32-linux
Now create your own 'wrapper script' for the real operapluginwrapper and place it in '/usr/lib/opera/'. The contents of your script would be:
#!/bin/sh export GDK_NATIVE_WINDOWS=1 exec /usr/lib/opera/operapluginwrapper-ia32-linux "$@"
You will also need to make this executable, i.e.:
# chmod +x /usr/lib/opera/operapluginwrapper
You should now find that if you retest via the previous outlined steps, the GDK_NATIVE_WINDOWS does not become unset.
You can find more information about this issue on this page or via searches (with GDK_NATIVE_WINDOWS as a keyword) on Google (or you preffered search engine).
Thanks to ColKilkenny, as the first user to bring it to my attention.
Edit: For people using 64bit Linux I suggest you also read my latest blog post.