Rockbox-MoB.git
16 years agoFirst commit of buffering.[ch], based on testplugin.cmaster
Nicolas Pennequin [Thu, 16 Aug 2007 13:54:14 +0000 (16 15:54 +0200)]
First commit of buffering.[ch], based on testplugin.c

These are based on testplugin.c, with the "rb->" API calls replaced by
regular calls. The utility and threading code are removed, except for
buffering_thread(), which is still highly experimental.

16 years agobufopen: better description of the offset parameter.
Nicolas Pennequin [Tue, 14 Aug 2007 18:58:58 +0000 (14 20:58 +0200)]
bufopen: better description of the offset parameter.

16 years agoTruly read the ID3 info from the files.
Nicolas Pennequin [Tue, 14 Aug 2007 17:06:57 +0000 (14 19:06 +0200)]
Truly read the ID3 info from the files.

Call get_metadata to obtain the struct mp3entry with the file's metadata.
We need to use special functions to copy ot move the struct mp3entry because
it has pointers to an internal buffer.
The bufopen thread needs a bigger stack for this.

Tested successfully on sim and on the gigabeat.

16 years agobufread, bufgetdata: Better check for when data isn't ready.
Nicolas Pennequin [Tue, 7 Aug 2007 21:37:00 +0000 (7 23:37 +0200)]
bufread, bufgetdata: Better check for when data isn't ready.

The only case when the caller should get less data than requested is near
the end of the file. When not enough data has been buffered, the caller has
to wait.

16 years agoMake the (very primitive) metadata handling use bufalloc().working_mob_2
Nicolas Pennequin [Tue, 7 Aug 2007 21:27:59 +0000 (7 23:27 +0200)]
Make the (very primitive) metadata handling use bufalloc().

Added read_metadata() which makes a few changes to the metadata that we get
from the files. The resulting buffer is then passed to bufalloc, which stores
it in the main buffer. print_metadata() becomes much simpler thanks to this.

This is a good example of how bufalloc is meant to be used.
Tested successfully on target and sim.

16 years agoAdd the bufalloc API call to load data from a source other than a file.
Nicolas Pennequin [Tue, 7 Aug 2007 20:51:24 +0000 (7 22:51 +0200)]
Add the bufalloc API call to load data from a source other than a file.

16 years agobufopen: Factor out the pre-checking.
Nicolas Pennequin [Tue, 7 Aug 2007 20:07:23 +0000 (7 22:07 +0200)]
bufopen: Factor out the pre-checking.

Factored out the code that checks there is enough space to finish buffering
the current handle. It will be used again in the next commit.

16 years agobuffer_handle: Remember that we closed the FD once the file is buffered.
Nicolas Pennequin [Tue, 7 Aug 2007 18:04:06 +0000 (7 20:04 +0200)]
buffer_handle: Remember that we closed the FD once the file is buffered.

16 years agoMoved the old standalone app to testapp.c
Nicolas Pennequin [Tue, 7 Aug 2007 10:38:04 +0000 (7 12:38 +0200)]
Moved the old standalone app to testapp.c

16 years agobufopen: Add support for data types that can't wrap.
Nicolas Pennequin [Mon, 6 Aug 2007 22:14:15 +0000 (7 00:14 +0200)]
bufopen: Add support for data types that can't wrap.

Added a new data type: TYPE_STREAM, for stream audio that can't wrap.
The only data type allowed to wrap is audio.
Now bufopen returns -2 for all cases where adding the handle failed
because of a lack of memory space.

16 years agoAdd a quick buffering example.
Nicolas Pennequin [Mon, 6 Aug 2007 12:05:04 +0000 (6 14:05 +0200)]
Add a quick buffering example.

16 years agobufseek: Changed specification and improved range checking.
Nicolas Pennequin [Sun, 5 Aug 2007 18:17:29 +0000 (5 20:17 +0200)]
bufseek: Changed specification and improved range checking.

It makes more sense to seek within the file than within the available data,
(that would be overly complicated for the caller anyway).
Seeking to a point before the available data should now trigger a rebuffer
(required for the case of rewinding to the start of an audio track), but I
haven't tested this yet.

16 years agofree_buffer: Keep h->offset in sync so we know where we are in the file.
Nicolas Pennequin [Sat, 4 Aug 2007 21:00:52 +0000 (4 23:00 +0200)]
free_buffer: Keep h->offset in sync so we know where we are in the file.

