# Flash 10 on FreeBSD works better than on linux



## davidgurvich (Feb 3, 2010)

I've installed the linux flash 10 plugin on an older thinkpad X30.  Strangely, flash works better in compatibility mode under FreeBSD than running natively on Linux.

The X30 uses integrated intel i830 graphics and matching sound. All of the components should be well supported on both Linux and FreeBSD.  On Linux the graphics used to work well but recent changes to Xorg have caused serious problems.  The problems are bad enough that I've given up using Linux on the X30 and installed FreeBSD.

Has anyone else noticed flash10 working better in compatibility mode than under Linux and with what hardware and distributions?  I suspect that ALSA/Pulseaudio plus xorg are the main culprits in Linux.


----------



## winstonw (Feb 7, 2010)

Flash works better than most 64bit linuxes and OpenSolaris -- http://www.hulu.com recently made a big boo-boo and 64bit OSes running 64bit flash do not receive streams at all.

Flash works impressively in the linux compat layer. I am running linux32 flash on freebsd amd64 btw


----------



## davidgurvich (Feb 8, 2010)

There's clearly some issue with flash on linux with intel graphics.  I haven't liked the responsiveness of FreeBSD on this laptop and have now installed Arch Linux.

Arch is much more responsive but flash still cause problems. The clearest indication is changing to/from  fullscreen.  Many times the browser seems to have locked up but is simply slow in changing under Linux.  On FreeBSD that particular latency issue doesn't occur.


----------



## Graaf_van_Vlaanderen (Feb 8, 2010)

For me flash works great in OpenSolaris. I can't say the same about the Linux Flashplayer. I'm just wondering, would it be technically possible to use the Solaris Flashplayer in BSD without any 'emulation' layer in between?


----------



## davidgurvich (Feb 9, 2010)

I think it would be technically feasible and may be relatively trivial to implement, but why?  There doesn't seem to be any sign that adobe is supporting opensolaris with any updates while there are new versions of the player for Linux.  

The linux emulation layer works for flashplugin10.  I don't think anyone has noticed that working worse than on linux and, in fact, this thread is concerning the strange fact that it works better on freebsd.


----------



## DutchDaemon (Feb 9, 2010)

(except for the hanging npviewer.bin instances which seem to be a recurring phenomenon; easily killed, but still)


----------



## winstonw (Feb 9, 2010)

DutchDaemon said:
			
		

> (except for the hanging npviewer.bin instances which seem to be a recurring phenomenon; easily killed, but still)



