Welcome to the Linux Foundation Forum!

Driver for Built-in webcam

hi! i want to ask what program can support the built-in webcam on EasyNote BU45 Series and easy to setup. im using Ubuntu 10.4 LTS. i hope you help me.. THANK YOU very much...

Comments

  • mfillpot
    mfillpot Posts: 2,177
    I do not know if you webcam is supported by out of the box, but if it is then you can use a program called cheese to activate the webcam to take pictures.
  • haliparotin
    haliparotin Posts: 52
    hi! Thank you for reply.. i try to install cheese but my built-in webcam is not fucntion and say no Device detected.. i hope anyone can help me about this.
  • Goineasy9
    Goineasy9 Posts: 1,114
    In a terminal, give us the output of:

    lsusb

    we really need to know what type of webcam it is before we can help you.
  • haliparotin
    haliparotin Posts: 52
    ok thank you for reply.. this is the result on lsusb under terminal

    Bus 001 Device 003: ID 174f:a821 Syntek Web Cam - Packard Bell BU45, PB Easynote MX66-208W

    i Hope you help me.. THANK YOU..
  • Goineasy9
    Goineasy9 Posts: 1,114
    Most of the posts I've found are a bit old, from 2 to 3 years back. The driver for that webcam is available at souceforge, link below:

    http://syntekdriver.sourceforge.net/

    Mepis is a Debian derivative, as is Ubuntu, and a post from 2007 tells how a Mepis user got the webcam working on an older Mepis install. I'll give you the link to the Mepis thread:

    http://www.mepislovers.org/forums/showthread.php?t=12459

    My advice would be to see if Ubuntu has a recent version of the .deb used in the Mepis thread and see if you can install it using the instructions given in that thread. (Actually it's a single post).

    If your adventurous, you can look at the documentation on the sourceforge site and see if that helps you also.
  • haliparotin
    haliparotin Posts: 52
    hi! Goineasy9 THANK YOU for reply.. i try and im happy but i have slight problem.. my video is in vflip position and i need to type the command everytime i used.. they have a way i can use the command without typing again? THANK YOU.....
  • jabirali
    jabirali Posts: 157
    haliparotin wrote:
    (...) i need to type the command everytime i used.. they have a way i can use the command without typing again?
    Do you mean that you have to rerun "modprobe stk11xx" every time you reboot the computer? In that case, you should just follow the second hint at the page linked to by Goineasy9, which is to add these lines to the file /etc/modules (as root):
    videodev
    stk11xx
    

    To edit that file as root, just run this command in a terminal window:
    sudo gedit /etc/modules
    
  • haliparotin
    haliparotin Posts: 52
    hi! jabirali thank you for reply.. i try your instruction

    videodev
    stk11xx

    To edit that file as root, just run this command in a terminal window:
    Code:
    sudo gedit /etc/modules


    but its the same problem.. the video is the same vflip.. thats why i need to type again this to my terminal

    #echo 1 >/sys/class/video4linux/video0/vflip

    for make my video in right position...

    i hope they have other way can solve this.. thank you....
  • jabirali
    jabirali Posts: 157
    haliparotin wrote:
    #echo 1 >/sys/class/video4linux/video0/vflip
    Aha, then I think I have a solution :)

    There is a file in most Linux distibutions, /etc/rc.local, that lets you run custom commands when the system boots. To automatically do that vflip-trick, open that file as root:
    sudo gedit /etc/rc.local
    

    And then add your command there:
    echo 1 >/sys/class/video4linux/video0/vflip
    

    The file may already contain some text. If there's a line with the command "exit 0", make sure your vflip command comes before that (or it won't be executed).
    echo 1 >/sys/class/video4linux/video0/vflip
    exit 0
    
  • haliparotin
    haliparotin Posts: 52
    hi! jabirali THANK YOU for reply and help.. your instruction is WORK.. but everytime i update my Ubuntu, my built-in webcam is not work.. i always follow this instruction again.. http://www.sonyjose.in/blog/?p=51 any idea can help me.. THANK YOU..
  • marc
    marc Posts: 647
    haliparotin wrote:
    hi! jabirali THANK YOU for reply and help.. your instruction is WORK.. but everytime i update my Ubuntu, my built-in webcam is not work.. i always follow this instruction again.. http://www.sonyjose.in/blog/?p=51 any idea can help me.. THANK YOU..

    That will happen everytime you update your kernel.

    The only way to solve the problem is to automate the process. Maybe with a script...
  • jabirali
    jabirali Posts: 157
    Like Marc says, every time you update your Linux kernel you will have to update your drivers as well. If the drivers were in the official repositories, this would be handled automatically, but unfortunately it in your case seems like you have to manage it manually.

    Here's a quick script that compiles and installs the driver for you. Save it and make it executable, and then run it in a terminal every time you notice the kernel has been upgraded or the webcam stops working.
    #!/bin/bash
    
    # Make a temporary working directory, and clean up if interrupted
    echo -e "\e[32;1mUpdating webcam driver...\e[0m"
    tmpdir=$(mktemp -d) || exit 1
    function clean {
    	echo -e "\e[31;1mAborting...\e[0m"
    	rm -rf -- '$tmpdir'
    }
    trap clean EXIT
    cd "$tempdir"
    
    # Get driver sources, compile and install
    echo -e "\e[33;1mDownloading sources...\e[0m"
    ( svn co https://syntekdriver.svn.sourceforge.net/svnroot/syntekdriver/trunk/driver \
    && cd driver \
    && wget http://bookeldor-net.info/merdier/Makefile-syntekdriver \
    && echo -e "\e[33;1mCompiling driver...\e[0m" \
    && make -f Makefile-syntekdriver \
    && echo -e "\e[33;1mInstalling driver...\e[0m" \
    && sudo make -f Makefile-syntekdriver install \
    && sudo modprobe stk11xx ) \
    || ( clean; exit 1 )
    
    # Clean up the mess and exit
    rm -rf -- "$tempdir"
    trap - EXIT
    echo -e "\e[32;1mSuccessfully installed driver!\e[0m"
    exit 0
    
  • marc
    marc Posts: 647
    Outstanding job Jabir.

    Just to make sure he knows
    sudo chmod +x scriptfile
    

    To make the script executable and:
    sudo ./scriptfile
    

    To run it!
  • jabirali
    jabirali Posts: 157
    Thanks for adding the instructions, Marc :)

    I just want to add that you don't need to execute the script with sudo:
    ./scriptfile
    
    This script will run sudo itself when the time comes to install the software, so you won't need to do the entire compilation process as root.
  • haliparotin
    haliparotin Posts: 52
    if ever i create this script what file name and where i can save this and what command i can use for run this? THANK YOU for help me..
  • jabirali
    jabirali Posts: 157
    The script can be saved anywhere you want, under any name you desire. You then run it by writing the full filename in a terminal like explained above.

    For example, you could create a folder called "bin" in your home folder, and place the script there under the filename "webcam"; in other words, save the script as the file /home/username/bin/webcam. You would in that case be able to run the script by opening a terminal, and running this command:
    ./bin/webcam
    

    As mentioned in previous posts, you will have to make the script executable before you run it for the first time. (This is a security feature in Linux/Unix systems; programs cannot be run before the user gives them permission to do so.) In this case, that can be done by running the following command:
    chmod +x ./bin/webcam
    
  • haliparotin
    haliparotin Posts: 52
    hi! Thank you for help.. i try your instruction to make a script but they have a error below:

    e[32;1mUpdating webcam driver...e[0m
    e[33;1mDownloading sources...e[0m
    ./bin/webcam: line 16: syntax error near unexpected token `&&'
    ./bin/webcam: line 16: `&& cd driver '
    e[31;1mAborting...e[0m

    what can i do to make this run perfect.. THANK YOU for support
  • marc
    marc Posts: 647
    Remove all the && and it will work
  • jabirali
    jabirali Posts: 157
    The original script worked fine on my machine, but it seems like the forums removed all unescaped backslashes from the code... Here, I fixed it:
    #!/bin/bash
    
    # Make a temporary working directory, and clean up if interrupted
    echo -e "\\e[32;1mUpdating webcam driver...\\e[0m"
    tmpdir=$(mktemp -d) || exit
    function clean {
    	echo -e "\\e[31;1mAborting...\\e[0m"
    	rm -rf -- '$tmpdir'
    }
    trap clean EXIT
    cd "$tempdir"
    
    # Get driver sources, compile and install
    echo -e "\\e[33;1mDownloading sources...\\e[0m"
    ( svn co https://syntekdriver.svn.sourceforge.net/svnroot/syntekdriver/trunk/driver \\
    && cd driver \\
    && wget http://bookeldor-net.info/merdier/Makefile-syntekdriver \\
    && echo -e "\\e[33;1mCompiling driver...\\e[0m" \\
    && make -f Makefile-syntekdriver \\
    && echo -e "\\e[33;1mInstalling driver...\\e[0m" \\
    && sudo make -f Makefile-syntekdriver install \\
    && sudo modprobe stk11xx ) \\
    || ( clean; exit 1 )
    
    # Clean up the mess and exit
    rm -rf -- "$tempdir"
    trap - EXIT
    echo -e "\\e[32;1mSuccessfully installed driver!\\e[0m"
    exit 0
    
  • haliparotin
    haliparotin Posts: 52
    hi! THANK YOU for reply.. itry your command but still have an error..



    Updating webcam driver...
    Downloading sources...
    ./bin/webcam: line 16: syntax error near unexpected token `&&'
    ./bin/webcam: line 16: `&& cd driver \ '
    Aborting...


    what can i do this error? sorry i dont have any idea for script.. thank you...
  • jabirali
    jabirali Posts: 157
    Sorry about the late reply, I've been kind of busy lately :)

    But I now know what the problem is, that was a difficult one to spot! Copying and pasting from the forums seems to put an extra whitespace at the end of each line, and for this script, that meant replacing '\\<enter>' with '\\ <enter>'. This might not seem like much, but to the Bash interpreter, it means "regard the following whitespace as a character" instead of "ignore the following newline", which breaks the '&&'-logic used in the script.

    You can fix the script like this:
    sed 's/\\\\\\ /\\\\/g' ~/bin/webcam > ~/bin/webcam
    
  • marc
    marc Posts: 647
    Would you mind explaing what that sentence does? I mean, step by step ;)
  • jabirali
    jabirali Posts: 157
    marc wrote:
    Would you mind explaing what that sentence does? I mean, step by step ;)
    Sure, I'll explain everything :)

    To take it from the beginning, you might be familiar with the basic logic operators '&&' and '||'. The following is used to run command_1, and then command_2 - if and only if command_1 is successful.
    command_1 && command_2
    
    This is used to run command_2 only if command_1 is not successful:
    command_1 || command_2
    
    In the original script, I wrote something like this:
    ( command_1 && command_2 && command_3 ) || ( command_4; command_5)
    
    The parentheses are used to glue together several commands into one block of code. If one of the commands inside the first parentheses fails (that is, command_1, command_2 or command_3), it counts as if the whole block of commands fails - and then the '||' operator makes sure the second block of code is executed instead (command_4 and command_5).

    But when a block of commands consists of seven different commands, the script gets easier to manage if the commands are spread through different lines. You can do this by escaping the newlines ("\\<newline>" ), so that Bash will ignore them:
    ( command_1 \\
    && command_2 \\
    && command_3 ) \\
    || ( command_4; command_5)
    
    But the forums added whitespace to the end of each line, here represented by red underscores:
    ( command_1 \\_
    && command_2 \\_
    && command_3 ) \\_
    || ( command_4; command_5)
    This means that Bash reads "\\<space><newline>" instead of "\\<newline>", which makes the interpreter ignore the whitespace instead of ignoring the newline. (I discovered this by using gvimdiff to compare the old, working script I had on my harddrive with with a copy of the script I copy/pasted from the forums.)

    I then used sed, a tool used for search-and-replace actions, to correct this. Using sed is quite simple:
    sed 's/old/new/g' filename
    
    The "s" stands for "substitute", the slash is a delimiter, and the "g" at the end means "global". Sed will then read the file filename and substitute every occurrence of "old" in filename with "new", and write the modified file to standard output.

    In this case, I wanted to replace every occurence of '\\ ' with just '\\'. Since Sed itself interprets backslashes (so that you e.g. can replace all newlines by using '\\n', or all tabs with '\\t' ), the backslashes themselves have to be escaped. If we also escape the whitespace, the pattern '\\ ' becomes '\\\\\\ ', and '\\' becomes '\\\\'. We also want to save the output back to the original file by piping the output:
    sed 's/\\\\\\ /\\\\/g' filename > filename
    
    A more specific solution, and in many cases a better one, would be to replace '\\<space><newline>' with '\\<newline>':
    sed 's/\\\\\\ \\n/\\\\\\n/g' filename > filename
    
    If not given any input files, sed will read standard input, so something like this should work equally well:
    cat filename|sed 's/old/new/g' > filename
    
    The 'g' at the end can also be replaced with a number:
    sed 's/old/new/1' # Replace only 1. occurrence of "old"
    sed 's/old/new/2' # Replace only 2. occurrence of "old"
    
    Hope this helps :)
  • marc
    marc Posts: 647
    Outstanding Jabir, thanks a lot :D
  • THANK YOU GUYS for reply..
  • nivea
    nivea Posts: 1
    hi,
    i am using fedora 13 in vmware. i have installed the updates.
    But still ma webcam is not working.
    i have installed cheese and
    error i am getting device not found.
    m using dell insiron n5010 inbuilt webcam
    can plz sort out vat the problem is…
  • Goineasy9
    Goineasy9 Posts: 1,114
    I have Fedora 13 running on a few boxes here in the house, along with webcams and cheese. I am not, however, a vmware user. I would suspect though, that it has something to do with the virtual environments usb recognition not be set up correctly, or, an additional module that needs to be activated to use the usb.
    If that's not the case, I'm sure there will be someone along soon that actually uses vmware that can help.

Categories

Upcoming Training