16 years agoA couple comment changes.
Nicolas Pennequin [Sat, 4 Aug 2007 20:34:50 +0000 (4 22:34 +0200)]
A couple comment changes.

16 years agobufread: Make it behave correctly.working_mob
Nicolas Pennequin [Sat, 4 Aug 2007 19:14:47 +0000 (4 21:14 +0200)]
bufread: Make it behave correctly.

* Correct the behaviour towards the end of the file (it simply wasn't detected).
* Don't advance the buffer reading pointer.
* Don't change h->available !!

Tested successfully on target (gigabeat) and in the sim.

16 years agobufgetdata: Check that the caller isn't too greedy.
Nicolas Pennequin [Sat, 4 Aug 2007 18:26:58 +0000 (4 20:26 +0200)]
bufgetdata: Check that the caller isn't too greedy.

When the buffer wraps and we need to use the guard buffer to provide a complete chunk,
there is a limit to the amount of data we can provide. It's unsafe to assume we can
provide the requested amount of data.

16 years agoCosmetic improvements and lots of comments.
Nicolas Pennequin [Sat, 4 Aug 2007 18:19:15 +0000 (4 20:19 +0200)]
Cosmetic improvements and lots of comments.

16 years agoDon't stop filling the buffer after the first handle that needs buffering.
Nicolas Pennequin [Sat, 4 Aug 2007 16:06:35 +0000 (4 18:06 +0200)]
Don't stop filling the buffer after the first handle that needs buffering.

16 years agoUse the buffering API to access snprintf and increase stack size for the bufopen...
Nicolas Pennequin [Sat, 4 Aug 2007 15:35:07 +0000 (4 17:35 +0200)]
Use the buffering API to access snprintf and increase stack size for the bufopen thread.

16 years agoA few buffer freeing and debug ouptut tweaks.
Nicolas Pennequin [Sat, 4 Aug 2007 15:28:33 +0000 (4 17:28 +0200)]
A few buffer freeing and debug ouptut tweaks.

* Only free the buffer when there is data left to be buffered.
* First free buffer space from audio data, then move the metadata (more efficient).
* A few debug output improvements.

16 years agoIntroducing metadata in the test !
Nicolas Pennequin [Sat, 4 Aug 2007 15:09:06 +0000 (4 17:09 +0200)]
Introducing metadata in the test !

Before opening the audio files, the bufopen thread will open corresponding metadata files
from /meta/X.txt, where X is the name of the audio file. The first two lines of the file
will be displayed on the screen while the audio file is read.

16 years agoAdd a "type" argument to bufopen and make it capable of reserving space before openin...
Nicolas Pennequin [Sat, 4 Aug 2007 15:05:58 +0000 (4 17:05 +0200)]
Add a "type" argument to bufopen and make it capable of reserving space before opening new handles.

Instead of simply refusing to open a new handle when the current one isn't finished buffering,
we check that there is enough space for the current one to finish buffering and open the new
handle at the right place.

Also adapted buffer_handle to this.

16 years agoMake free_buffer move metadata handles
Nicolas Pennequin [Sat, 4 Aug 2007 15:01:11 +0000 (4 17:01 +0200)]
Make free_buffer move metadata handles

We want to make metadata handles always be as close as possible to the audio data.

16 years agoMake move_handle capable of moving data from the handle along with the handle struct...
Nicolas Pennequin [Sat, 4 Aug 2007 14:57:24 +0000 (4 16:57 +0200)]
Make move_handle capable of moving data from the handle along with the handle struct itself.

Add a data_size argument to move_handle, to make it move a certain amount of data at the same time as the handle.
This will allow moving metadata handles easily within free_buffer.
Also updated the comment for move_handle and the move_handle calls in the linked list test.

16 years agoClear the warning
Nicolas Pennequin [Sat, 4 Aug 2007 13:39:26 +0000 (4 15:39 +0200)]
Clear the warning

16 years agoThread behaviour changed (faster "playback").
Nicolas Pennequin [Sat, 4 Aug 2007 13:37:02 +0000 (4 15:37 +0200)]
Thread behaviour changed (faster "playback").

Tightened the timings to make playback go faster and changed the buffering behaviour.
It now rebuffers and clears wasted space more often.

Tested successfully on target (gigabeat) and sim.

16 years agoA bit of cleaning up.working2
Nicolas Pennequin [Fri, 3 Aug 2007 18:41:27 +0000 (3 20:41 +0200)]
A bit of cleaning up.
Trimmed long lines and removed useless commented debug output.

16 years agoAlso stop copying if it would overwrite the next handle.
Nicolas Pennequin [Fri, 3 Aug 2007 18:34:04 +0000 (3 20:34 +0200)]
Also stop copying if it would overwrite the next handle.

16 years agoCorrect and enable the disabled part of the linked list test. It now works on target...
nico [Wed, 18 Jul 2007 15:38:58 +0000 (18 15:38 +0000)]
Correct and enable the disabled part of the linked list test. It now works on target too.

git-svn-id: svn://jdgordon.mine.nu/mob@60 9862a28c-4e93-4879-ac26-10afcf840a8f

16 years agoWrite to the handle's current position and not the buffer writing position.
Nicolas Pennequin [Fri, 3 Aug 2007 17:14:28 +0000 (3 19:14 +0200)]
Write to the handle's current position and not the buffer writing position.
Shouldn't change anything now but will prevent potential bugs.

16 years agoEnable the type struct member.
Nicolas Pennequin [Fri, 3 Aug 2007 16:56:03 +0000 (3 18:56 +0200)]
Enable the type struct member.

16 years agoSome debug output tweaks
Nicolas Pennequin [Fri, 3 Aug 2007 14:57:54 +0000 (3 16:57 +0200)]
Some debug output tweaks

16 years agoThe data_len struct member isn't needed
Nicolas Pennequin [Fri, 3 Aug 2007 14:53:32 +0000 (3 16:53 +0200)]
The data_len struct member isn't needed

16 years agoDon't change h->ridx when moving the handle.
Nicolas Pennequin [Fri, 3 Aug 2007 14:53:13 +0000 (3 16:53 +0200)]
Don't change h->ridx when moving the handle.
This makes the output correct :)

