LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices

Reply
 
Search this Thread
Old 04-28-2010, 12:06 PM   #1
Linux31
Member
 
Registered: Aug 2004
Posts: 296

Rep: Reputation: 30
How to set capture card to channel 3 at start-up


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?

Thanks for the help.
 
Old 04-29-2010, 12:33 PM   #2
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,008

Rep: Reputation: 367Reputation: 367Reputation: 367Reputation: 367
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.
 
Old 04-30-2010, 10:42 AM   #3
Linux31
Member
 
Registered: Aug 2004
Posts: 296

Original Poster
Rep: Reputation: 30
Thanks for the suggestions.

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.

Anything look off here?

Thanks again for the help.
 
Old 04-30-2010, 11:12 AM   #4
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,008

Rep: Reputation: 367Reputation: 367Reputation: 367Reputation: 367
Your rc.local looks fine, except I think you need the /full/path/to/ivtv-tune
find out what this is with which ivtv-tune

You could also direct any errors from the command to a file
Code:
/full/path/to/ivtv-tune  -c3  &>  /home/linux31/ivtv-tune.log
If you are not sure rc.local is being run, add another line to it:
Code:
touch /home/linux31/rc.local.ran
Does the file /home/linux31/rc.local.ran get created ?

Do not remove the # on the # rc.local line !
 
Old 05-01-2010, 09:42 AM   #5
Linux31
Member
 
Registered: Aug 2004
Posts: 296

Original Poster
Rep: Reputation: 30
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
 
Old 05-01-2010, 10:09 AM   #6
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,008

Rep: Reputation: 367Reputation: 367Reputation: 367Reputation: 367
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 ?)
 
1 members found this post helpful.
Old 05-02-2010, 05:55 AM   #7
Linux31
Member
 
Registered: Aug 2004
Posts: 296

Original Poster
Rep: Reputation: 30
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help determining channel frequencies to capture for VLC tamray Linux - Software 6 10-06-2009 10:30 PM
"Sky 104" 4 channel bttv capture card lukew151 Linux - Hardware 4 04-03-2009 05:35 PM
Unable to set up Video Capture (Composite-in) with ATI Rage Fury Pro Card afx2029 Linux - Software 0 01-15-2006 06:46 PM
Some hard questions I believe -Channel Bindings(soundcard), ntfs-capture and apm?? Nihongoga Slackware 12 07-22-2004 12:25 PM
Selection of video capture card or how to set up Hauppauge on SuSE 9.0/9.1 LittleAngel Linux - Hardware 2 05-06-2004 09:50 AM


All times are GMT -5. The time now is 11:57 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration