Menu

Low fps when no other traffic

Pavel
2013-02-09
2013-05-30
  • Pavel

    Pavel - 2013-02-09

    I am now working on raspberry-pi based Wifi-RC car with Microsoft HD3000 webcam. And I have a strange problem with fps.
    Even mjpeg-streamer is started with -f 30 option I do not get fps higher then 3 if there is no other traffic.
    What I mean is when only mjpeg-streamer is running i get 1-3 fps (even at QVGA), but if I start another process that initiates enough TX (in my case it was ssh connection with top -d .05 running) I get full 20-30fps even at 1280x720
    I tried changing priority (renice) with no result since CPU load is never higher then 30%
    I am now stuck with this because I do not even know in which direction should I dig

    Raspberry pi Model B rev 2.0 with updated Raspbian on it

     
  • Pavel

    Pavel - 2013-02-09

    Just found out this behaviator is not seen on all resolutions… On QVGA it even freezes with top -d .5 running, but on 800x600 or 1280x720 it behaves as mentioned above

     
  • Márton Miklós

    Márton Miklós - 2013-02-09

    As far as I know Raspberry PI ethernet card is also hooked to the same USB hub where the external USB connectors connected. This means that the webcam and the ethernet NIC needs to share one USB upstream port's bandwidth to the SoC.

     
  • Pavel

    Pavel - 2013-02-09

    It's connected via Wifi, not ethernet. But same happens when connected via eth

     
  • Pavel

    Pavel - 2013-02-09

    Also, if I understand you correctly framerate should drop when there is (heavy) traffic on eth/wifi. But in my case it increases drammatically instead

     
  • DaneDaneDane

    DaneDaneDane - 2013-02-09

    I was told the RaspberryPi does not have that powerful of a processor.
    Also, how about heatsink on the cpu?

     
  • Márton Miklós

    Márton Miklós - 2013-02-09

    sulya: yes your problem is strange for me too, but the mjpg-streamer server is simple like a stone.

    danedanedane:
    if you use jpg method the mjpg-streamer does not consumes too much CPU.

     
  • Pavel

    Pavel - 2013-02-09

    danedanedane:
    800x600@30FPS gives only 6% cpu load, while QVGA gives even less- 2.5-3% (and 200-300 kBps upstream), so CPU or up/downstream is for sure not to blame.
    5 minutes ago I also checked if the current was the problem, but the same happens when the webcam and the wifi dongle are on external adapter

     
  • andrew

    andrew - 2013-02-09

    Sulya… I'm working on a similar project (an autonomous robot controlled by a Raspberry Pi that relays video to an Android tablet using this software for the webcam stream). I'm running a Logitech C100 webcam at 320x480 at about 7 fps without any issue and only about 1% CPU usage. The frame rate is a bit disappointing, but it gives just enough feedback to allow me to drive the robot by webcam alone (though that's not actually the point of my project). However… if I point my robot at an LCD TV or monitor, the frame rate on the tablet jumps to 24fps (which is the fps I actually have specified). If I then point the robot's camera away at something still, the frame rate returns to 6-7 fps. The only way I've found to get the frame rate that high is pointing it at a TV. Very strange! If I point the camera at a painting on the wall I get 7fps, but I can watch 24fps TV via the very same setup?!

    Any theories?

     
  • andrew

    andrew - 2013-02-09

    Sorry, for the sake of correctness: 320x240. I can also run at 640x480 (the maximum supported by the C100) but the CPU usage is marginally higher… Though I see the same weird effect when I point at a TV!

     
  • Pavel

    Pavel - 2013-02-09

    prandrew:
    I think your case is low light: framerate drops when exposure time increases, sure with those tiny-lens webcams as mine or yours. Try adding extra light (a lot of light for some webcams) or use it in daylight. imho, that should do the trick

     
  • andrew

    andrew - 2013-02-09

    Confirmed! Thanks Sulya! I shone a torch directly into my webcam and the frame rate hits the maximum. It seems this C100 needs rather a lot of light - but it does run glitch-free without a powered USB hub. I actually tried 3 other webcams and none of them worked properly. This works, but only in very bright light.

    Thanks for your help! Good luck with yours!

     
  • Márton Miklós

    Márton Miklós - 2013-02-10

    Try to play with the exposure controls.

     
  • Pavel

    Pavel - 2013-05-21

    Sorry for kinda beating an dead horse, but… I've recently moved to arch linux on my raspberry pi (no HW changes), as I do not need any GUI, and I've found out there are no problems described above- everything is smooth and consistant, no freezes whatsoever. So I think raspbian was the reason

     

Log in to post a comment.