diff options
author | Daniel Stenberg <daniel@haxx.se> | 2004-01-08 15:46:17 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2004-01-08 15:46:17 +0000 |
commit | 8463a2bbd3f64ad47f5d30ca9a1957c170f48ec1 (patch) | |
tree | 6ead4078a20990b62179a28eb4003d792bf93535 /firmware/test | |
parent | 5c7d66890c5ba05402c85d47dd87f6abfd4df7d9 (diff) | |
download | rockbox-8463a2bbd3f64ad47f5d30ca9a1957c170f48ec1.tar.gz rockbox-8463a2bbd3f64ad47f5d30ca9a1957c170f48ec1.zip |
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
Diffstat (limited to 'firmware/test')
-rw-r--r-- | firmware/test/wavey/Makefile | 56 | ||||
-rw-r--r-- | firmware/test/wavey/Makefile.win32 | 43 | ||||
-rw-r--r-- | firmware/test/wavey/README.playlists | 84 | ||||
-rw-r--r-- | firmware/test/wavey/harness.c | 112 | ||||
-rw-r--r-- | firmware/test/wavey/harness.h | 24 | ||||
-rw-r--r-- | firmware/test/wavey/wavey.txt | 4 |
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 | |||
10 | FIRMWARE = ../.. | ||
11 | COMMON = $(FIRMWARE)/common | ||
12 | DRIVERS = $(FIRMWARE)/drivers | ||
13 | |||
14 | CC = gcc | ||
15 | LD = ld | ||
16 | AR = ar | ||
17 | AS = as | ||
18 | OC = objcopy | ||
19 | scramble = scramble-win32 | ||
20 | DEFINES = -DCRT_DISPLAY -DDEBUG -DSIMULATOR | ||
21 | INCLUDES=-I. -I$(FIRMWARE) -I$(COMMON) -I$(DRIVERS) | ||
22 | TARGET_OPTIONS = | ||
23 | CFLAGS = -g -Wall ${TARGET_OPTIONS} -Wstrict-prototypes $(INCLUDES) $(DEFINES) | ||
24 | |||
25 | SRC := playlist.c settings.c panic.c disk.c debug.c harness.c | ||
26 | OBJS := $(SRC:%.c=%.o) | ||
27 | |||
28 | %.o: %.s | ||
29 | $(CC) -o $@ $(CFLAGS) $(INCLUDES) $(DEFS) -c $< | ||
30 | |||
31 | all : rockbox | ||
32 | |||
33 | rockbox: $(OBJS) | ||
34 | $(CC) -o $@ ${OBJS} | ||
35 | |||
36 | playlist.o:$(FIRMWARE)/playlist.c | ||
37 | $(CC) $(CFLAGS) -c $< -o $@ | ||
38 | |||
39 | settings.o:$(FIRMWARE)/settings.c | ||
40 | $(CC) $(CFLAGS) -c $< -o $@ | ||
41 | |||
42 | panic.o:$(FIRMWARE)/panic.c | ||
43 | $(CC) $(CFLAGS) -c $< -o $@ | ||
44 | |||
45 | disk.o:$(FIRMWARE)/disk.c | ||
46 | $(CC) $(CFLAGS) -c $< -o $@ | ||
47 | |||
48 | debug.o:$(FIRMWARE)/debug.c | ||
49 | $(CC) $(CFLAGS) -c $< -o $@ | ||
50 | |||
51 | dist: | ||
52 | tar czvf dist.tar.gz Makefile main.c start.s app.lds | ||
53 | |||
54 | clean: | ||
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 | ||
11 | TARGET = -DARCHOS_PLAYER=1 | ||
12 | #TARGET = -DARCHOS_PLAYER_OLD=1 | ||
13 | #TARGET = -DARCHOS_RECORDER=1 | ||
14 | |||
15 | CC = gcc | ||
16 | LD = ld | ||
17 | AR = ar | ||
18 | AS = as | ||
19 | OC = objcopy | ||
20 | scramble = scramble-win32 | ||
21 | DEFINES = -DCRT_DISPLAY | ||
22 | INCLUDES=-I. -Icommon -Idrivers | ||
23 | TARGET_OPTIONS = | ||
24 | CFLAGS = -Os -Wall ${TARGET_OPTIONS} -nostdlib -Wstrict-prototypes -fomit-frame-pointer -fschedule-insns $(INCLUDES) $(DEFINES) $(TARGET) | ||
25 | AFLAGS += -small -relax | ||
26 | |||
27 | SRC := playlist.c settings.c panic.c disk.c debug.c harness.c | ||
28 | OBJS := $(SRC:%.c=%.o) | ||
29 | |||
30 | %.o: %.s | ||
31 | $(CC) -o $@ $(CFLAGS) $(INCLUDES) $(DEFS) -c $< | ||
32 | |||
33 | all : rockbox-win32.exe | ||
34 | |||
35 | rockbox-win32.exe: $(OBJS) | ||
36 | $(CC) -o rockbox-win32.exe ${OBJS} | ||
37 | |||
38 | dist: | ||
39 | tar czvf dist.tar.gz Makefile main.c start.s app.lds | ||
40 | |||
41 | clean: | ||
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 | |||
4 | 1. Demand-loading of Playlist Filenames from Disk | ||
5 | |||
6 | A playlist is simply a list of track names. These lists can either be | ||
7 | created dynamically by the user, or they can be predefined and placed | ||
8 | into a text file with an .m3u extension. | ||
9 | |||
10 | The 2048 KB of RAM is the reason we need to get this right. If an average | ||
11 | track name (i.e. \music\cure\disintegration\01-pictures_of_you.mp3) | ||
12 | is assumed to be 50 characters long, then: | ||
13 | |||
14 | A playlist of 15 tracks is 15 * 50 ~= 750 bytes | ||
15 | A playlist of 100 tracks is 100 * 50 ~= 5 kilobytes | ||
16 | A playlist of 3500 tracks is 3500 * 50 ~= 175 kilobytes | ||
17 | A playlist of 10000 tracks is 10000 * 50 ~= 1/4 megabyte | ||
18 | |||
19 | From these figures, it can be seen that for large playlists, storing | ||
20 | the entire list of track names in memory significantly reduces the | ||
21 | capacity available to the audio data buffer, which in turn has a negative | ||
22 | impact on the performance of the system. | ||
23 | |||
24 | One method of reducing the total memory consumption of a playlist is | ||
25 | to delay bringing the actual filenames into memory until needed. Instead, | ||
26 | the playlist text file can be scanned, and an in-memory array constructed | ||
27 | with one element for each track present in the text file. Progressing | ||
28 | through the playlist entails getting the appropriate entry from the array, | ||
29 | and using that to perform a lookup of the corresponding filename entry | ||
30 | from the playlist text file. | ||
31 | |||
32 | With this method, and given that an integer on the Rockbox's CPU is 4 bytes: | ||
33 | |||
34 | A playlist of 15 tracks is 15 * 4 ~= 60 bytes | ||
35 | A playlist of 100 tracks is 100 * 4 ~= 400 bytes | ||
36 | A playlist of 3500 tracks is 3500 * 4 ~= 13 kilobytes | ||
37 | A playlist of 10000 tracks is 10000 * 4 ~= 39 kilobytes | ||
38 | |||
39 | It is clear that these are substantial savings, albeit at the cost of | ||
40 | increased complexity and disk i/o. Prefetch strategies could improve | ||
41 | performance compared to demand-loading a single entry. | ||
42 | |||
43 | 2. Implementation Options | ||
44 | |||
45 | Keeping the track names in a file on disk is easy enough for a predefined | ||
46 | m3u playlist, but for dynamically created playlists, where the user | ||
47 | browses the filesystem and adds tracks or entire directory hierarchies | ||
48 | at will, we will need to store the playlist track names in a dedicated | ||
49 | file. This will be called the Anonymous Playlist, the location of which | ||
50 | can be set by the user, but will default to \anonymous.m3u or somesuch. | ||
51 | The current contents of the Anonymous Playlist can be named and saved at | ||
52 | any time. | ||
53 | |||
54 | The data structure to support playlists would therefore be: | ||
55 | |||
56 | typedef 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 | |||
63 | So far, so good: we read from an existing m3u file, or we create an | ||
64 | anonymous one. But what do we do if we start with an existing m3u file, | ||
65 | and then the user wants to dynamically add tracks to it? A few options | ||
66 | exist: | ||
67 | |||
68 | a) we disallow playlist modification of existing m3u files, offering | ||
69 | instead to replace the current playlist with the new one. | ||
70 | |||
71 | b) we give the user the option of appending the new tracks to the | ||
72 | existing m3u file. | ||
73 | |||
74 | c) 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 | |||
32 | char panic_message[128]; | ||
33 | |||
34 | /* | ||
35 | * entrypoint | ||
36 | */ | ||
37 | int 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 | */ | ||
60 | void 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 | */ | ||
71 | void 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 | ||
108 | void 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 | |||
23 | void initialise( user_settings_t *settings, playlist_info_t *playlist ); | ||
24 | void 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 @@ | |||
1 | testing | ||
2 | testing ssh keys | ||
3 | 2 | ||
4 | 3 \ No newline at end of file | ||