September 05, 2012, 07:03:04 am
News:
  Show Posts
Pages: [1] 2 3 ... 25
1  Neuros OSD / Neuros OSD - Tips, Tricks, and Hacks / Some questions and such that have arisen out of the "Re-inventing..." project on: August 14, 2012, 09:54:22 am
Question(s):
    1) Is it possible to change (or, ideally, eliminate) the 4 hour limit?  I
did not see it in the settings file(s) that the program manipulates.  Note
that Rick has access to the source code (for vrecorder); perhaps he could
check this for me.  I think the best solution would be if it were under user
control - i.e, you could set it to whatever you wanted or eliminate it
completely.  Also note, we *can* re-compile new versions of, e.g.,
vrecorder, and then use the "mount --bind" trick to "replace" the existing
(read-only) one on the flash media.  All this without having to do an "all
new" version of "the firmware".

    2) (Out of curiosity) Are there any other cmd line parameters to
vrecorder, other than the tag lookup into .vrecsettings?  I hope this can be
easily parsed out by looking at the source code, but of course, it'd be
really nice if there was actual proper documentation.

    3) A bug in the OSD built-in scheduler.  Background: When I "turn off"
an entry in the scheduler (generally, because I've moved it to my new
scheduler), what I do is to set the year to some year in the distant future
(like 2025).  This is to avoid deleting it, because setting these things up
from scratch is a pain and it seems like setting the year off in the future
is a good way to "put it on hold".  However, I've found over the last year
or two that the recordings mysteriously start running again.  I've now
figured out that it happens like exactly 1 year after you turn it off - and
then runs daily from there until you catch it and fix it.  It is as if the
scheduler only has a 1 year "look ahead" window - it simply can't fathom
anything farther away than that.

Anyway, it would be nice if it were possible to completely turn the
scheduler off.  Maybe all that's needed is to kill some process.  Could
someone knowledgable advise me on this?  Thanks.

    4) I noticed that the settings file contains this line:

   Video-Recorder-Advanced=0

    Anyone have any idea what this is about?  What would happen if I changed
    it?  And, related, are there any other settings I can put in this file,
    that are not currently present in the sysconfig.ini file?

Clarification on #1 above (post as first response):

The main reason why I don't like the 4 hour limit is that it is unnecessary
on modern filesystems.  It is a FAT filesystem based limitation that is
out-of-date now.  I do all my recording to cifs-mounted NTFS filesystems.

Further, the "turn around" takes time.  If you record, say, a 5 hour
program, you will lose about a minute of the show while the system goes
through the work of shutting down the first recording, finalizing the file,
starting up the next recording, and getting the next recording going.

Also, generally, because it is just one more thing that can go wrong;
specifically, because the process described in the previous paragraph (the
"turn around") is fragile and can cause the OSD to crash.  After seeing this
happen a few times, I have determined that it is some sort of memory issue -
that it is more likely to happen if there are extraneous processes (read:
extra shell sessions and non-core-OSD processes) running at the time.  When
I stopped running these extra processes, it pretty much (but not completely)
stopped crashing during the "turn around".

2  Neuros OSD / Neuros OSD - Tips, Tricks, and Hacks / Reinventing the OSD scheduler for fun (if not profit) on: August 14, 2012, 09:53:03 am

First, look at this:

Program ("do_record"):

#!/bin/sh
tty
[ $# = 2 ] || exec echo "Arg count!  Must be 2!"
set -e
cd /mnt/tmpfs
/full/path/to/gawk '
    ARGIND > 1 { exit }
    /device0/,/^$/ {
    sub(/device0/,"TEMP")
    if (/RecPath/) sub(/=.*/,"=" ARGV[3])
    if (/Timelimit/) sub(/=.*/,"=" ARGV[4])
    print
    }' mount_NAND/data/sysconfig.ini /etc/group "$@" > .vrecsettings
egrep 'RecP|Time' .vrecsettings
export LD_LIBRARY_PATH=/media/ext/.osd-extended/programs/lib
exec /usr/local/bin/vrecorder temp

Now read this:
    For reasons that will be explained shortly, I have decided to re-invent
the OSD's scheduler mechanism.  There are two main parts to this effort:
    1) Figuring out how to run "vrecorder" manually (I.e., from the command
line, without the GUI).
    2) Developing a better way to change the channels on the cable box.  In