16 years agoSome fixes
Nicolas Pennequin [Fri, 3 Aug 2007 14:34:21 +0000 (3 16:34 +0200)]
Some fixes
* A long lasting bug in free_buffer
* We can only add a handle when the current one has finished buffering
* Some debug output changes

16 years agoAdd a new thread ("bufopen") that just adds files. Rename the playback thread codec...
Nicolas Pennequin [Fri, 3 Aug 2007 13:20:16 +0000 (3 15:20 +0200)]
Add a new thread ("bufopen") that just adds files. Rename the playback thread codec thread. Fix bugs.

The bufopen thread will try adding a new file to the buffer every 8 seconds. There can now be between 0 and all the files on the buffer at the same time, which is much more interesting than only one.
The playback thread is now actually much closer to the real-life codec thread than the playback thread (though it's a very simple codec), so now is a good time to rename it.

Bugfixes:
* When adding a handle fails, close the file descriptor that was opened to get the file's size.
* When moving a handle, the alignment should be done backwards, or else we risk losing some data, and free_buffer() needs to check whether the movng succeeded.
* Before aligning the buffer write position to add a new handle, it's better to check whether we have enough space to do that.
* When we see we can't allocate enough space for the whole file, we need to make sure we take enough off the asked size, or else there might be a confusion between the empty and full states of the main buffer.

16 years agoRemove a useless part that was meant to add a new file.
Nicolas Pennequin [Fri, 3 Aug 2007 12:52:06 +0000 (3 14:52 +0200)]
Remove a useless part that was meant to add a new file.

16 years agoAdd a bit more information on screen
Nicolas Pennequin [Fri, 3 Aug 2007 12:50:41 +0000 (3 14:50 +0200)]
Add a bit more information on screen

16 years agoAdd some basic screen output.
nico [Wed, 18 Jul 2007 13:45:58 +0000 (18 13:45 +0000)]
Add some basic screen output.
The amount of data read (by the playback thread) for the current file is displayed on screen. This helps know what's happening for on-target tests (which I haven't done lately).

git-svn-id: svn://jdgordon.mine.nu/mob@57 9862a28c-4e93-4879-ac26-10afcf840a8f

