Webcam in Linux on Sony VGN-BX61MN

For anyone interested in using linux on this laptop, the following should be of help. The camera is labeled as Motion Eye but lsusb reports the device as:

05ca:1839 Ricoh Co., Ltd Visual Communication Camera VGP-VCC6 [R5U870]

After alot of messing around and installing defunct kernel modules, that seem to work, but actually include the wrong firmware versions. I found that the work being done by Alex Hixon on a generic R5U87x driver to be the most up to date. Previously the project rolled its own kernel module to support the camera, However the current version works by providing userspace tools to upload firmware to the device so that the standard uvcvideo driver in the kernel can communicate with the camera.

Unfortunately there wasn’t much around in the way of a howto to explain how to use the code. So I had to figure out the following for myself.

First of all install mercurial and some other project dependencies

sudo apt-get install git-core libglib2.0-dev libusb-dev

Now you can download the source

git clone https://github.com/p6/R5U87X.git

Change into the source directory and issue the following three commands.

cd R5U87X
make clean
make
make rules
sudo make install

If your user isn’t part of the video group you will probably have to modify /etc/group and make yourself a member of that group otherwise you might experience Permission Denied errors.

After you have rebooted you can test using mplayer

mplayer tv:// -tv driver=v4l2

Also make sure you can record because uploading the wrong firmware will in some cases allow you to see output but not record it.

mencoder tv:// -tv driver=v4l2:device=/dev/video0 -nosound -ovc lavc -o test.avi

If you want to clean things up afterwards you can run the following commands
sudo apt-get --purge remove mercurial libglib2.0-dev libusb-dev
sudo apt-get --purge autoremove
rm -r R5U87X

You may find the above steps also work for the following devices:

05ca:1830 Ricoh Co., Ltd Visual Communication Camera VGP-VCC2 [R5U870]
05ca:1832 Ricoh Co., Ltd Visual Communication Camera VGP-VCC3 [R5U870]
05ca:1833 Ricoh Co., Ltd Visual Communication Camera VGP-VCC2 [R5U870]
05ca:1834 Ricoh Co., Ltd Visual Communication Camera VGP-VCC2 [R5U870]
05ca:1835 Ricoh Co., Ltd Visual Communication Camera VGP-VCC5 [R5U870]
05ca:1836 Ricoh Co., Ltd Visual Communication Camera VGP-VCC4 [R5U870]
05ca:1837 Ricoh Co., Ltd Visual Communication Camera VGP-VCC4 [R5U870]
05ca:1839 Ricoh Co., Ltd Visual Communication Camera VGP-VCC6 [R5U870]
05ca:183a Ricoh Co., Ltd Visual Communication Camera VGP-VCC7 [R5U870]
05ca:183b Ricoh Co., Ltd Visual Communication Camera VGP-VCC8 [R5U870]
05ca:183e Ricoh Co., Ltd Visual Communication Camera VGP-VCC9 [R5U870]

Advertisement

