1
0
Fork 0
forked from len0rd/rockbox

ancient experimental test code not used for 2+ years, removed

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4212 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Daniel Stenberg 2004-01-08 15:46:17 +00:00
parent 5c7d66890c
commit 8463a2bbd3
6 changed files with 0 additions and 323 deletions

View file

@ -1,56 +0,0 @@
# __________ __ ___.
# Open \______ \ ____ ____ | | _\_ |__ _______ ___
# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
# \/ \/ \/ \/ \/
# $Id$
#
FIRMWARE = ../..
COMMON = $(FIRMWARE)/common
DRIVERS = $(FIRMWARE)/drivers
CC = gcc
LD = ld
AR = ar
AS = as
OC = objcopy
scramble = scramble-win32
DEFINES = -DCRT_DISPLAY -DDEBUG -DSIMULATOR
INCLUDES=-I. -I$(FIRMWARE) -I$(COMMON) -I$(DRIVERS)
TARGET_OPTIONS =
CFLAGS = -g -Wall ${TARGET_OPTIONS} -Wstrict-prototypes $(INCLUDES) $(DEFINES)
SRC := playlist.c settings.c panic.c disk.c debug.c harness.c
OBJS := $(SRC:%.c=%.o)
%.o: %.s
$(CC) -o $@ $(CFLAGS) $(INCLUDES) $(DEFS) -c $<
all : rockbox
rockbox: $(OBJS)
$(CC) -o $@ ${OBJS}
playlist.o:$(FIRMWARE)/playlist.c
$(CC) $(CFLAGS) -c $< -o $@
settings.o:$(FIRMWARE)/settings.c
$(CC) $(CFLAGS) -c $< -o $@
panic.o:$(FIRMWARE)/panic.c
$(CC) $(CFLAGS) -c $< -o $@
disk.o:$(FIRMWARE)/disk.c
$(CC) $(CFLAGS) -c $< -o $@
debug.o:$(FIRMWARE)/debug.c
$(CC) $(CFLAGS) -c $< -o $@
dist:
tar czvf dist.tar.gz Makefile main.c start.s app.lds
clean:
-rm -f *.x *.i *.o *.elf *.bin *.map *.mod *.bak *~

View file

@ -1,43 +0,0 @@
# __________ __ ___.
# Open \______ \ ____ ____ | | _\_ |__ _______ ___
# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
# \/ \/ \/ \/ \/
# $Id$
#
# Pick a target to build for
TARGET = -DARCHOS_PLAYER=1
#TARGET = -DARCHOS_PLAYER_OLD=1
#TARGET = -DARCHOS_RECORDER=1
CC = gcc
LD = ld
AR = ar
AS = as
OC = objcopy
scramble = scramble-win32
DEFINES = -DCRT_DISPLAY
INCLUDES=-I. -Icommon -Idrivers
TARGET_OPTIONS =
CFLAGS = -Os -Wall ${TARGET_OPTIONS} -nostdlib -Wstrict-prototypes -fomit-frame-pointer -fschedule-insns $(INCLUDES) $(DEFINES) $(TARGET)
AFLAGS += -small -relax
SRC := playlist.c settings.c panic.c disk.c debug.c harness.c
OBJS := $(SRC:%.c=%.o)
%.o: %.s
$(CC) -o $@ $(CFLAGS) $(INCLUDES) $(DEFS) -c $<
all : rockbox-win32.exe
rockbox-win32.exe: $(OBJS)
$(CC) -o rockbox-win32.exe ${OBJS}
dist:
tar czvf dist.tar.gz Makefile main.c start.s app.lds
clean:
-rm -f *.x *.i *.o *.elf *.bin *.map *.mod *.bak *~

View file

