View unanswered posts    View active topics

All times are UTC - 6 hours





Post new topic Reply to topic  [ 55 posts ] 
Go to page Previous  1, 2, 3, 4  Next

Print view Previous topic   Next topic  
Author Message
Search for:
 Post subject:
PostPosted: Thu Mar 31, 2005 4:10 pm 
Offline
Joined: Thu Mar 25, 2004 11:00 am
Posts: 9551
Location: Arlington, MA
Did you remember to start the script with the proper #! magic and chmod +x?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 31, 2005 4:47 pm 
Offline
Joined: Sat Aug 07, 2004 1:55 am
Posts: 219
Location: West Lafayette, IN
no idea what you're talking about... this is my first linux script, so I'm probably going about it all wrong...

My script currently reads:

Code:
 
xmodmap /home/.xmodmaprcvid | mplayer -fs -zoom -quiet -vo xv %s
xmodmap /home/.xmodmaprc


What else do I need to add to make this work?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 31, 2005 4:47 pm 
Offline
Joined: Mon Oct 06, 2003 10:38 am
Posts: 4978
Location: Nashville, TN
ahh yes hash bang bin bash

anyone else think the guys that wrote this were either drug dealers or huge fans of the old batman series? :lol:

_________________
Have a question search the forum and have a look at the KnoppMythWiki.

Xsecrets


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 31, 2005 6:59 pm 
Offline
Joined: Sat Aug 07, 2004 1:55 am
Posts: 219
Location: West Lafayette, IN
OK, so I googled "hash bang bin bash" and discovered a new line I needed to add to my script... My script now looks like this:

Code:
#!/bin/bash
xmodmap /home/.xmodmaprcvid | mplayer -fs -zoom -quiet -vo xv %s
xmodmap /home/.xmodmaprc


Still doesn't work... (I'm guessing because of something to do with chmod??) Anyone care to enlighten me on what this is and how I need to use it? google was no help to me in this case...


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 31, 2005 7:05 pm 
Offline
Joined: Tue Mar 29, 2005 10:14 pm
Posts: 15
alright you need to do this 'chmod 755 scriptname' Also I don't think your paths are right. it should be /home/user/.xmodmaprcvid

or change the '/home' bit to '$HOME'

Code:
xmodmap $HOME/.xmodmaprcvid | mplayer -fs -zoom -quiet -vo xv %s
xmodmap $HOME/.xmodmaprc


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 31, 2005 7:33 pm 
Offline
Joined: Sat Aug 07, 2004 1:55 am
Posts: 219
Location: West Lafayette, IN
So I don't need the #!/bin/bash at the beginning of the script?

and then to call the script from the "Player Command:" box, do I need:

Code:
 exec /usr/local/bin/mplayerscript

or just
Code:
 /usr/local/bin/mplayerscript


Thanks for all your help!


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 31, 2005 7:57 pm 
Offline
Joined: Tue Mar 29, 2005 10:14 pm
Posts: 15
i don't have a #!/bin/bash, though there is no harm in leaving it there.

as long as you have chmoded the file to 755, the command should be 'mplayerscript'


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 31, 2005 8:51 pm 
Offline
Joined: Sat Aug 07, 2004 1:55 am
Posts: 219
Location: West Lafayette, IN
OK, I made the changes you recommended and chmoded the file to 755. When I try to play a video file, nothing happens.

I ran
Code:
 mplayerscript /myth/video/test.avi

from an xterm window, and received the following results:

Code:
MPlayer 1.0pre5-3.3.4 (C) 2000-2004 MPlayer Team

CPU: Advanced Micro Devices Athlon MP/XP/XP-M Barton 2088 MHz (Family: 6, Stepping: 0)
Detected cache-line size is 64 bytes
CPUflags:  MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 1 SSE: 1 SSE2: 0
Compiled with runtime CPU detection - WARNING - this is not optimal!
To get best performance, recompile MPlayer with --disable-runtime-cpudetection.
Reading config file /usr/local/etc/mplayer/mplayer.conf: No such file or directory
Reading config file /root/.mplayer/config
Reading /root/.mplayer/codecs.conf: Can't open '/root/.mplayer/codecs.conf': No such file or directory
Reading /usr/local/etc/mplayer/codecs.conf: Can't open '/usr/local/etc/mplayer/codecs.conf': No such file or directory
Using built-in default codecs.conf.
font: can't open file: /root/.mplayer/font/font.desc
font: can't open file: /usr/local/share/mplayer/font/font.desc
Using Linux hardware RTC timing (1024Hz).
Can't open input config file /root/.mplayer/input.conf: No such file or directory
Can't open input config file /usr/local/etc/mplayer/input.conf: No such file or directory
Falling back on default (hardcoded) input config
Setting up LIRC support...
mplayer: could not connect to socket
mplayer: Connection refused
Failed to open LIRC support.
You will not be able to use your remote control.

Playing %s.
File not found: '%s'
Failed to open %s



