Tux

...making Linux just a little more fun!

Talkback:141/brownss.html

[ In reference to "An NSLU2 (Slug) Reminder Server" in LG#141 ]

Silas S. Brown [ssb22 at cam.ac.uk]


Thu, 2 Aug 2007 17:24:28 +0100

Hi, I wonder if you'd like to put this in Talkback or 2-Cent Tips in the next issue:

Since writing the article, I found a couple of minor problems.

One was that the sound sometimes fails in such a way that is not detectable by the NSLU2 (for example the speaker is not connected properly), and to mitigate the possible consequences of this, I set my NSLU2 to start playing a recognisible tune using its internal speaker if an important alarm is not acknowledged. I wrote a script that can convert any MIDI file into commands for Johnathan Nightingale's "beep" utility (which is available in the "beep" package on the NSLU2 Debian distribution), and my "MIDI to beep" script is available at

http://people.pwf.cam.ac.uk/ssb22/mwrhome/midi-beeper.html

The other is that the NSLU2 may sometimes hang if the USB connection to its primary disk is somehow jolted; use of its built-in hardware watchtog helps, but it's best if the watchdog is used in such a way that a disk hang will be noticed by the watchdog (which might not happen if the process that's writing to /dev/watchdog is constantly in RAM), so rather than running a watchdog program I decided to do it in root's crontab:

* * * * * echo >/dev/watchdog;sleep 20;echo >/dev/watchdog;sleep 20;echo >/dev/watchdog
i.e. write to /dev/watchdog 3 times a minute (the system will reboot if it's not written to for a whole minute). Doing it this way rather than in a self-conained process should result in a watchdog failure if the primary disk gets pulled out (resulting in it being unmounted) because bin/sleep will become unavailable. This is so even though it will normally be cached in RAM and incur little or no disk activity. The cron job is quite lightweight, since the code for "bash" can be shared with any other bash scripts that are running at the same time and therefore should not take up much of its own memory.


Top    Back


Kapil Hari Paranjape [kapil at imsc.res.in]


Fri, 3 Aug 2007 06:27:32 +0530

Hello,

On Thu, 02 Aug 2007, Silas S. Brown wrote:

> I wrote a script
> that can convert any MIDI file into commands
> for Johnathan Nightingale's "beep" utility
> (which is available in the "beep" package on
> the NSLU2 Debian distribution), and my "MIDI to
> beep" script is available at
> <A HREF="http://people.pwf.cam.ac.uk/ssb22/mwrhome/midi-beeper.html">http://people.pwf.cam.ac.uk/ssb22/mwrhome/midi-beeper.html</A>.</p>

This is great. Perhaps it can be made into a plugin for timidity!

Regards,

Kapil. --


Top    Back


Ben Okopnik [ben at linuxgazette.net]


Fri, 3 Aug 2007 08:03:49 -0400

On Fri, Aug 03, 2007 at 06:27:32AM +0530, Kapil Hari Paranjape wrote:

> Hello,
> 
> On Thu, 02 Aug 2007, Silas S. Brown wrote:
> > I wrote a script
> > that can convert any MIDI file into commands
> > for Johnathan Nightingale's "beep" utility
> > (which is available in the "beep" package on
> > the NSLU2 Debian distribution), and my "MIDI to
> > beep" script is available at
> > <A HREF="http://people.pwf.cam.ac.uk/ssb22/mwrhome/midi-beeper.html">http://people.pwf.cam.ac.uk/ssb22/mwrhome/midi-beeper.html</A>.</p>
> 
> This is great. Perhaps it can be made into a plugin for timidity!

Heck, it sounds like it would be a replacement for timidity. Back in the early days (early 1980s), long before sound cards became standard equipment (or even existed), I recall playing MIDI files and such through the PC speaker on my DOS machine. I don't remember the name of the program, but it was surprisingly - even amazingly - good. Having this as an option for folks who can't afford a fancy pair of speakers (or just can't spare the room) would be in the best tradition of Linux - providing options all the way down the food chain. A kind of an audio equivalent of 'aalib'.

Imagine Quake on a text-only terminal, with decent sound from the PC speaker... :)

-- 
* Ben Okopnik * Editor-in-Chief, Linux Gazette * http://LinuxGazette.NET *

Top    Back


Ben Okopnik [ben at linuxgazette.net]


Fri, 3 Aug 2007 07:40:57 -0400

On Thu, Aug 02, 2007 at 05:24:28PM +0100, Silas S. Brown wrote:

> Hi, I wonder if you'd like to put this in Talkback or 2-Cent Tips
> in the next issue:

[snip]

No problem at all, Silas; it'll be in the next month's Talkbacks. Those are both smart, well-considered solutions - well done!

[[[ It would have been, but a certain "new product" launched ahead of alleged schedule, right as the LG publication calendar kicked into play! Sorry about that, Silas. -- Kat ]]]

-- 
* Ben Okopnik * Editor-in-Chief, Linux Gazette * http://LinuxGazette.NET *

Top    Back


Kapil Hari Paranjape [kapil at imsc.res.in]


Sat, 11 Aug 2007 09:56:05 +0530

Hello,

Fantastic idea! Just shows that there is no limit to what a hacker can think of given the right OS (Linux of course!) to work on. Great stuff Silas.

Kapil. --


Top    Back