@ -1,84 +0,0 @@
Playlists on the Rockbox
1. Demand-loading of Playlist Filenames from Disk
A playlist is simply a list of track names. These lists can either be
created dynamically by the user, or they can be predefined and placed
into a text file with an .m3u extension.
The 2048 KB of RAM is the reason we need to get this right. If an average
track name (i.e. \music\cure\disintegration\01-pictures_of_you.mp3)
is assumed to be 50 characters long, then:
A playlist of 15 tracks is 15 * 50 ~= 750 bytes
A playlist of 100 tracks is 100 * 50 ~= 5 kilobytes
A playlist of 3500 tracks is 3500 * 50 ~= 175 kilobytes
A playlist of 10000 tracks is 10000 * 50 ~= 1/4 megabyte
From these figures, it can be seen that for large playlists, storing
the entire list of track names in memory significantly reduces the
capacity available to the audio data buffer, which in turn has a negative
impact on the performance of the system.
One method of reducing the total memory consumption of a playlist is
to delay bringing the actual filenames into memory until needed. Instead,
the playlist text file can be scanned, and an in-memory array constructed
with one element for each track present in the text file. Progressing
through the playlist entails getting the appropriate entry from the array,
and using that to perform a lookup of the corresponding filename entry
from the playlist text file.
With this method, and given that an integer on the Rockbox's CPU is 4 bytes:
A playlist of 15 tracks is 15 * 4 ~= 60 bytes
A playlist of 100 tracks is 100 * 4 ~= 400 bytes
A playlist of 3500 tracks is 3500 * 4 ~= 13 kilobytes
A playlist of 10000 tracks is 10000 * 4 ~= 39 kilobytes
It is clear that these are substantial savings, albeit at the cost of
increased complexity and disk i/o. Prefetch strategies could improve
performance compared to demand-loading a single entry.
2. Implementation Options
Keeping the track names in a file on disk is easy enough for a predefined
m3u playlist, but for dynamically created playlists, where the user
browses the filesystem and adds tracks or entire directory hierarchies
at will, we will need to store the playlist track names in a dedicated
file. This will be called the Anonymous Playlist, the location of which
can be set by the user, but will default to \anonymous.m3u or somesuch.
The current contents of the Anonymous Playlist can be named and saved at
any time.
The data structure to support playlists would therefore be:
typedef struct
{
char filename[256] ; /* path name of m3u playlist on disk */
int *indices; /* array of indices into the playlist */
int index; /* index of current track within playlist */
} playlist_info_t;
So far, so good: we read from an existing m3u file, or we create an
anonymous one. But what do we do if we start with an existing m3u file,
and then the user wants to dynamically add tracks to it? A few options
exist:
a) we disallow playlist modification of existing m3u files, offering
instead to replace the current playlist with the new one.
b) we give the user the option of appending the new tracks to the
existing m3u file.
c) we copy the contents of the existing m3u playlist to the anonymous one,
and then append the new tracks to that. If the m3u playlist is large,
this could be wasteful and potentially time-consuming. However, choosing
this option would provide the facility to insert or append entire
existing m3u playlists 'into' one another, a feature missng from the
commercial firmware.

View file

@ -1,112 +0,0 @@
/***************************************************************************
* __________ __ ___.
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
* \/ \/ \/ \/ \/
* $Id$
*
* Copyright (C) 2002 by wavey@wavey.org
*
* All files in this archive are subject to the GNU General Public License.
* See the file COPYING in the source tree root for full license agreement.
*
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
****************************************************************************/
#include <stdio.h>
#include <common/track.h>
#include "settings.h"
#include "playlist.h"
#include "panic.h"
#include "disk.h"
#include "debug.h"
#include "config.h"
#include "harness.h"
/* global string for panic display */
char panic_message[128];
/*
* entrypoint
*/
int main( int argc, char **args )
{
/* allocate runtime data structures */
user_settings_t settings;
playlist_info_t playlist;
debugf( "\nrockbox test harness started.\n" );
/* populate runtime data structures */
initialise( &settings, &playlist );
/* begin tests */
start( &settings, &playlist );
return 1;
}
/*
* populate runtime data structures
*/
void initialise( user_settings_t *settings, playlist_info_t *playlist )
{
debugf( "init()\n" );
reload_all_settings( settings );
reload_playlist_info( playlist );
}
/*
* start tests
*/
void start( user_settings_t *settings, playlist_info_t *playlist )
{
track_t track;
debugf( "start()\n" );
/* show current values */
display_current_settings( settings );
display_current_playlist( playlist );
/* wipe playlist contents */
empty_playlist( playlist );
display_current_playlist( playlist );
/* user selects a new playlist */
load_playlist( playlist, "test2.m3u" );
display_current_playlist( playlist );
/* randomise playlist */
randomise_playlist( playlist, 45678 );
display_current_playlist( playlist );
/* get next track in playlist */
track = next_playlist_track( playlist );
display_playlist_track( &track );
/* get next track in playlist */
track = next_playlist_track( playlist );
display_playlist_track( &track );
}
#ifdef SIMULATOR
void app_main ()
{
main (0, NULL);
}
#endif

View file

@ -1,24 +0,0 @@
/***************************************************************************
* __________ __ ___.
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
* \/ \/ \/ \/ \/
* $Id$
*
* Copyright (C) 2002 by wavey@wavey.org
*
* All files in this archive are subject to the GNU General Public License.
* See the file COPYING in the source tree root for full license agreement.
*
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
****************************************************************************/
#include "settings.h"
#include "playlist.h"
void initialise( user_settings_t *settings, playlist_info_t *playlist );
void start( user_settings_t *settings, playlist_info_t *playlist );

View file

@ -1,4 +0,0 @@
testing
testing ssh keys
2
3