It looks like it's having trouble determining what file it's supposed to be playing... like the %s variable isn't correctly passing the file data from the command line to the script. Am I correct that this is the problem? And how do I fix it?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 31, 2005 9:26 pm 
Offline
Joined: Tue Mar 29, 2005 10:14 pm
Posts: 15
ah yes in your shellscripts use $1 instead of %s.

$1 is for bash, %s is for mythtv


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 31, 2005 10:02 pm 
Offline
Joined: Sat Aug 07, 2004 1:55 am
Posts: 219
Location: West Lafayette, IN
Perfect!! Thanks for all your helpful assistance! For the first time, my remote configuration works AND makes sense!


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 31, 2005 10:12 pm 
Offline
Joined: Thu Mar 25, 2004 11:00 am
Posts: 9551
Location: Arlington, MA
Sigh... We really need some way to tell who needs how much detail... So it's time for shell scripting 101.

OK, lets go through this line by line. First at the start of the script it's always good to be explicit about what it is. Here we tell the system "please treat this as a bash script". If in doubt the system will fall back on /bin/sh (which in this case is bash but it may behave differently when run as sh).
Code:
#!/bin/bash

Next we run mod map to fix up the X keyboard mappings. Note that we're passing it an input file located in the home directory. The shell environment variable "HOME" is predefined to contain that directory path, and "$HOME" expands to the contents. Here probably "/home/mythtv".
Code:
xmodmap $HOME/.xmodmaprcvid

Here we actually run the command of interest. Note how we use the special variable "1" which holds the first comand line parameter that this script is called with, and again "$1" expands to that parameter, here the name of the file you want to play.
Code:
mplayer -fs -zoom -quiet -vo xv $1

Finally we put the keyboard mappings back the way they were.
Code:
xmodmap $HOME/.xmodmaprc

After creating this script we need to do one more thing, mark it as executable. To do that run the command:
Code:
chmod +x myscript.sh
Assuming of course that you called the script "myscript.sh". ;-)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 31, 2005 10:57 pm 
Offline
Joined: Tue Mar 29, 2005 10:14 pm
Posts: 15
Good job tjc. I guess I take what some people know for granted.

Anyways, I located the ati_remote.c file it is under /usr/src/linux/drivers/usb/input/ BUT you have to 'tar xjf kernel-source-2.6.9-chw.tar.bz2' before hand (in /usr/bin/src/) so the symlink works.

My major problem now with the remote is that it is SUPER sensitive. You push the arrow and it will push 'up' or 'down' 3 or 4 times. This makes navigating menus extremely hard (Similarly when you push the escape button, it will escape 2 or 3 times).

The line that needs to be modified is on line 156. Here is an excerpt from the source:
Code:
148 /* Duplicate event filtering time.
    149  * Sequential, identical KIND_FILTERED inputs with less than
    150  * FILTER_TIME jiffies between them are considered as repeat
    151  * events. The hardware generates 5 events for the first keypress
    152  * and we have to take this into account for an accurate repeat
    153  * behaviour.
    154  * (HZ / 20) == 50 ms and works well for me.
    155  */
    156 #define FILTER_TIME (HZ / 20)


Obviously the (HZ / 20) needs to be edited. Presumably changing the value of 20 to something higher will make the remote less sensitive. I'm unable to test this, as my mythtv box is being used as of the moment.

After making a change to the file, the kernel will need to be recompiled. NOTE: I'm not sure if the /usr/src/linux/.config is the same as the one knoppmyth used when compiling the kernel for distribution. I think you should be able to go ahead and compile the kernel as it is in the source and have it runnable. But I read the wiki (http://knoppmythwiki.homelinux.org/inde ... gradeHowTo) and apparently to upgrade kernels to 2.6.8 and there had to be other tools compiled in seperatly.

Anyone know about what has to be done to compile the kernel extracted from /usr/src/kernel-source-2.6.9-chw.tar.bz2?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 31, 2005 11:20 pm 
Offline
Joined: Mon Oct 06, 2003 10:38 am
Posts: 4978
Location: Nashville, TN
you don't even have to compile the kernel all you have to do is compile the modules for what you are doing anyways. probably the easies and most pain free way would be to do a

make modules
then go find the one you want and copy it into place overtop of the old one and reboot. The reason I say this is if you do a
make modules_install then it will overwrite all modules which will break ivtv and you will have to reinstall that.

_________________
Have a question search the forum and have a look at the KnoppMythWiki.

Xsecrets


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 31, 2005 11:35 pm 
Offline
Joined: Tue Mar 29, 2005 10:14 pm
Posts: 15
Where would i have to copy to and from?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 31, 2005 11:49 pm 
Offline
Joined: Mon Oct 06, 2003 10:38 am
Posts: 4978
Location: Nashville, TN
not sure haven't done it find out the module name and search for it. I know the install place will be under /lib/modules/2.6.9-chw/something/more/here/module.ko

_________________
Have a question search the forum and have a look at the KnoppMythWiki.

Xsecrets


Top
 Profile  
 

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 55 posts ] 
Go to page Previous  1, 2, 3, 4  Next



All times are UTC - 6 hours




Who is online

Users browsing this forum: No registered users and 13 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group

Theme Created By ceyhansuyu