Speaking of npviewer.bin, it seems to crash regularly for me (Firefox becomes unresponsive and doesn't refresh its windows until it realizes what happened, and there is a npviewer.core in my $HOME.

It seems to restart readily though (on visiting a new page OR pag refresh.)


----------



## lme@ (Feb 9, 2010)

Having a keyboard shortcut for `$ killall npviewer.bin` is very useful.


----------



## vermaden (Feb 9, 2010)

@lme

I use that if I need to start/stop firefox with flash (*openbox* menu config):


```
% grep -B 1 -A 2 firefox ~/.config/openbox/menu.xml

  <item label="firefox">
    <action name="Execute">
      <command>firefox3</command>
    </action>
  </item>
   
  <item label="firefox: kill">
    <action name="Execute">
      <command>killall -9 npviewer.bin firefox-bin</command>
    </action>
  </item>
```


----------



## lme@ (Feb 10, 2010)

But normally it is sufficient to kill npviewer.bin alone. No need to kill firefox-bin also.


----------



## vermaden (Feb 10, 2010)

@lme

Sometimes whtn I close firefox by [x] on window manager, it hangs and I need to kill it anyway, so that solves all firefox related problem.


----------



## davidgurvich (Feb 10, 2010)

I haven't used freebsd to watch enough flash video to get one of these, just enough to see that playback is smoother than on linux.  I've reinstalled freebsd and will look for these core dumps.  

Perhaps an automatic kill script that looks for npviewer.bin taking over 90% of resources might work.  Start firefox with a wrapper that also starts the kill script.


----------



## DutchDaemon (Feb 10, 2010)

The 90% usage trigger is a no-go:


```
15386 user      1  44    0   146M 25300K select  1   0:56  [B]0.10%[/B] npviewer.bin
```

This one will happily sit there for hours.


----------



## davidgurvich (Feb 10, 2010)

I'm looking now and have 4 running that should not be.  They seem to get bigger over time.  Guess that would run you out of memory eventually.  Perhaps a memory size trigger would work better?  Kill the npviewer.bin process when it get's over a certain size?


----------



## DutchDaemon (Feb 10, 2010)

It seems that playing Flash will start 4-7 npviewer.bin processes. When the video is done (and you navigate away from the page it was played from), there appears to be one npviewer.bin left that won't die voluntarily. When you don't kill that one and play another Flash video, there will still be only one npviewer.bin hanging around. 

I'd say that something like this should work:


```
#!/bin/sh

while true

do

flashcount=$(/bin/pgrep npviewer.bin | /usr/bin/wc -l)

if [ $flashcount = 1 ]
then
/usr/bin/killall npviewer.bin
fi

/bin/sleep 10

done
```

When I ran this in the background and went to YouTube for a Flash video, it played fine. As soon as the video was done and I closed the page ... it killed the lone npviewer.bin immediately:

Run:


```
[B]YouTube video playing[/B]
$ sh -x bla
+ true
+ /bin/pgrep npviewer.bin
+ /usr/bin/wc -l
+ flashcount='       7'
+ [ 7 = 1 ]
+ /bin/sleep 10
+ true
+ /bin/pgrep npviewer.bin
+ /usr/bin/wc -l
+ flashcount='       7'
+ [ 7 = 1 ]
+ /bin/sleep 10
+ true
+ /bin/pgrep npviewer.bin
+ /usr/bin/wc -l
+ flashcount='       7'
+ [ 7 = 1 ]
+ /bin/sleep 10
+ true
+ /bin/pgrep npviewer.bin
+ /usr/bin/wc -l
+ flashcount='       7'
+ [ 7 = 1 ]
+ /bin/sleep 10
+ true
+ /bin/pgrep npviewer.bin
+ /usr/bin/wc -l
+ flashcount='       7'
+ [ 7 = 1 ]
+ /bin/sleep 10
+ true
+ /bin/pgrep npviewer.bin
+ /usr/bin/wc -l
+ flashcount='       7'
+ [ 7 = 1 ]
+ /bin/sleep 10
+ true
+ /bin/pgrep npviewer.bin
+ /usr/bin/wc -l
+ flashcount='       7'
+ [ 7 = 1 ]
+ /bin/sleep 10
[B]YouTube video stopped and page closed[/B]
+ true
+ /bin/pgrep npviewer.bin
+ /usr/bin/wc -l
+ flashcount='       1'
+ [ 1 = 1 ]
+ /usr/bin/killall npviewer.bin
+ /bin/sleep 10
+ true
+ /bin/pgrep npviewer.bin
+ /usr/bin/wc -l
+ flashcount='       0'
+ [ 0 = 1 ]
+ /bin/sleep 10
^C
```

So that appears to work. Running it in a while loop is a bit much, so putting the stuff below in a script, putting it in cron and running it every 5 minutes or so should be enough. Too bad there's no 'pgrep -c' though, pity about the extra call to 'wc -l' .. oh well.


```
#!/bin/sh

flashcount=$(/bin/pgrep npviewer.bin | /usr/bin/wc -l)

if [ $flashcount = 1 ]
then
/usr/bin/killall npviewer.bin
fi
```


----------



## DutchDaemon (Feb 10, 2010)

Update: the above works quite nicely for me. So long as you play Flash or are on Flash-enabled pages, the script will leave npviewer.bin alone. But when you navigate away from anything containing Flash, npviewer.bin is gone within 5 minutes.


----------



## mdg583 (Feb 10, 2010)

Graaf_van_Vlaanderen said:
			
		

> For me flash works great in OpenSolaris. I can't say the same about the Linux Flashplayer. I'm just wondering, would it be technically possible to use the Solaris Flashplayer in BSD without any 'emulation' layer in between?



How about _with_ an emulation layer? Does freebsd also have a solaris alternative to the linuxulator which could run the solaris binary? Just curious.


----------



## Graaf_van_Vlaanderen (Feb 11, 2010)

I just checked the load activity while watching something on Youtube. The first one is OpenSolaris (built131) on my desktop and the second one is on a server running FreeBSD 8.0 AMD64, hence a lot of ssh activity. In case of FreeBSD you see a lot of
'npviewers' active. 

OpenSolaris & Flash:


```
PID USERNAME  SIZE   RSS STATE  PRI NICE      TIME  CPU PROCESS/NLWP       
  1038 depaepe   289M  107M sleep   55    0   0:01:01 9.0% firefox-bin/21
   647 depaepe    88M   55M sleep   59    0   0:01:13 1.5% Xorg/3
  1050 depaepe   135M   48M sleep   49    0   0:00:23 1.1% rhythmbox/7
   832 depaepe   174M   55M sleep   59    0   0:00:15 0.3% compiz-bin/1
   820 depaepe   111M   38M cpu2    59    0   0:00:12 0.1% gnome-terminal/2
   879 depaepe    90M   18M sleep   59    0   0:00:01 0.0% gnome-netstatus/2
  1093 depaepe  9716K 3100K cpu0    59    0   0:00:00 0.0% prstat/1
   895 root     1660K 1084K sleep   59    0   0:00:00 0.0% gnome-netstatus/1
     5 root        0K    0K sleep   99  -20   0:00:01 0.0% zpool-rpool/43
  1060 depaepe    94M   21M sleep   49    0   0:00:00 0.0% gnome-volume-co/2
   881 depaepe    79M   17M sleep   59    0   0:00:00 0.0% clock-applet/1
   876 depaepe    93M   20M sleep   49    0   0:00:00 0.0% mixer_applet2/2
   809 depaepe    28M   17M sleep   59    0   0:00:00 0.0% gnome-settings-/2
   818 depaepe   100M   29M sleep   59    0   0:00:01 0.0% gnome-panel/1
   819 depaepe   114M   42M sleep   49    0   0:00:01 0.0% nautilus/1
   511 root       28M   13M sleep   59    0   0:00:00 0.0% fmd/19
   365 root     4336K 3208K sleep   59    0   0:00:00 0.0% console-kit-dae/2
   633 root     2916K 2056K sleep   59    0   0:00:00 0.0% hald-addon-stor/3
   363 root     3740K 2120K sleep   59    0   0:00:00 0.0% hald-runner/1
   551 smmsp    6568K 1788K sleep   59    0   0:00:00 0.0% sendmail/1
   790 depaepe  3592K 1100K sleep   59    0   0:00:00 0.0% ssh-agent/1
   362 root     6740K 5340K sleep   59    0   0:00:00 0.0% hald/3
   557 root     3460K 2020K sleep   59    0   0:00:00 0.0% hald-addon-acpi/1
   453 root       10M 3452K sleep   59    0   0:00:00 0.0% inetd/3
   357 root     3340K 2104K sleep   59    0   0:00:00 0.0% dbus-daemon/1
   583 root       12M 6056K sleep   59    0   0:00:00 0.0% intrd/1
   434 root     2264K 1348K sleep   59    0   0:00:00 0.0% sac/1
   683 gdm      3552K 1376K sleep   59    0   0:00:00 0.0% dbus-launch/1
   750 depaepe  3596K 2328K sleep   59    0   0:00:00 0.0% dbus-daemon/1
   930 depaepe    15M 5740K sleep   59    0   0:00:00 0.0% ssh/1
   465 root     1664K  888K sleep   59    0   0:00:00 0.0% utmpd/1
   128 root       11M 2868K sleep   59    0   0:00:00 0.0% syseventd/17
   309 root     7400K 1368K sleep   59    0   0:00:00 0.0% cron/1
   219 root       11M 4232K sleep   59    0   0:00:00 0.0% nscd/30
   210 root     9028K 2656K sleep   59    0   0:00:00 0.0% picld/4
   646 root       11M 4080K sleep   59    0   0:00:00 0.0% gdm-simple-slav/1
 NPROC USERNAME  SWAP   RSS MEMORY      TIME  CPU                             
    56 depaepe   545M  539M    13%   0:04:48  12%
    40 root       71M   81M   2.0%   0:00:07 0.0%
     1 smmsp    1768K 5112K   0.1%   0:00:00 0.0%
     1 gdm       288K 3552K   0.1%   0:00:00 0.0%
     1 noaccess  420K 2600K   0.1%   0:00:00 0.0%
     5 daemon   4988K   15M   0.4%   0:00:00 0.0%







Total: 104 processes, 333 lwps, load averages: 0.56, 0.46, 0.25
```


FreeBSD & Linux Flash


```
last pid: 79401;  load averages:  0.79,  0.86,  0.61       up 0+00:22:35  15:31:21
51 processes:  2 running, 49 sleeping
CPU 0: 18.8% user,  0.0% nice,  6.0% system,  1.9% interrupt, 73.3% idle
CPU 1: 25.6% user,  0.0% nice,  6.4% system,  0.4% interrupt, 67.7% idle
CPU 2: 11.7% user,  0.0% nice,  1.5% system, 13.9% interrupt, 72.9% idle
CPU 3: 15.4% user,  0.0% nice,  3.4% system,  3.4% interrupt, 77.8% idle
Mem: 135M Active, 89M Inact, 500M Wired, 9296K Cache, 583M Buf, 7127M Free
Swap: 4096M Total, 4096M Free

  PID    UID    THR PRI NICE   SIZE    RES STATE   C   TIME   WCPU COMMAND
  974   1001      1 104    0 36912K  5352K CPU1    1   1:39 40.97% sshd
79388   1001      1  53    0   395M 49184K select  0   0:42  9.47% npviewer.bin
79396   1001      1  48    0   395M 49184K futex   0   0:21  7.18% npviewer.bin
79391   1001      1  47    0   395M 49184K futex   1   0:13  4.69% npviewer.bin
79393   1001      1  47    0   395M 49184K futex   2   0:12  4.30% npviewer.bin
79392   1001      1  47    0   395M 49184K futex   3   0:12  2.29% npviewer.bin
11233   1001     11  44    0   182M 84876K ucond   1   0:32  0.00% firefox-bin
79395   1001      1  44    0   395M 49184K futex   1   0:03  0.00% npviewer.bin
  846      0      1  44    0  5864K  1272K select  2   0:01  0.00% powerd
  983   1001      1  44    0 36912K  5156K select  1   0:01  0.00% sshd
  989   1001      1  44    0  8304K  2632K CPU2    2   0:01  0.00% top
  971      0      1  50    0 36912K  5096K sbwait  2   0:00  0.00% sshd
  962      0      1  49    0 36912K  5068K sbwait  2   0:00  0.00% sshd
  965   1001      1  44    0 36912K  5152K select  0   0:00  0.00% sshd
  980      0      1  47    0 36912K  5096K sbwait  3   0:00  0.00% sshd
  975   1001      1  44    0 10276K  2808K ttyin   0   0:00  0.00% csh
  966   1001      1  44    0 10276K  2716K pause   2   0:00  0.00% csh
  984   1001      1  44    0 10276K  2808K ttyin   2   0:00  0.00% csh
11779   1001      1  44    0 21644K  4504K select  0   0:00  0.00% gconfd-2
  611      0      1  44    0  5864K  1508K select  2   0:00  0.00% syslogd
  878      0      1  44    0 24980K  4232K select  0   0:00  0.00% sshd
  887      0      1  44    0  6920K  1592K nanslp  0   0:00  0.00% cron
  477      0      1  44    0  2180K   652K select  2   0:00  0.00% devd
11214   1001      1  67    0  7232K  1852K wait    0   0:00  0.00% sh
11775   1001      1  50    0  7064K  2044K select  1   0:00  0.00% dbus-daemon
  937      0      1  76    0  5860K  1284K ttyin   1   0:00  0.00% getty
11229   1001      1  76    0  7232K  1888K wait    1   0:00  0.00% sh
  936      0      1  76    0  5860K  1284K ttyin   1   0:00  0.00% getty
  938      0      1  76    0  5860K  1284K ttyin   2   0:00  0.00% getty
  940      0      1  76    0  5860K  1284K ttyin   2   0:00  0.00% getty
  941      0      1  76    0  5860K  1284K ttyin   0   0:00  0.00% getty
  939      0      1  76    0  5860K  1284K ttyin   1   0:00  0.00% getty
  943      0      1  76    0  5860K  1284K ttyin   0   0:00  0.00% getty
  942      0      1  76    0  5860K  1284K ttyin   3   0:00  0.00% getty
  911      0      1  76    0  7976K  1640K select  1   0:00  0.00% inetd
11763   1001      1  54    0 15612K  2396K select  3   0:00  0.00% dbus-launch
  149      0      1  76    0  2736K  1044K pause   2   0:00  0.00% adjkerntz
79399   1001      1  64    0   395M 49184K futex   2   0:00  0.00% npviewer.bin
79397   1001      1  64    0   395M 49184K futex   2   0:00  0.00% npviewer.bin
79398   1001      1  64    0   395M 49184K futex   2   0:00  0.00% npviewer.bin
79394   1001      1  71    0   395M 49184K futex   2   0:00  0.00% npviewer.bin
```


----------



## davidgurvich (Feb 12, 2010)

That looks like using flash on freebsd over opensolaris requires about 5 times as much in the way of resources.  

I've actually tried to watch a lengthy flash video on freebsd and everything came to a standstill after about 20 minutes until 'killall npviewer.bin'.  Looks like flash on freebsd is not feasible on older systems with limited resources.

It's not good with linux but I can generally get through an entire show without bringing the system to a standstill.  Perhaps the initial smoothness is because freebsd allocates more and more resources to npviewer.bin until the system crashes?


----------



## dalfish (Mar 10, 2010)

Do you have npviewer. bin problem in opera. I m currently using linux opera on freebsd. i am quite satisfied with the Browser .NO hanging problems so far. i too had hanging problems with firefox. Regarding the main topic about linux flash. It works better in freebsd than on linux distros. I personally use ubuntu along with Freebsd. i can feel the difference. linux flash in freebsd is faster than ubuntu. Still i have no audio  while playing  youtube videos in freebsd.That s the only thing that is to be done. I feel Freebsd forums will definitely help me to solve it.


----------



## Oko (Mar 10, 2010)

Graaf_van_Vlaanderen said:
			
		

> For me flash works great in OpenSolaris. I can't say the same about the Linux Flashplayer. I'm just wondering, would it be technically possible to use the Solaris Flashplayer in BSD without any 'emulation' layer in between?



NO!!! Are you kidding?


----------



## Oko (Mar 10, 2010)

mdg583 said:
			
		

> How about _with_ an emulation layer? Does freebsd also have a solaris alternative to the linuxulator which could run the solaris binary? Just curious.


Used to have http://people.freebsd.org/~newton/freebsd-svr4/
but it is long dead. The same is true for OpenBSD. The only BSD which actively support Solaris emulation is NetBSD.


----------



## kpedersen (Mar 10, 2010)

If you don't like watching flash videos in fullscreen, and you like bugs. This may be prefect for you 

http://forums.freebsd.org/showthread.php?t=11386

If a virtual desktop is used (change in winecfg) then fullscreen mode can be made to work.

If you manage to get this working with firefox 3 (rather than 2) please share


----------



## atomicplayboy (Mar 11, 2010)

dalfish said:
			
		

> Do you have npviewer. bin problem in opera. I m currently using linux opera on freebsd. i am quite satisfied with the Browser .NO hanging problems so far. i too had hanging problems with firefox. Regarding the main topic about linux flash. It works better in freebsd than on linux distros. I personally use ubuntu along with Freebsd. i can feel the difference. linux flash in freebsd is faster than ubuntu. Still i have no audio  while playing  youtube videos in freebsd.That s the only thing that is to be done. I feel Freebsd forums will definitely help me to solve it.



I don't know about linux-opera, but I've been using native Opera with the www/opera-linuxplugins port to run flash10 without issues.

The no audio problem has been addressed a few times on the forum and mailing lists, though I can't remember the procedure. I seem to recall it has something to do with unlinked libraries. Search the forum and you should be able to find a fix.


----------



## calande (Mar 28, 2010)

Flash is such a nightmare, even more on FreeBSD 
I have tried to stay away from it, using alternatives such as Gnash and swdec, but I either get a grey placeholder, or nothing at all when the Flash videos/animations are recent 
I also tried Aragon's tutorial but ndiswrapper won't install (and maybe that's not that bad, reading the above comments!).
Of course, it's always better to run a native browser, especially that browser manufacturors take the time and effort to provide a FreeBSD version of their browsers, while they don't have to, after all. So it hurts me to have to run Opera Linux on FreeBSD, it would hurt even more to have to run Opera WiNE, just to have the latest version of Flash working flawlessly, as my wife likes to spend time on YouTube, to play Flash games and to send Flash christmas cards to her friendsâ€¦
Some hardcore advocates might say "_Don't use Flash, install FlashBlock, etcâ€¦_" but it's not a solution in my case. How can I convince my wife FreeBSD is better because she can't have fun sending and reading Flash christmas/birthday cards anymore? 

```
kill -9 wife
```


----------



## Unixicity (Mar 31, 2010)

Well, this is an old topic and such, but... no, Flash 10 works better on *Fedora*, which is technically superior to other distros around there (well-compiled toolchain, libc, and such), and, not by chance (I suppose), is used on the Linux emulation layer of FreeBSD. I know this because I have FreeBSD and Fedora on my desktop, and the performance of Flash on both are identical. I've never seen any other distro handle Flash so well. It is a pain on Ubuntu, Debian, OpenSuSE, Sabayon, Arch, and even Gentoo.

I apologize for this message, but my experience proves the contrary of what is stated on this topic.

(well, probably it will vary depending on hardware, but it is only a personal experience, not an undisputed truth)


----------



## calande (Mar 31, 2010)

You don't have to apologize, I suppose we're all open to comments and feedback here


----------



## vermaden (Mar 31, 2010)

Unixicity said:
			
		

> I know this because I have FreeBSD and Fedora on my desktop, and the performance of Flash on both are identical.



So You propably also know, that FreeBSD uses cut to minimum Fedora (currently release 10) to provide Linux compatibility


----------



## oliverh (Mar 31, 2010)

FYI: it's no emulation, it's a translation of system calls.


----------



## richardpl (Mar 31, 2010)

I have perfectly working flash video sites on FreeBSD, and I do not use linux or wine.


----------



## Unixicity (Apr 1, 2010)

vermaden said:
			
		

> So You propably also know, that FreeBSD uses cut to minimum Fedora (currently release 10) to provide Linux compatibility



Yes, the "minimum" is what matters. The emulation/translation of syscalls/whatever in FreeBSD seems to be very efficient, since it equates (at least with Flash) to a real Linux kernel running.


----------



## oliverh (Apr 1, 2010)

richardpl said:
			
		

> I have perfectly working flash video sites on FreeBSD, and I do not use linux or wine.



Without Linux?


----------



## richardpl (Apr 2, 2010)

Yes! Without linux.

quvi + cclive + mplayer (ffmpeg, x264, ...) + elinks

(all latest versions from git repos)

Why? Propiertary video players sucks.


----------



## davidgurvich (Apr 3, 2010)

That only handles sites similar to youtube and not all content even there.  You're treating flash as another video format but many sites use flash for navigation and other interactive processes.


----------



## richardpl (Apr 3, 2010)

Such sites are not worth looking.


----------



## oliverh (Apr 3, 2010)

richardpl said:
			
		

> Such sites are not worth looking.



Well, most people are thinking similar about Youtube or videos on the WWW per se. But I think it has something to do with your personal taste. Usually I'm happy without videos on the net and it would be nice to never see this crap again, that said it's just my very personal opinion. But we're way offtopic by now.


----------



## aragon (Apr 4, 2010)

richardpl said:
			
		

> quvi + cclive + mplayer (ffmpeg, x264, ...) + elinks


Do you ever have problems using these with Youtube?  I had cclive working initially, but now I just seem to get this error with video links:


```
error: parse: libquvi: no match: (?i)"video_id": "(.*?)"
```


----------



## zeiz (Apr 4, 2010)

Did you try this HOWTO?
I have nspluginwrapper installed and flash works fine with FF, Seamonkey and even Konqueror.


----------



## richardpl (Apr 4, 2010)

aragon said:
			
		

> Do you ever have problems using these with Youtube?  I had cclive working initially, but now I just seem to get this error with video links:
> 
> 
> ```
> ...



Did I ever mention in this thread that I am using latest stuff from git?


----------

