Linux - HardwareThis forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I'm running VideoLan (VLC) under Ubuntu 9.1 (Karmic) (64-bit) with a Haupaugge-150 card. Right now when I want to get the TV feed in through the coax, I first have to run "ivtv-tune -c3" to set the channel for cable.
I've tried adding a line to the vlc.config but no joy. Googling found an answer for Fedora but it doesn't match the files I'm seeing in those directories for Ubuntu.
What I'd like would to have ivtv set the channel automatically at boot or start-up. Any suggestions?
You could just make a "wrapper" script, like this:
Code:
#!/bin/bash
ivtv-tune -c3
vlc whatever options you require
Call it watchtv
Make it executable:
Code:
chmod +x /path/to/watchtv
Put it somewhere on your $PATH ( /usr/local/bin perhaps ? )
Make a link-to-application to it from your desktop, or menu-system.
Alternatively, perhaps you could put ivtv-tune -c3 in rc.local on a line before the final exit 0 and the channel should be set before you have even logged in.
I tried the rc.local one but still am not having any success. As far as I can tell, using the chmod command and checking the permissions, it should work. Also, the check box is checked about making the files executable when I right-click on the file.
Here's what I have.
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
ivtv-tune -c3
exit 0
I've also tried it with and without a hash mark in front of "rc.local" but no go.
I'm sure it's not a setting in VLC because as soon as I type in "ivtv-tune -c3" in the terminal, the picture and audio immediately start. It's as if, for some reason, I still have not successfully made rc.local an executable.
Thanks for the suggestions. I made the changes to rc.local you mentioned (see below) and they produced the .log and .ran files, however both were empty and the channel is still not being set. I used Ubuntu's file browser to verify that /usr/bin/ivtv-tune is the only copy of that file on the machine.
The funny thing is that if I type just "ivtv-tune -c3 in the terminal window, it works, but no matter how I type it in rc.local, it won't. Since the .log and .ran files are being created, I take that to mean that it's not a problem with rc.local, as such, but getting ivtv-tune to start from within it.
Since there is an "exit 0" at the end, should there be something at the beginning like "start 0"?
Does this suggest anything? Thanks again for the help.
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
/usr/bin/ivtv-tune -c3
/usr/bin/ivtv-tune -c3 &> /home/me/ivtv-tune.log
touch /home/me/rc.local.ran
exit 0
Not sure what is happening here, and I don't have a TV card.
The fact that the two files are being created means that rc.local is being run, and there were no errors from the ivtv-tune command. But it did not do what you wanted (Maybe the wrong channel is being set when you login, or start your TV viewing program, I don't know).
The final exit 0 means "Exit this script, with an error number of zero.
An "error number" of zero means "There was no error". Any other number should reflect some sort of error.
Maybe time to try something different...
Put rc.local back as it was.
Make a "wrapper script" as I said in post #2 ( perhaps you have to start vlc before you give the ivtv-tune command ?)
Thanks for the suggestions. Channel 3 is correct so that's not it. I'm closer than I was before since I now know it's the rendering of the ivtv command. I'll keep working on it. Since I'm also trying to learn how to set up a cron job to schedule the card to record a program, it may be time to find a good book on Linux shell commands and syntax. Googling has been more miss than hit with some conflicting information.
But anyway, thanks again for your help. It's gotten me closer to a solution.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.