fact, this was the primary motivation for this project, since the
Neuros-supplied "IR Blaster" stopped working for me about a year ago (due, I
think, to a combination of limitations in the Neuros/OSD implementation,
triggered by changes made by the cable company).

For 1), I wrote the above-listed shell script.  The main trick was figuring
out how vrecorder works - namely, that you modify the .vrecsettings file,
then run vrecorder with a parameter of "temp".  I assume that the original
design was that you could have multiple keys in the file and use whichever
one you wanted, but it looks like that functionality was never used (And I
have yet to test it).  Incidentally, I figured out the file name
(.vrecsettings) by running "strings" on the vrecorder binary.

This script is designed to be run via ssh - hence the need to full-path some
things, and set LD_LIBRARY_PATH.  The "tty" command displays "not a tty";
this was put in as a check to see what sort of environment you get when you
run via a non-interactive ssh.  I use "plink" (part of the "putty" package)
on the Windows side to run the script.  Note also that this may not be the
most elegant AWK script ever written, but it gets the job done.  It could
probably be made non-GAWK-specific without too much work.

Finally, there is a whole other side to this - on the Windows side -
including doing the scheduling using "WinCron" - the scripting for this is
not shown here.  However, here is the Windows "plink" command line which
runs the shell script on the OSD:

    plink root@%host% exec /path/to/do_record %ofile% %seconds%

For 2), I found a neat little device at http://usbuirt.com that replaces the
OSD's IR Blaster.  The USBUIRT device costs about $50, and is much more
powerful (in every sense of the word) than the puny OSD IR Blaster.  It is
Windows based - plugs into the Windows PC's USB port - and works very well.

You use a tool called "lrnhelper.exe" to learn the codes from your remote.
This process, once you figure it out, is much more comfortable than the OSD's
learning process.  Then, you use the "uutx.exe" tool, from your scheduled
script, to send the codes to the cable box to change the channel.

One caveat about the USBUIRT device: It is poorly documented - in fact, the
shipped device contains no documentation at all.  Everything (and there
isn't much) is on the web site.  Further, even though I had a pretty good
idea of what I wanted to do and what it (the device) was, I would never have
figured it out without having exchanged about a half-dozen pretty detailed
and involved emails with the device's maker.  But, note well, he was very
helpful and very timely in responding to my emails - generally responding
within a few hours time.

But, having said that, I also want to add that the USBUIRT device is a
*very* powerful device and does a lot more stuff than what I am currently
using it for (channel changing).  Someday, I'll actually take the time to
figure out all the other uses to which it could be put.

Anyway, the whole system works quite well and I can once again record
anything on any channel, using a Windows-based scheduling system.  It was
quite a bit of fun putting it all together.  And, I can't begin to tell you
how much quicker and easier it is to manage my scheduled recordings using a
normal file editor, on the Windows platform, as compared to using the (slow)
clicky GUI on the OSD.

Note also that if you don't use the OSD's scheduler anymore (as is the case
for me), then you don't really care if the OSD's clock is kept accurate.  I
mention this because a lot of effort has been expended over the years
working on schemes to fix the clock, and a lot has been written in these
forums about those efforts.  So, this is now one less thing to worry about.

P.S.  For completeness, here's a little bit about the other side of the OSD
- how to play files via command line, as opposed to by clicking the GUI.  I
use the following bit of code in a (DOS/Windows) batch file:

plink root@%host% ^
export LD_LIBRARY_PATH=/media/ext/.osd-extended/programs/lib;^
/full/path/to/OSDstop;sleep 5;^
exec /usr/local/bin/vplayer --path ^
    '/media/network/path/to/Video to Play.mp4'

Note that this is 5 lines in the batch file; note the use of the ^ line
continuation character.  And here is the "OSDstop" script, which is needed
(as is the 'sleep 5'), in order to ensure that the OSD "screen" is visible
on the TV when the video plays:

#!/bin/sh
echo -ne "\x40" > /dev/neuros_ir
echo -ne "\x22" > /dev/neuros_ir
echo -ne "\x00" > /dev/neuros_ir

3  Neuros OSD / Neuros OSD - Tips, Tricks, and Hacks / Re: OSDng gone missing? on: July 26, 2012, 11:39:58 am
Update: The web server is working now.
4  Neuros OSD / Neuros OSD - Tips, Tricks, and Hacks / Re: OSDng gone missing? on: July 26, 2012, 10:34:04 am
There does seem to be a problem with the webserver at xmission.
And seems to have been for at least 4 days now.  I'll see if I can get them to fix it.


Regarding the other issue you raise (the fact that the full OSDnd install requires the oddjob server to be active in order to complete): I'm sure you are right - but, FWIW, I don't use OSDng "full" (*); I've been perfectly happy to just do the basic install - which doesn't require the oddjob server.

(*) For various reasons which I've detailed in the past, but will not repeat here.
5  Neuros OSD / Neuros OSD - Tips, Tricks, and Hacks / Re: OSDng gone missing? on: July 14, 2012, 10:49:19 am
http://osd.oddren.com/ is on hiatus, and I lost my old upk of the system.  Does someone have a copy they can repost for us to use?

Look in: http://user.xmission.com/~gazelle/OSD_Firmware/
6  Neuros OSD / Neuros OSD - Tips, Tricks, and Hacks / Re: Setting the OSD's time on: May 19, 2012, 10:39:47 am
Finally, let me note (actually, confirm) that setting the time via the GUI does set both clocks (even if all you do is go to the screen [Tools -> Settings -> Date & Time] and hit enter twice).

I know the UI method sets both clocks. What I was looking for is a command-line way to do it programmatically so something else could keep the clock in step.

As for Busybox hacking, why not make setting both clocks the default option? I can't think why you'd want to set one and not t'other.

1) Yes, I know you know.  I was just mentioning it for completeness (since I had suggested that it did work that way earlier, but without testing it - until now).