16 years agoUse generic file names instead of the ones I initially hard-coded, to make testing... working1
nico [Sun, 15 Jul 2007 13:50:45 +0000 (15 13:50 +0000)]
Use generic file names instead of the ones I initially hard-coded, to make testing easier.

git-svn-id: svn://jdgordon.mine.nu/mob@53 9862a28c-4e93-4879-ac26-10afcf840a8f

16 years agoSmall cosmetic change in buffer access.
nico [Sun, 15 Jul 2007 13:39:54 +0000 (15 13:39 +0000)]
Small cosmetic change in buffer access.
Use &buffer[idx] instead of buffer + idx.

git-svn-id: svn://jdgordon.mine.nu/mob@52 9862a28c-4e93-4879-ac26-10afcf840a8f

16 years agoFix the missing bytes bug.
nico [Sun, 15 Jul 2007 13:33:30 +0000 (15 13:33 +0000)]
Fix the missing bytes bug.
the write() call can only happen when bufgetdata returns a positive value.

git-svn-id: svn://jdgordon.mine.nu/mob@51 9862a28c-4e93-4879-ac26-10afcf840a8f

16 years agoCode cleanup.
nico [Sun, 15 Jul 2007 12:33:27 +0000 (15 12:33 +0000)]
Code cleanup.
Removed the outdated disabled code.

git-svn-id: svn://jdgordon.mine.nu/mob@50 9862a28c-4e93-4879-ac26-10afcf840a8f

16 years agoA few changes:
nico [Sun, 15 Jul 2007 12:27:48 +0000 (15 12:27 +0000)]
A few changes:
* Slightly change how move_handle works to make it more practical to use.
* Change the sleep durations. This solves a problem I had where a long file would stop being buffered after less than a megabyte with error "bad file number". I think "playback" was simply too fast but this needs to be investigated.
* Turn backlight on when the plugin is finished
* The disabled code that I added is the basic beginning of having more then one file on the buffer at a time. It's not my priority right now.

There is a bug left on targets: the first two bytes (maybe not always two though) are missing on some of my test files. The others come out fine. After some tests, it seems that the buffering is ok (the first two bytes of the buffered data are correct), but at some point the bytes are lost when writing the file or reading the memory.

git-svn-id: svn://jdgordon.mine.nu/mob@49 9862a28c-4e93-4879-ac26-10afcf840a8f

16 years agotrying again
jonno [Sun, 15 Jul 2007 05:06:13 +0000 (15 05:06 +0000)]
trying again

git-svn-id: svn://jdgordon.mine.nu/mob@48 9862a28c-4e93-4879-ac26-10afcf840a8f

16 years agono code change, testing something with the repo
jonno [Sun, 15 Jul 2007 04:55:19 +0000 (15 04:55 +0000)]
no code change, testing something with the repo

git-svn-id: svn://jdgordon.mine.nu/mob@47 9862a28c-4e93-4879-ac26-10afcf840a8f

16 years agoFix the warnings by using more appropriate types.
nico [Mon, 9 Jul 2007 13:16:32 +0000 (9 13:16 +0000)]
Fix the warnings by using more appropriate types.

git-svn-id: svn://jdgordon.mine.nu/mob@46 9862a28c-4e93-4879-ac26-10afcf840a8f

16 years agoIt works on target !
nico [Sun, 8 Jul 2007 20:49:21 +0000 (8 20:49 +0000)]
It works on target !

* Increase stack size and reduce stack usage for the playback thread to prevent panic:stkov crashes on target (test on gigabeat). The files are outputted correctly.
* Make bufread() and bufgetdata() return -2 when the data for the handle isn't ready and add the check in the playback thread.

git-svn-id: svn://jdgordon.mine.nu/mob@45 9862a28c-4e93-4879-ac26-10afcf840a8f

16 years ago* Add data_rem() that returns the amount of data left to buffer. This prevents the...
nico [Sun, 8 Jul 2007 18:53:27 +0000 (8 18:53 +0000)]
* Add data_rem() that returns the amount of data left to buffer. This prevents the buffering thread to endlessly try to fill the buffer when nothing is available to fill it with.
* Add a remove_thread() call to end the playbck thread.
* Make the reading faster.

Now it works well on the sim: it buffers the files and reads them progressively, and the MD5sums are correct. I still have to test on target.
Currently it only has one file in the buffere at a time.

