dev builds
themes manual
device status forums
mailing lists
IRC bugs
dev guide

Rockbox mail archive

Subject: Rockbox scripting language (was: Cron job on Rockbox & FLAC recording)

Rockbox scripting language (was: Cron job on Rockbox & FLAC recording)

From: RaeNye <>
Date: Thu, 22 Jun 2006 00:32:35 +0200

Your message triggered me to suggest adding scripting capabilities to RB.

Several scriptable elements currently exist (WPS, .cfg files -- including
themes) but a more powerful language will enable RB to do much more,
- scheduled tasks (much more than "sleep after 10 idle minutes")
- configurable menus and button assignment. This needs some basic redesign,
but once we move to generic events (i.e., MENU_BACK instead of #ifdef ....
BUTTON_XXX) it's rather simple
- much richer WPS options (no more "you need these 7 specialized patches to
run this WPS")

I suggest lua (, OS and free for all uses, last version: 5.02)
which combines powerful structure (OOP, functional programming, etc.) with a
low memory footprint (on x86: 100K/lua core, 100K/std. library - less than
most codecs).

From lua's manual:
Lua is an extension programming language designed to support general
procedural programming with data description facilities. It also offers good
support for object-oriented programming, functional programming, and
data-driven programming. Lua is intended to be used as a powerful,
light-weight configuration language for any program that needs one. Lua is
implemented as a library, written in clean C (that is, in the common subset
of ANSI C and C++).

Being an extension language, Lua has no notion of a "main" program: it only
works embedded in a host client, called the embedding program or simply the
host. This host program can invoke functions to execute a piece of Lua code,
can write and read Lua variables, and can register C functions to be called
by Lua code. Through the use of C functions, Lua can be augmented to cope
with a wide range of different domains, thus creating customized programming
languages sharing a syntactical framework.

The Lua distribution includes a stand-alone embedding program, lua, that
uses the Lua library to offer a complete Lua interpreter.

Lua is free software, and is provided as usual with no guarantees, as stated
in its copyright notice.

To compile this we mostly need some dynamic memory allocation scheme
(realloc() -compatible) and exporting more of the RB core functions (a-la
plugin API) and we're set.

Any ideas before I start coding a proof-of-concept?
(I *will* ignore comments mentioning the feature freeze or version 3.0)


For those who can't handle rockalua, try white russian ;-)

-----Original Message-----
[] On Behalf Of Alex Mandel
Sent: Wednesday, June 21, 2006 7:11 PM
Subject: Cron job on Rockbox & FLAC recording

Sorry, I'm new to Rockbox and not even sure what the base code originates
from, but I was curious about the feasibility of 2 things.

1. Cron - Time based events, assuming you leave the device on all the time
hooked up to a power source can you set it to record at specified intervals
for a certain amount of time. Something like a cron triggered script.

2. FLAC Recording - I'm assuming this is a constraint of the chipsets but
is it possible that any of the devices will have the ability to record to

I'm just looking for a conceptual idea of how either of these things might
be possible.

Received on 2006-06-21

Page template was last modified "Tue Sep 7 00:00:02 2021" The Rockbox Crew -- Privacy Policy