2) I guess just because that's the Unix way - to provide an option for everything and to not assume anything about the user's intentions.  FWIW, the only thing I can suggest is that you might want to separate them for testing purposes - to be able to do one or the other and observe that the other doesn't change.  Also, I remember way back when in DOS days - I had written a program to do the same thing we're discussing here, in 8086 assembler, incidentally, and then was annoyed when, starting in DOS 3.3, it worked as you suggest - i.e, when you set it from the command line, it also set the RTC automatically.  My wonderful program was orphaned.
7  Neuros OSD / Neuros OSD - Tips, Tricks, and Hacks / Re: Setting the OSD's time on: May 19, 2012, 07:16:28 am
Finally, let me note (actually, confirm) that setting the time via the GUI does set both clocks (even if all you do is go to the screen [Tools -> Settings -> Date & Time] and hit enter twice).

So, in a way, this is all moot  - unless you really do need to this on an ongoing basis.

And, now that I think about it - I think the best solution would be to hack the "date" command (in "busybox") to have an option to also get or set the RTC (i.e., it would set it if  the "-s" option is present, which sets the system date), in addition to getting/setting the regular system time.
8  Neuros OSD / Neuros OSD - Tips, Tricks, and Hacks / Re: Setting the OSD's time on: May 17, 2012, 10:01:26 am
That certainly looks like it would work - I can see no reason why it wouldn't.

However, I've been looking at the implementation of "hwclock" in busybox - and it looks like it should be pretty straightforward to update it to work with the OSD's RTC.  It turns out that the "regular" Linux RTC uses "struct tm"s, just like the usual Unix/Linux time functions do, so, as in your code, most of the work will be copying back & forth between a "struct tm" and the special OSD structs.

Anyway, I just need to find a suitable moment to do the work.
9  Neuros OSD / Neuros OSD - I need help! / Re: I need a set of OSD cables! on: May 01, 2012, 07:29:52 pm
I seem to remember that they are some kind of a standard, and the wiring schematic should be on the wiki somewhere...?

I don't think they're iPod A/V, but something similar...?

Correct.  We went through this about a year ago - I had bought some iPod cables at a flea market in the hopes they would work with the OSD, but when I posted about it here, I was told that they were almost, but not quite, the same thing.  A shame, that.

Anyway, I'd hate to have to solder my own.  Was hoping maybe someone had something laying around...
10  Neuros OSD / Neuros OSD - I need help! / I need a set of OSD cables! on: May 01, 2012, 06:39:06 pm
Well, as you know, ima999 graciously offered to send me his OSD, and has done so, but, alas, he could not spare the cables (and did not send them).  I'm not sure how this happened, and it, obviously, ultimately doesn't  matter (something about beggars and choosers...).  But my question is, is there any (cheap) way for me to get another set of cables?  I know that at one point, Neuros sold them in their online store, but I don't think they are selling anything (to the general public) these days.