git-svn-id: svn://jdgordon.mine.nu/mob@44 9862a28c-4e93-4879-ac26-10afcf840a8f

16 years agoAlmost complete rework of the threading logic.
nico [Sun, 8 Jul 2007 17:26:37 +0000 (8 17:26 +0000)]
Almost complete rework of the threading logic.
The buffering thread is in fact just there to fill the buffer at appropriate times, so there is no need for the messaging code  I added earlier.
The code in both the threads is still basic and untested, so it probably doesn't work, but I think it reflects what the threads should do.

git-svn-id: svn://jdgordon.mine.nu/mob@43 9862a28c-4e93-4879-ac26-10afcf840a8f

16 years agoBetter use of queue_send and trim a few long lines.
nico [Sun, 8 Jul 2007 13:57:38 +0000 (8 13:57 +0000)]
Better use of queue_send and trim a few long lines.

git-svn-id: svn://jdgordon.mine.nu/mob@42 9862a28c-4e93-4879-ac26-10afcf840a8f

16 years agoApply the previous change to buffering.c with a bugfix. There needs to be more change...
nico [Sun, 8 Jul 2007 11:12:38 +0000 (8 11:12 +0000)]
Apply the previous change to buffering.c with a bugfix. There needs to be more changes if we want to really use the new data_len field.

git-svn-id: svn://jdgordon.mine.nu/mob@41 9862a28c-4e93-4879-ac26-10afcf840a8f

16 years ago* Add a size argument to add_handle() so that it can reserve space.
nico [Sun, 8 Jul 2007 10:42:06 +0000 (8 10:42 +0000)]
* Add a size argument to add_handle() so that it can reserve space.
* Add a data_len field to the memory_handle struct to allow easy access to the buffer space for the handle (this might not be really necessary).
* Add a queue_reply call to make the queue_send calls return a value.

git-svn-id: svn://jdgordon.mine.nu/mob@40 9862a28c-4e93-4879-ac26-10afcf840a8f

16 years agoUse queue_send to (IIUC) make some calls blocking and allow them to return a value...
nico [Sat, 7 Jul 2007 18:27:19 +0000 (7 18:27 +0000)]
Use queue_send to (IIUC) make some calls blocking and allow them to return a value. It has to be added to the plugin API.

git-svn-id: svn://jdgordon.mine.nu/mob@39 9862a28c-4e93-4879-ac26-10afcf840a8f

16 years agoBeginnings of threading.
nico [Sat, 7 Jul 2007 16:11:24 +0000 (7 16:11 +0000)]
Beginnings of threading.
There is a playback thread and the plugin main function will emulate the buffering thread.
The buf*() API calls post messages to the buffering thread, that will treat them in sequence.
The code compiles with a lot of warnings and still needs a lot of work. It probably wouldn't work at all but I haven't tested it.

git-svn-id: svn://jdgordon.mine.nu/mob@38 9862a28c-4e93-4879-ac26-10afcf840a8f

16 years agoApply some of the changes made to the test plugin to the standalone app.
nico [Fri, 6 Jul 2007 17:00:28 +0000 (6 17:00 +0000)]
Apply some of the changes made to the test plugin to the standalone app.

git-svn-id: svn://jdgordon.mine.nu/mob@37 9862a28c-4e93-4879-ac26-10afcf840a8f

16 years agoUse DEBUGF instead of logf and add #defines to avoid having to change all the time.
nico [Fri, 6 Jul 2007 16:46:40 +0000 (6 16:46 +0000)]
Use DEBUGF instead of logf and add #defines to avoid having to change all the time.
Other than that, nothing very interesting and no actual code change.

git-svn-id: svn://jdgordon.mine.nu/mob@36 9862a28c-4e93-4879-ac26-10afcf840a8f

16 years agoMove the plugin to the root, as testplugin.c
nico [Thu, 5 Jul 2007 16:28:12 +0000 (5 16:28 +0000)]
Move the plugin to the root, as testplugin.c

git-svn-id: svn://jdgordon.mine.nu/mob@35 9862a28c-4e93-4879-ac26-10afcf840a8f

16 years agoThe problem on target was due to alignment issues, so add alignment checks. There...
nico [Thu, 5 Jul 2007 16:25:20 +0000 (5 16:25 +0000)]
The problem on target was due to alignment issues, so add alignment checks. There might be more required.
I don't understand why, but the linked list test still fails on target because of move_handle().

