summaryrefslogtreecommitdiff
path: root/firmware/test/wavey
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/test/wavey')
-rw-r--r--firmware/test/wavey/Makefile56
-rw-r--r--firmware/test/wavey/Makefile.win3243
-rw-r--r--firmware/test/wavey/README.playlists84
-rw-r--r--firmware/test/wavey/harness.c112
-rw-r--r--firmware/test/wavey/harness.h24
-rw-r--r--firmware/test/wavey/wavey.txt4
6 files changed, 0 insertions, 323 deletions
diff --git a/firmware/test/wavey/Makefile b/firmware/test/wavey/Makefile
deleted file mode 100644
index 17a5992c49..0000000000
--- a/firmware/test/wavey/Makefile
+++ /dev/null
@@ -1,56 +0,0 @@
1# __________ __ ___.
2# Open \______ \ ____ ____ | | _\_ |__ _______ ___
3# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
6# \/ \/ \/ \/ \/
7# $Id$
8#
9
10FIRMWARE = ../..
11COMMON = $(FIRMWARE)/common
12DRIVERS = $(FIRMWARE)/drivers
13
14CC = gcc
15LD = ld
16AR = ar
17AS = as
18OC = objcopy
19scramble = scramble-win32
20DEFINES = -DCRT_DISPLAY -DDEBUG -DSIMULATOR
21INCLUDES=-I. -I$(FIRMWARE) -I$(COMMON) -I$(DRIVERS)
22TARGET_OPTIONS =
23CFLAGS = -g -Wall ${TARGET_OPTIONS} -Wstrict-prototypes $(INCLUDES) $(DEFINES)
24
25SRC := playlist.c settings.c panic.c disk.c debug.c harness.c
26OBJS := $(SRC:%.c=%.o)
27
28%.o: %.s
29 $(CC) -o $@ $(CFLAGS) $(INCLUDES) $(DEFS) -c $<
30
31all : rockbox
32
33rockbox: $(OBJS)
34 $(CC) -o $@ ${OBJS}
35
36playlist.o:$(FIRMWARE)/playlist.c
37 $(CC) $(CFLAGS) -c $< -o $@
38
39settings.o:$(FIRMWARE)/settings.c
40 $(CC) $(CFLAGS) -c $< -o $@
41
42panic.o:$(FIRMWARE)/panic.c
43 $(CC) $(CFLAGS) -c $< -o $@
44
45disk.o:$(FIRMWARE)/disk.c
46 $(CC) $(CFLAGS) -c $< -o $@
47
48debug.o:$(FIRMWARE)/debug.c
49 $(CC) $(CFLAGS) -c $< -o $@
50
51dist:
52 tar czvf dist.tar.gz Makefile main.c start.s app.lds
53
54clean:
55 -rm -f *.x *.i *.o *.elf *.bin *.map *.mod *.bak *~
56
diff --git a/firmware/test/wavey/Makefile.win32 b/firmware/test/wavey/Makefile.win32
deleted file mode 100644
index 8edd91aa8e..0000000000
--- a/firmware/test/wavey/Makefile.win32
+++ /dev/null
@@ -1,43 +0,0 @@
1# __________ __ ___.
2# Open \______ \ ____ ____ | | _\_ |__ _______ ___
3# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
6# \/ \/ \/ \/ \/
7# $Id$
8#
9
10# Pick a target to build for
11TARGET = -DARCHOS_PLAYER=1
12#TARGET = -DARCHOS_PLAYER_OLD=1
13#TARGET = -DARCHOS_RECORDER=1
14
15CC = gcc
16LD = ld
17AR = ar
18AS = as
19OC = objcopy
20scramble = scramble-win32
21DEFINES = -DCRT_DISPLAY
22INCLUDES=-I. -Icommon -Idrivers
23TARGET_OPTIONS =
24CFLAGS = -Os -Wall ${TARGET_OPTIONS} -nostdlib -Wstrict-prototypes -fomit-frame-pointer -fschedule-insns $(INCLUDES) $(DEFINES) $(TARGET)
25AFLAGS += -small -relax
26
27SRC := playlist.c settings.c panic.c disk.c debug.c harness.c
28OBJS := $(SRC:%.c=%.o)
29
30%.o: %.s
31 $(CC) -o $@ $(CFLAGS) $(INCLUDES) $(DEFS) -c $<
32
33all : rockbox-win32.exe
34
35rockbox-win32.exe: $(OBJS)
36 $(CC) -o rockbox-win32.exe ${OBJS}
37
38dist:
39 tar czvf dist.tar.gz Makefile main.c start.s app.lds
40
41clean:
42 -rm -f *.x *.i *.o *.elf *.bin *.map *.mod *.bak *~
43
diff --git a/firmware/test/wavey/README.playlists b/firmware/test/wavey/README.playlists
deleted file mode 100644
index fa28fd47a0..0000000000
--- a/firmware/test/wavey/README.playlists
+++ /dev/null
@@ -1,84 +0,0 @@
1
2 Playlists on the Rockbox
3
41. Demand-loading of Playlist Filenames from Disk
5
6A playlist is simply a list of track names. These lists can either be
7created dynamically by the user, or they can be predefined and placed
8into a text file with an .m3u extension.
9
10The 2048 KB of RAM is the reason we need to get this right. If an average
11track name (i.e. \music\cure\disintegration\01-pictures_of_you.mp3)
12is assumed to be 50 characters long, then:
13
14A playlist of 15 tracks is 15 * 50 ~= 750 bytes
15A playlist of 100 tracks is 100 * 50 ~= 5 kilobytes
16A playlist of 3500 tracks is 3500 * 50 ~= 175 kilobytes
17A playlist of 10000 tracks is 10000 * 50 ~= 1/4 megabyte
18
19From these figures, it can be seen that for large playlists, storing
20the entire list of track names in memory significantly reduces the
21capacity available to the audio data buffer, which in turn has a negative
22impact on the performance of the system.
23
24One method of reducing the total memory consumption of a playlist is
25to delay bringing the actual filenames into memory until needed. Instead,
26the playlist text file can be scanned, and an in-memory array constructed
27with one element for each track present in the text file. Progressing
28through the playlist entails getting the appropriate entry from the array,
29and using that to perform a lookup of the corresponding filename entry
30from the playlist text file.
31
32With this method, and given that an integer on the Rockbox's CPU is 4 bytes:
33
34A playlist of 15 tracks is 15 * 4 ~= 60 bytes
35A playlist of 100 tracks is 100 * 4 ~= 400 bytes
36A playlist of 3500 tracks is 3500 * 4 ~= 13 kilobytes
37A playlist of 10000 tracks is 10000 * 4 ~= 39 kilobytes
38
39It is clear that these are substantial savings, albeit at the cost of
40increased complexity and disk i/o. Prefetch strategies could improve
41performance compared to demand-loading a single entry.
42
432. Implementation Options
44
45Keeping the track names in a file on disk is easy enough for a predefined
46m3u playlist, but for dynamically created playlists, where the user
47browses the filesystem and adds tracks or entire directory hierarchies
48at will, we will need to store the playlist track names in a dedicated
49file. This will be called the Anonymous Playlist, the location of which
50can be set by the user, but will default to \anonymous.m3u or somesuch.
51The current contents of the Anonymous Playlist can be named and saved at
52any time.
53
54The data structure to support playlists would therefore be:
55
56typedef struct
57{
58 char filename[256] ; /* path name of m3u playlist on disk */
59 int *indices; /* array of indices into the playlist */
60 int index; /* index of current track within playlist */
61} playlist_info_t;
62
63So far, so good: we read from an existing m3u file, or we create an
64anonymous one. But what do we do if we start with an existing m3u file,
65and then the user wants to dynamically add tracks to it? A few options
66exist:
67
68a) we disallow playlist modification of existing m3u files, offering
69 instead to replace the current playlist with the new one.
70
71b) we give the user the option of appending the new tracks to the
72 existing m3u file.
73
74c) we copy the contents of the existing m3u playlist to the anonymous one,
75 and then append the new tracks to that. If the m3u playlist is large,
76 this could be wasteful and potentially time-consuming. However, choosing
77 this option would provide the facility to insert or append entire
78 existing m3u playlists 'into' one another, a feature missng from the
79 commercial firmware.
80
81
82
83
84
diff --git a/firmware/test/wavey/harness.c b/firmware/test/wavey/harness.c
deleted file mode 100644
index 92b0103be2..0000000000
--- a/firmware/test/wavey/harness.c
+++ /dev/null
@@ -1,112 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2002 by wavey@wavey.org
11 *
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
14 *
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
17 *
18 ****************************************************************************/
19
20#include <stdio.h>
21#include <common/track.h>
22#include "settings.h"
23#include "playlist.h"
24#include "panic.h"
25#include "disk.h"
26#include "debug.h"
27#include "config.h"
28#include "harness.h"
29
30/* global string for panic display */
31
32char panic_message[128];
33
34/*
35 * entrypoint
36 */
37int main( int argc, char **args )
38{
39 /* allocate runtime data structures */
40
41 user_settings_t settings;
42 playlist_info_t playlist;
43
44 debugf( "\nrockbox test harness started.\n" );
45
46 /* populate runtime data structures */
47
48 initialise( &settings, &playlist );
49
50 /* begin tests */
51
52 start( &settings, &playlist );
53
54 return 1;
55}
56
57/*
58 * populate runtime data structures
59 */
60void initialise( user_settings_t *settings, playlist_info_t *playlist )
61{
62 debugf( "init()\n" );
63
64 reload_all_settings( settings );
65 reload_playlist_info( playlist );
66}
67
68/*
69 * start tests
70 */
71void start( user_settings_t *settings, playlist_info_t *playlist )
72{
73 track_t track;
74
75 debugf( "start()\n" );
76
77 /* show current values */
78
79 display_current_settings( settings );
80 display_current_playlist( playlist );
81
82 /* wipe playlist contents */
83
84 empty_playlist( playlist );
85 display_current_playlist( playlist );
86
87 /* user selects a new playlist */
88
89 load_playlist( playlist, "test2.m3u" );
90 display_current_playlist( playlist );
91
92 /* randomise playlist */
93
94 randomise_playlist( playlist, 45678 );
95 display_current_playlist( playlist );
96
97 /* get next track in playlist */
98
99 track = next_playlist_track( playlist );
100 display_playlist_track( &track );
101
102 /* get next track in playlist */
103
104 track = next_playlist_track( playlist );
105 display_playlist_track( &track );
106}
107#ifdef SIMULATOR
108void app_main ()
109{
110 main (0, NULL);
111}
112#endif
diff --git a/firmware/test/wavey/harness.h b/firmware/test/wavey/harness.h
deleted file mode 100644
index 5bb357c131..0000000000
--- a/firmware/test/wavey/harness.h
+++ /dev/null
@@ -1,24 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2002 by wavey@wavey.org
11 *
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
14 *
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
17 *
18 ****************************************************************************/
19
20#include "settings.h"
21#include "playlist.h"
22
23void initialise( user_settings_t *settings, playlist_info_t *playlist );
24void start( user_settings_t *settings, playlist_info_t *playlist );
diff --git a/firmware/test/wavey/wavey.txt b/firmware/test/wavey/wavey.txt
deleted file mode 100644
index 20bdf4a3df..0000000000
--- a/firmware/test/wavey/wavey.txt
+++ /dev/null
@@ -1,4 +0,0 @@
1testing
2testing ssh keys
32
43 \ No newline at end of file