P.S.  By "cables", I mean the two RCA -> 4 ring mini plug cables that you need to connect to the input and output jacks on the OSD.
11  Neuros OSD / Neuros OSD - Tips, Tricks, and Hacks / Re: Setting the OSD's time on: May 01, 2012, 06:33:12 pm
OK - great.  I am able to compile and run your program.

My goal is to re-implement hwclock for the OSD.  I'll let you know when I have gotten around to doing so.
12  Neuros OSD / Neuros OSD - Tips, Tricks, and Hacks / Re: Setting the OSD's time on: April 30, 2012, 06:02:32 pm
Can you give me a URL for the linux/neuros_rtc.h file?

I cannot compile it without that file.
13  Neuros OSD / Neuros OSD - Tips, Tricks, and Hacks / Re: Setting the OSD's time on: April 29, 2012, 05:59:20 pm
Interesting.  A couple of questions:

1) Can you give us the compile command?  I.e., are there any defines or libs that need to be linked in?

2) A quick look at the source reveals that you include sys/ioctl.h twice, and then both times you call ioctl(), you call it twice (for no reason that I can see).  A case of double vision?

Also, it would probably be better to have an option to take the current system time and poke that into the RTC, rather than needing it to be passed on the command line.  That's the most common situation and is what the real "hwclock" program does.
14  Neuros OSD / Neuros OSD - Tips, Tricks, and Hacks / Re: Solved!! Writable /etc/inittab on: April 29, 2012, 10:10:41 am
Re: tn's "setrtc" program.

Did you try the attached executable?  If yes, then I'm guessing you found it to not-work, because it was compiled for Torfu (right?).

Anyway, I can't compile it because I never bothered to setup the full Neuros dev environment.  I just setup gcc and enough libs and such to compile ordinary C programs.

And, ultimately, the RTC doesn't matter enough to me to worry about it.  As long as I can set it reliably on boot, I'm happy.  Still, once you get your dev environment back, you should take tn's idea and make a proper "hwclock" program out of it - and post the results for us all.

P.S.  It occurs to me that setting the time via the GUI should update the RTC (if I am reading between the lines correctly), so, if you wanted to do that as a one-shot, you could easily do that.  Further, since I now possess the technology to "script the GUI" (using WinBatch), I could easily write a script to update the RTC programmatically.

P.P.S.  Regarding your "I'm living in multiple timezones" issue.  You could fix this in the Expect - adding or subtracting 3600 to the value passed to the [timestamp] command.  I leave it to you to work out the details.
15  Neuros OSD / Neuros OSD - Tips, Tricks, and Hacks / Re: Solved!! Writable /etc/inittab on: April 29, 2012, 07:54:12 am
I may (in time) write a little VB applet to telnet into the OSD and fiddle the time,
I don't know why you'd want to fiddle around with VB when Expect is so much better for this sort of task, and is cross-platform (VB is, obviously, MS only).

It's probably also not a help that my OSD is in a different timezone. I'll snarf the expect stuff and play around with it.
Actually, the nice thing about the "telnet in" method is that timezones don't matter.  Since most of hte processing is done on the host side, you're just setting the OSD to whatever your local system says is the current time.  This is what makes the other side of it (setting it from the OSD side) more difficult - there, you do care about and have to worry about timezones (and DST).

Does that, by the way, update the hardware clock, or just the soft copy?

Now, there is an interesting question!  I'm guessing it is the soft copy only, which is a shame, but the funny thing is, I can't figure out a way to test it.  As it happens, the built-in version of busybox on the OSD does not have a "hwclock" command, so you can't use that to test.  However, I have compiled a newer, better (more commands) version of busybox (version 1.9.0) that does have "hwclock".  Unfortunately, I could not get it to work:

$ bin/busybox hwclock
hwclock: can't open '/dev/misc/rtc': No such file or directory

$ bin/busybox hwclock -r -f /dev/neuros_rtc
hwclock: RTC_RD_TIME: Invalid argument

To Chad, et al: I doubt there is much hope of getting this to work, is there?  Is there some other OSD-specific tool for accessing/changing the RTC?

I left the OSD unplugged for five minutes after setting the time since changing the battery and I've come across an interesting quirk. I was about to panic due to the OSD losing 10 seconds in five minutes, however the onboard clock is actually still on time. It's the UI clock down the bottom right that doesn't seem to update until ten seconds have elapsed. I wonder if this is specific to the UI or if the recording is also laggy? [firmware: OSDng]

The UI has always lagged in terms of updating the time.  I wouldn't read too much into this.
Pages: [1] 2 3 ... 25