git-svn-id: svn://jdgordon.mine.nu/mob@34 9862a28c-4e93-4879-ac26-10afcf840a8f

16 years agoA few minor changes to buffering.c and add the plugin version.
nico [Thu, 5 Jul 2007 14:37:02 +0000 (5 14:37 +0000)]
A few minor changes to buffering.c and add the plugin version.

git-svn-id: svn://jdgordon.mine.nu/mob@33 9862a28c-4e93-4879-ac26-10afcf840a8f

16 years agoA bit more maintenance.
nico [Wed, 4 Jul 2007 21:34:54 +0000 (4 21:34 +0000)]
A bit more maintenance.

git-svn-id: svn://jdgordon.mine.nu/mob@32 9862a28c-4e93-4879-ac26-10afcf840a8f

16 years ago* Moved some helpers (definitions of rockbox macros) to helpers.h.
nico [Wed, 4 Jul 2007 20:15:28 +0000 (4 20:15 +0000)]
* Moved some helpers (definitions of rockbox macros) to helpers.h.
* Replaced printf calls by DEBUGF for future porting to rockbox code.
* Renamed h->buf_idx to h->ridx and introduced h->widx, mainly to allow buffering any handle, not just the current one.
* Moved the memory_handle struct into buffering.c because it's not supposed to be exported.

git-svn-id: svn://jdgordon.mine.nu/mob@31 9862a28c-4e93-4879-ac26-10afcf840a8f

16 years agoAdd an error check to bufseek() and add bufadvance() to seek relatively to the curren...
nico [Wed, 4 Jul 2007 17:38:22 +0000 (4 17:38 +0000)]
Add an error check to bufseek() and add bufadvance() to seek relatively to the current buf_idx.

git-svn-id: svn://jdgordon.mine.nu/mob@30 9862a28c-4e93-4879-ac26-10afcf840a8f

16 years agoTake the "size" argument into account in bufgetdata(), using the guard buffer if...
nico [Wed, 4 Jul 2007 17:09:21 +0000 (4 17:09 +0000)]
Take the "size" argument into account in bufgetdata(), using the guard buffer if needed to ensure enough data is provided. The main() now reads files in chunks of the size of the guard buffer, but without using the guard buffer. This hopefully simulates codec behaviour accurately.

git-svn-id: svn://jdgordon.mine.nu/mob@29 9862a28c-4e93-4879-ac26-10afcf840a8f

16 years ago* Implement bufgetdata() and change the main() so it uses it.
nico [Wed, 4 Jul 2007 01:24:04 +0000 (4 01:24 +0000)]
* Implement bufgetdata() and change the main() so it uses it.
* Change free_buffer to accept a handle_id as argument so it can be used on any handle.
* A few other minor changes

git-svn-id: svn://jdgordon.mine.nu/mob@28 9862a28c-4e93-4879-ac26-10afcf840a8f

16 years agoNico please read unless there is another commit from me today.
jonno [Tue, 3 Jul 2007 03:05:35 +0000 (3 03:05 +0000)]
Nico please read unless there is another commit from me today.
random thoughts on a safe area for the MoB

git-svn-id: svn://jdgordon.mine.nu/mob@27 9862a28c-4e93-4879-ac26-10afcf840a8f

16 years agoCorrect the comment for free_buffer now that we know it works well, and make it displ...
nico [Tue, 3 Jul 2007 01:35:33 +0000 (3 01:35 +0000)]
Correct the comment for free_buffer now that we know it works well, and make it display the buffer status when it finishes.

git-svn-id: svn://jdgordon.mine.nu/mob@26 9862a28c-4e93-4879-ac26-10afcf840a8f

16 years agofirst woops commit :D
jonno [Tue, 3 Jul 2007 01:17:00 +0000 (3 01:17 +0000)]
first woops commit :D

git-svn-id: svn://jdgordon.mine.nu/mob@25 9862a28c-4e93-4879-ac26-10afcf840a8f

16 years agofix caching
jonno [Tue, 3 Jul 2007 01:16:24 +0000 (3 01:16 +0000)]
fix caching

git-svn-id: svn://jdgordon.mine.nu/mob@24 9862a28c-4e93-4879-ac26-10afcf840a8f