41 thoughts on “Webcam in Linux on Sony VGN-BX61MN”

  1. THANK YOU!!!
    It worked! I’m new to Ubuntu and I have very little troubleshooting experience with linux and THANK GOD YOU POSTED THIS! Well appreciated man! I have a question though, it is safe to delete the r587x folder? I don’t know how linux installations work see.

    1. Hey, the link on Alex’s repository no longer exists. Now I need this laptop to work for one of my many kids 😀 Do you happen to know where I can get a copy of this? All the solutions seem to point to Alex’s repository, but it is no longer there. Your help is greatly appreciated!

  2. Thanks a lot. It worked perfectly for Sony Vaio VGN-CR24G/B. Probably this thread is the most useful one that I found out on the net while fixing up the problem of the webcam in the laptop with Ubuntu 9.10 installed in it.

    best regards

  3. woow such a nice explanation ! Thank you very much. I am newbie in Linux so i am impressed 😀 And i LOVE LINUX !!!

  4. Great post. it worked perfectly, you need to put this as solved and posted to the ubuntu forums, a lot of people are having problems with this webcam. thanks a lot man.

  5. Hi, I am Pawan Rana,
    i have a sony vaio VGN SZ483N with a built-in webcamand mic.
    how can i use this in ubuntu 11.10?
    I also have bio-metric finger print sensor and I have seen fingerprints in terminal.
    How can i use this in ubuntu 11.10 ?
    please help.

  6. For the webcam the first step would be to run the command lsusb and see if the output has [R5U870]. If it does then you are in luck as the driver listed on this site is for that device.

    As for the fingerprint sensor I have no idea. I wasn’t able to get the fingerprint sensor working under linux for my laptop either.

  7. Unfortunately this did not work on my Vaio SZ370P:
    05ca:1830 Ricoh Co., Ltd Visual Communication Camera VGP-VCC2 [R5U870]

    …on Linux Mint 18 x64 – Cinnamon:

    ~ $ mplayer tv:// -tv driver=v4l2
    MPlayer 1.2.1 (Debian), built with gcc-5.3.1 (C) 2000-2016 MPlayer Team
    mplayer: could not connect to socket
    mplayer: No such file or directory
    Failed to open LIRC support. You will not be able to use your remote control.

    Playing tv://.
    TV file format detected.
    Selected driver: v4l2
    name: Video 4 Linux 2 input
    author: Martin Olschewski
    comment: first try, more to come ;-)
    v4l2: unable to open '/dev/video0': No such file or directory
    v4l2: ioctl set mute failed: Bad file descriptor
    v4l2: 0 frames successfully processed, 0 frames dropped.

    Exiting... (End of file)

    After referencing the bitbucket webpage, I also noticed the following command was not mentioned here: “sudo r5u87x-loader –reload”

    ~ $ sudo r5u87x-loader --reload
    r5u87x firmware loader v0.2

    Searching for device...
    Found camera: 05ca:1830
    Camera reports positive microcode state.
    Camera reports microcode version 0x0100.
    Not doing anything - camera already setup.

    Successfully uploaded firmware to device 05ca:1830!
    Reloading uvcvideo module...
    Finished.
    ~ $

    Looks like it somewhat installed and loaded. However, cheese and skype do not detect a webcam at all.
    …Yeah, it’s an old laptop and proprietary crap built in but it would be slightly convenient even if this crappy 1 or 2 megapixel cam worked. Any suggestions?

    1. It seems as though the driver loaded, but it didn’t map the device to /dev/video0 have you tried looking at the kernel messages using dmesg after you run the reload command?

  8. I just want to say that this worked perfectly on a 10 year old Sony Vaio (vgn-cr353) on Linux Mint 19.3. Followed the instructions to the letter, rebooted, and everything worked perfect in Cheese.

  9. Linux noob here with absolutely no clue what all the commands did. But hey, it’s 2020 and your instruction still works! It’s the first time that I managed to fix something on Linux on my own. This brought back an old laptop to life that we will use for our homeschooling kids who do not have their own devices. Worked on a Sony Vaio VGN-CR31Z with a Ricoh Camera VGP-VCC6 on Linux Mint 18.1

  10. Alex’s page is down and I don’t now how to enable the driver in ubuntu, which apparently is already in, according to github’s comments.

  11. Interesting posts! I have had a Sony VAIO laptop for YEARS as a happy user. The only thing that bothers me is the Motion Eye camera. It DOES work in principle, but the picture is VERY fuzzy (eg. when running ZOOM, Skype or similar. I wonder why.
    lsusb says…
    Bus 001 Device 002: ID 05ca:183e Ricoh Co., Ltd Visual Communication Camera VGP-VCC9 [R5U870]
    sudo inxi -F returns the following info:
    System: Host: hslaptop Kernel: 5.4.0-52-generic x86_64 bits: 64 Console: tty 8 Distro: Ubuntu 20.04.1 LTS (Focal Fossa)
    Machine: Type: Laptop System: Sony product: VGN-AW11M_H v: C6010CXT serial: 28282369-5004308
    Mobo: Sony model: VAIO serial: N/A BIOS: American Megatrends v: R0200Y2 date: 08/12/2008
    Graphics: Device-1: NVIDIA G98M [GeForce 9300M GS] driver: nvidia v: 340.108
    Display: server: X.Org 1.20.9 driver: nvidia unloaded: fbdev,modesetting,nouveau,vesa resolution: 1680×945~60Hz
    OpenGL: renderer: GeForce 9300M GS/PCIe/SSE2 v: 3.3.0 NVIDIA 340.108
    Any idea what I might be able to do – besides getting a new laptop?!?
    Regards from Austria
    H. Stoellinger

      1. Hello,
        Thanks for the quick reply! Not being a Linux-“nerd”, it might be quite a project to install the R5U870 driver. I will “embark” on this journey and might get back to you again in the course of doing so.
        Regards
        H. S.

  12. Regarding your question: I only have Kubuntu 20.10 on the laptop, in addition to Kubuntu 20.04. The camera doesn’t work on that – somewhat newer – system.

    1. Typically these cameras and laptops come distributed with drivers for Microsoft Windows, so my question was whether the same issue existed (if and when) windows was used on the laptop.

      1. Thanks, Giles! Difficult question: I got rid of Windows five, six years ago. I don’t remember anymore whether the camera worked before then. But, I assume it did, don’t remember anything negative… Hmh…
        I suppose I will try to implement your suggestions. Unfortunately I don’t use the laptop for anything like compiling stuff. So i will have to install the base for doing so before going ahead…

      1. The command `git clone https://github.com/p6/R5U87X.git` is what you need, it used to be hosted on bitbucket which is what the hg clone command is for, i.e the git one replaces the other, you don’t need to do both, the README is incorrect and hasn’t been updated since it was moved to github. I’ve put in a pull request to get the README corrected, but all you need to do is follow the instructions in my post above, or just replace the hg clone command for the git clone command if following the README.

  13. Sorry to be a nuisance! Now when running “make” I get the error answer.
    cc -g -Wall -o loader loader.o `pkg-config –libs glib-2.0 libusb`
    /usr/bin/ld: i386 architecture of input file `loader.o’ is incompatible with i386:x86-64 output
    collect2: error: ld returned 1 exit status
    make: *** [Makefile:36: loader] Error 1
    My system is 64bit…

      1. That seemed to work. It all went rather quickly, however! “make rules” came back with “nothing to do”, “make install” didn’t produce any errors, was done in only a second or two. Then, after re-booting, I tried testing with “mplayer tv:// -tv driver=v4l2”.
        I got lots of errors. They start like this…
        —————–
        mplayer tv:// -tv driver=v4l2
        Creating config file: /home/hs/.mplayer/config
        MPlayer 1.3.0 (Debian), built with gcc-9 (C) 2000-2016 MPlayer Team
        do_connect: could not connect to socket
        connect: No such file or directory
        Failed to open LIRC support. You will not be able to use your remote control.

        Playing tv://.
        TV file format detected.
        Selected driver: v4l2
        name: Video 4 Linux 2 input
        author: Martin Olschewski
        comment: first try, more to come 😉
        v4l2: your device driver does not support VIDIOC_G_STD ioctl, VIDIOC_G_PARM was used instead.
        Selected device: UVC Camera (05ca:183e): Sony Vi
        Capabilities: video capture streaming
        supported norms:
        inputs: 0 = Camera 1;
        Current input: 0
        Current format: YUYV
        tv.c: norm_from_string(pal): Bogus norm parameter, setting default.
        v4l2: ioctl enum norm failed: Inappropriate ioctl for device
        Error: Cannot set norm!
        Selected input hasn’t got a tuner!
        v4l2: ioctl set mute failed: Invalid argument
        ————————————-
        and, finally, ad infinitum…
        V: 0.0 74/ 74 ??% ??% ??,?% 0 0
        [vdpau] Error when calling vdp_output_surface_create: A catch-all error, used when no other error code applies.
        [vdpau] Error when calling vdp_output_surface_create: A catch-all error, used when no other error code applies.
        [vdpau] Error when calling vdp_output_surface_create: A catch-all error, used when no other error code applies.
        [vdpau] Error when calling vdp_presentation_queue_block_until_surface_idle: An invalid handle value was provided.
        [vdpau] Error when calling vdp_video_mixer_render: An invalid handle value was provided.
        [vdpau] Error when calling vdp_presentation_queue_display: An invalid handle value was provided.
        [vdpau] Error when calling vdp_presentation_queue_display: An invalid handle value was provided.
        V: 0.0 75/ 75 ??% ??% ??,?% 0 0
        [vdpau] Error when calling vdp_presentation_queue_block_until_surface_idle: A catch-all error, used when no other error code applies.
        [vdpau] Error when calling vdp_presentation_queue_block_until_surface_idle: A catch-all error, used when no other error code applies.
        [vdpau] Error when calling vdp_presentation_queue_display: An invalid handle value was provided.
        V: 0.0 76/ 76 ??% ??% ??,?% 0 0
        …..

  14. This site has given the first really helpful contribution to getting the webcam working on an old VGN-FZ11Z. Thanks for your assistance. Cheese now works if the Video Resolution is set to 320 x 240. Quality is not wonderful, but at least is proves that the camera is still working. The picture is flipped or upside down. I’m slowly working through various suggestions in the internet on how to change the orientation.
    Zoom still does not show picture, although the green camera light comes on. There doesn’t appear to be much information available about changing the resolution in Zoom.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s