16 years agoDisable the limiting to 5 reads in the playback part. A file bigger than the buffer...
nico [Tue, 3 Jul 2007 01:14:57 +0000 (3 01:14 +0000)]
Disable the limiting to 5 reads in the playback part. A file bigger than the buffer is now outputted correctly.

git-svn-id: svn://jdgordon.mine.nu/mob@23 9862a28c-4e93-4879-ac26-10afcf840a8f

16 years agosimulate the playback thread a bit better
jonno [Tue, 3 Jul 2007 01:04:06 +0000 (3 01:04 +0000)]
simulate the playback thread a bit better
move the first handle to fre up space when a certain amount is wasted
almost have working large files

git-svn-id: svn://jdgordon.mine.nu/mob@22 9862a28c-4e93-4879-ac26-10afcf840a8f

16 years agoSome improvements to the main().
nico [Tue, 3 Jul 2007 00:35:17 +0000 (3 00:35 +0000)]
Some improvements to the main().

git-svn-id: svn://jdgordon.mine.nu/mob@21 9862a28c-4e93-4879-ac26-10afcf840a8f

16 years agoAttempt to implement buffer freeing. Something is wrong somewhere with the moving...
nico [Mon, 2 Jul 2007 20:39:56 +0000 (2 20:39 +0000)]
Attempt to implement buffer freeing. Something is wrong somewhere with the moving, but I couldn't figure out what. Disabled the caching in case it is interfering.
Added a function to graphically display the status of the ring buffer.
More details later, I have to go.

git-svn-id: svn://jdgordon.mine.nu/mob@20 9862a28c-4e93-4879-ac26-10afcf840a8f

16 years agoadd some note-to-self comments
jonno [Mon, 2 Jul 2007 16:08:15 +0000 (2 16:08 +0000)]
add some note-to-self comments

git-svn-id: svn://jdgordon.mine.nu/mob@19 9862a28c-4e93-4879-ac26-10afcf840a8f

16 years agoremove dead code
jonno [Mon, 2 Jul 2007 15:59:18 +0000 (2 15:59 +0000)]
remove dead code

git-svn-id: svn://jdgordon.mine.nu/mob@18 9862a28c-4e93-4879-ac26-10afcf840a8f

16 years agomore main() cleanup. playback handles unbuffered files properly
jonno [Mon, 2 Jul 2007 15:57:15 +0000 (2 15:57 +0000)]
more main() cleanup. playback handles unbuffered files properly

git-svn-id: svn://jdgordon.mine.nu/mob@17 9862a28c-4e93-4879-ac26-10afcf840a8f

16 years agoadd -Wall to the makfile and fix the warnings.
nico [Mon, 2 Jul 2007 15:01:47 +0000 (2 15:01 +0000)]
add -Wall to the makfile and fix the warnings.

git-svn-id: svn://jdgordon.mine.nu/mob@16 9862a28c-4e93-4879-ac26-10afcf840a8f

16 years agothe "buffering thread" now uses the LL to buffer data instead of
jonno [Mon, 2 Jul 2007 14:54:55 +0000 (2 14:54 +0000)]
the "buffering thread" now uses the LL to buffer data instead of
remembering handle id's, which should be more closely how the final
thread will work

git-svn-id: svn://jdgordon.mine.nu/mob@15 9862a28c-4e93-4879-ac26-10afcf840a8f

16 years agothe 3rd param to open is an octal value, not decimal :p
jonno [Mon, 2 Jul 2007 14:42:41 +0000 (2 14:42 +0000)]
the 3rd param to open is an octal value, not decimal :p

git-svn-id: svn://jdgordon.mine.nu/mob@14 9862a28c-4e93-4879-ac26-10afcf840a8f

16 years agoAdd a really simple Makefile becuase im lazy
jonno [Mon, 2 Jul 2007 14:36:51 +0000 (2 14:36 +0000)]
Add a really simple Makefile becuase im lazy

git-svn-id: svn://jdgordon.mine.nu/mob@13 9862a28c-4e93-4879-ac26-10afcf840a8f

16 years ago* Add move_handle().
nico [Mon, 2 Jul 2007 14:32:06 +0000 (2 14:32 +0000)]
* Add move_handle().
* More checking in LL functions.
* Add a LL test suite to make sure everything works fine.

git-svn-id: svn://jdgordon.mine.nu/mob@12 9862a28c-4e93-4879-ac26-10afcf840a8f

16 years agoRename aux.[ch] because the name "aux" is forbidden on windows.
nico [Mon, 2 Jul 2007 10:58:39 +0000 (2 10:58 +0000)]
Rename aux.[ch] because the name "aux" is forbidden on windows.

git-svn-id: svn://jdgordon.mine.nu/mob@11 9862a28c-4e93-4879-ac26-10afcf840a8f

16 years agoFixed the wrppaing bug in bufread(). Now all my 4 test files come out right :)
nico [Mon, 2 Jul 2007 10:52:43 +0000 (2 10:52 +0000)]
Fixed the wrppaing bug in bufread(). Now all my 4 test files come out right :)

git-svn-id: svn://jdgordon.mine.nu/mob@10 9862a28c-4e93-4879-ac26-10afcf840a8f

16 years agoimplement bufread() and better testing. checking md5sum of the outputted
jonno [Mon, 2 Jul 2007 08:26:09 +0000 (2 08:26 +0000)]
implement bufread() and better testing. checking md5sum of the outputted
files shows that there is a bug when the file wraps the end.

git-svn-id: svn://jdgordon.mine.nu/mob@9 9862a28c-4e93-4879-ac26-10afcf840a8f

16 years agoprevent 2 segfaults. slight error checking imporvemnt.
jonno [Mon, 2 Jul 2007 07:07:52 +0000 (2 07:07 +0000)]
prevent 2 segfaults. slight error checking imporvemnt.
Add my code to do a proper test of the system. It looks like it buffers
correctly. have to implement proper bufread() to find out for sure.
./a.out <file list> to test

git-svn-id: svn://jdgordon.mine.nu/mob@8 9862a28c-4e93-4879-ac26-10afcf840a8f

16 years agoadd a quick readme explaining what this file is
jonno [Mon, 2 Jul 2007 02:28:53 +0000 (2 02:28 +0000)]
add a quick readme explaining what this file is

git-svn-id: svn://jdgordon.mine.nu/mob@7 9862a28c-4e93-4879-ac26-10afcf840a8f

16 years agobuffer_handle improvement to make it accomodate several calls.
nico [Mon, 2 Jul 2007 02:25:07 +0000 (2 02:25 +0000)]
buffer_handle improvement to make it accomodate several calls.
I changed the main() to suit my test: I give it 3 files of ~35 MB so the third isn't completely buffered at first and after unbuffering the first two we can finish buffering it and it wraps around the end of the buffer.

git-svn-id: svn://jdgordon.mine.nu/mob@6 9862a28c-4e93-4879-ac26-10afcf840a8f

16 years agoAdded bufseek() and changed the handle struct slightly.
nico [Mon, 2 Jul 2007 02:01:57 +0000 (2 02:01 +0000)]
Added bufseek() and changed the handle struct slightly.

git-svn-id: svn://jdgordon.mine.nu/mob@5 9862a28c-4e93-4879-ac26-10afcf840a8f

16 years agoadd some simple caching to find_handle()
jonno [Mon, 2 Jul 2007 01:51:53 +0000 (2 01:51 +0000)]
add some simple caching to find_handle()

git-svn-id: svn://jdgordon.mine.nu/mob@4 9862a28c-4e93-4879-ac26-10afcf840a8f

16 years agoAdding my old code which might prove useful later... (or not :p)
jonno [Mon, 2 Jul 2007 01:33:00 +0000 (2 01:33 +0000)]
Adding my old code which might prove useful later... (or not :p)

git-svn-id: svn://jdgordon.mine.nu/mob@3 9862a28c-4e93-4879-ac26-10afcf840a8f

16 years agotest
jonno [Mon, 2 Jul 2007 01:29:28 +0000 (2 01:29 +0000)]
test

git-svn-id: svn://jdgordon.mine.nu/mob@2 9862a28c-4e93-4879-ac26-10afcf840a8f

16 years agoInitial commit of my work.
nico [Mon, 2 Jul 2007 01:23:41 +0000 (2 01:23 +0000)]
Initial commit of my work.

git-svn-id: svn://jdgordon.mine.nu/mob@1 9862a28c-4e93-4879-ac26-10afcf840a8f