Andrew Mahone
20f76d61ae
Make JPEG and BMP scaler optional with HAVE_JPEG and HAVE_BMP_SCALING, both defined for all targets that have HAVE_ALBUMART. Disable JPEG in PictureFlow and pluginlib album art search with 32KiB plugin buffer until PictureFlow
...
gets overlay support.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20851 a1c6a512-1295-4272-9138-f99709370657
2009-05-04 15:46:41 +00:00
Andrew Mahone
54e6eb3bda
Search for, and load, JPEG album art files.
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20837 a1c6a512-1295-4272-9138-f99709370657
2009-05-01 23:31:43 +00:00
Bertrik Sikken
66cf3a3329
Clean up some #includes
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20238 a1c6a512-1295-4272-9138-f99709370657
2009-03-08 16:10:40 +00:00
Thomas Martitz
fcbfef8175
Show the watermark in the "Show buffering thread" screen (in bytes).
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20096 a1c6a512-1295-4272-9138-f99709370657
2009-02-23 22:55:48 +00:00
Antonius Hellmann
0055f13707
This should fix the occasional data aborts mainly in conjunction with AlbumArt on PP targets. See FS#9827 for details.
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20081 a1c6a512-1295-4272-9138-f99709370657
2009-02-22 10:12:34 +00:00
Björn Stenberg
6427d127aa
Calculate watermark from bitrate and harddisk spinup time.
...
Use a smaller PCM buffer on targets with 2MB or less ram.
(FS#9703)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19743 a1c6a512-1295-4272-9138-f99709370657
2009-01-10 21:10:56 +00:00
Andrew Mahone
9058620849
Make scaler output truly pluggable, add an 8-bit greyscale output to
...
pluginlib for use with greylib, and add source for a test scaled bmp
viewer using greylib.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19593 a1c6a512-1295-4272-9138-f99709370657
2008-12-26 07:05:13 +00:00
Michael Sevakis
8cfbd3604f
Use cookies for thread identification instead of pointers directly which gives a buffer against wrongly identifying a thread when the slot is recycled (which has been nagging me for awhile). A slot gets 255 uses before it repeats. Everything gets incompatible so a full update is required.
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19377 a1c6a512-1295-4272-9138-f99709370657
2008-12-10 08:57:10 +00:00
Andrew Mahone
781421afa2
resize-on-load for bitmap files on 2bpp and color targets
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19374 a1c6a512-1295-4272-9138-f99709370657
2008-12-09 23:07:59 +00:00
Nicolas Pennequin
3625be4803
Fix FS#9319 and its (probably) duplicate, FS#9576. They both describe the boost remaining active after a change of the dynamic playlist, an issue added in r17109.
...
The fix is to notify the buffering thread whenever an ID3 handle is created via bufopen (as is done in the other cases of bufopen).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19304 a1c6a512-1295-4272-9138-f99709370657
2008-12-02 21:07:12 +00:00
Frank Gevaerts
2f8a0081c6
Apply FS#9500. This adds a storage_*() abstraction to replace ata_*(). To do that, it also introduces sd_*, nand_*, and mmc_*.
...
This should be a good first step to allow multi-driver targets, like the Elio (ATA/SD), or the D2 (NAND/SD).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18960 a1c6a512-1295-4272-9138-f99709370657
2008-11-01 16:14:28 +00:00
Jonathan Gordon
71898e5c54
Accept FS#9480 - centralise and organise the events in the apps/ layer.
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18819 a1c6a512-1295-4272-9138-f99709370657
2008-10-16 10:38:03 +00:00
Jonathan Gordon
f397c25acf
Fix a possible deadlock if the album art loading fails
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18711 a1c6a512-1295-4272-9138-f99709370657
2008-10-05 09:17:05 +00:00
Nicolas Pennequin
cf369575bc
Add handle values to the buffering LOGFQUEUE messages for easier debugging.
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18092 a1c6a512-1295-4272-9138-f99709370657
2008-07-18 23:42:47 +00:00
Nicolas Pennequin
929d5e9399
Fix FS#9137 and FS#8194 (the end of a track is cut off after rebuffering): the cause was a confusion between regular subtraction and subtraction in a ring-buffer.
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18090 a1c6a512-1295-4272-9138-f99709370657
2008-07-18 23:26:35 +00:00
Magnus Holmgren
7c84ede378
Hopefully fix FS #9153 , as well as another bug (in fill_buffer) that could cause problems when rebuffering.
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18009 a1c6a512-1295-4272-9138-f99709370657
2008-07-11 12:44:27 +00:00
Nicolas Pennequin
a2191b93af
Fix FS#8964 (CPU remains boosted after buffering). 'filling' needs to be set to false when there's nothing left to buffer.
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17923 a1c6a512-1295-4272-9138-f99709370657
2008-07-02 21:50:42 +00:00
Daniel Stenberg
2acc0ac542
Updated our source code header to explicitly mention that we are GPL v2 or
...
later. We still need to hunt down snippets used that are not. 1324 modified
files...
http://www.rockbox.org/mail/archive/rockbox-dev-archive-2008-06/0060.shtml
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17847 a1c6a512-1295-4272-9138-f99709370657
2008-06-28 18:10:04 +00:00
Nicolas Pennequin
f7e0e6bb1c
Lock the linked list mutex when accessing the memory handles. This should fix the invalid values appearing for short times in the buffering debug screen.
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17497 a1c6a512-1295-4272-9138-f99709370657
2008-05-13 20:51:06 +00:00
Steve Bavin
e02d031f4c
Remove unused #define.
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17294 a1c6a512-1295-4272-9138-f99709370657
2008-04-30 13:04:24 +00:00
Bertrik Sikken
c97e503a10
Cleaned up playblack.h header file and usage of it.
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17276 a1c6a512-1295-4272-9138-f99709370657
2008-04-28 14:13:13 +00:00
Nicolas Pennequin
de026dcede
Fix FS#8902 (NSF files get skipped). The cause was too strict metadata checking (the NSF metadata parser doesn't fill the 'length' field). Hopefully there won't be any problems with that anymore.
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17142 a1c6a512-1295-4272-9138-f99709370657
2008-04-16 16:18:05 +00:00
Nicolas Pennequin
4e2de44b44
A rather big change to how tracks are loaded: there are now two parts to the process and metadata loading is done by the buffering thread (except for the first unbuffered track). The audio thread now calls audio_load_track, and once the metadata is loaded, the buffering thread sends an event which will make the audio thread call audio_finish_load_track. This one then takes care of the rest of the loading.
...
This method makes skipping noticeably faster for unbuffered tracks, and especially backwards.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17109 a1c6a512-1295-4272-9138-f99709370657
2008-04-14 16:17:47 +00:00
Jens Arnold
2bf4178018
Make mpegplayer sleep the disk after buffering to save battery. * Add a simulator stub for ata_sleep(), and un-ifdef most calls to it.
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17096 a1c6a512-1295-4272-9138-f99709370657
2008-04-13 12:24:47 +00:00
Nicolas Pennequin
33f522de8b
Migrate the buffering code to the new events system.
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16950 a1c6a512-1295-4272-9138-f99709370657
2008-04-03 17:51:53 +00:00
Michael Sevakis
8a6fd3ff4e
Just change PRIORITY_BUFFERING to 15. Seems a teeny tiny bit helpful to mpegplayer as well.
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16884 a1c6a512-1295-4272-9138-f99709370657
2008-03-29 23:21:19 +00:00
Michael Sevakis
9120c85698
Change the default buffer filechunk back to 32KB and bump the buffering thread priority up by one.
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16883 a1c6a512-1295-4272-9138-f99709370657
2008-03-29 20:52:56 +00:00
Nicolas Pennequin
12b6c847c5
Fix sim warnings.
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16881 a1c6a512-1295-4272-9138-f99709370657
2008-03-29 17:40:04 +00:00
Nicolas Pennequin
732df386af
Boost the audio thread while it's filling the buffer. In the audio and the buffering threads, only cancel cpu boost when not filling.
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16880 a1c6a512-1295-4272-9138-f99709370657
2008-03-29 17:28:30 +00:00
Nicolas Pennequin
4fd277481a
Correct some windows line endings back to unix.
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16877 a1c6a512-1295-4272-9138-f99709370657
2008-03-29 14:09:14 +00:00
Steve Bavin
135cc757bd
Revert my earlier const madness, we'll keep the parameter lists simple.
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16863 a1c6a512-1295-4272-9138-f99709370657
2008-03-28 12:51:33 +00:00
Steve Bavin
c9df8fd87b
The const police raid playback.c, should be no change to behaviour.
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16860 a1c6a512-1295-4272-9138-f99709370657
2008-03-28 11:24:24 +00:00
Steve Bavin
73f9863b1b
More consts that require no functional change.
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16814 a1c6a512-1295-4272-9138-f99709370657
2008-03-26 08:57:25 +00:00
Michael Sevakis
27cf677339
Add a complete priority inheritance implementation to the scheduler (all mutex ownership and queue_send calls are inheritable). Priorities are differential so that dispatch depends on the runnable range of priorities. Codec priority can therefore be raised in small steps (pcmbuf updated to enable). Simplify the kernel functions to ease implementation and use the same kernel.c for both sim and target (I'm tired of maintaining two ;_). 1) Not sure if a minor audio break at first buffering issue will exist on large-sector disks (the main mutex speed issue was genuinely resolved earlier). At this point it's best dealt with at the buffering level. It seems a larger filechunk could be used again. 2) Perhaps 64-bit sims will have some minor issues (finicky) but a backroll of the code of concern there is a 5-minute job. All kernel objects become incompatible so a full rebuild and update is needed.
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16791 a1c6a512-1295-4272-9138-f99709370657
2008-03-25 02:34:12 +00:00
Nicolas Pennequin
483c40285b
Notify the buffering thread when a handle is added, so it can go into filling mode. This is some sort of a replacement for the ATA idle callback. It will interrupt an ongoing buffering process (buffer_handle), but not for long enough to be a problem.
...
Should fix a problem reported by Dave Hooper where inserting tracks into the playlist would flush the buffer and not refill it, sometimes causing the inserted tracks to be skipped.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16295 a1c6a512-1295-4272-9138-f99709370657
2008-02-12 23:15:59 +00:00
Nicolas Pennequin
659fe5a35b
Fix FS#6215 (player crashes after trying to resume deleted music file). As mentioned in the lastest comment, the problem was in trying to resume at an offset larger than the size of the file following the one that was deleted. This revealed a crash in the buffering code, which gets a fix, but we also need to intervene earlier in the track loading so that the track that gets played will be from its start.
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16028 a1c6a512-1295-4272-9138-f99709370657
2008-01-08 23:48:51 +00:00
Nicolas Pennequin
ecec94043d
Check that the pointer isn't NULL before dereferencing it, just to be safe and to allow using bufgetdata to know how much data is available. Also remove a few trailing spaces.
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15940 a1c6a512-1295-4272-9138-f99709370657
2007-12-16 01:38:56 +00:00
Brandon Low
e959c5aa95
Possibly save a few bytes when stripping the tags of the last allocated handle
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15844 a1c6a512-1295-4272-9138-f99709370657
2007-11-28 16:39:58 +00:00
Brandon Low
3386dd7be9
Fix FS8069, because Nico_P made it easy
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15840 a1c6a512-1295-4272-9138-f99709370657
2007-11-28 04:58:16 +00:00
Nicolas Pennequin
774fd19c37
Checking for total free buffer space isn't correct. What we need to check is the space available for the particular handle we want to rebuffer.
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15821 a1c6a512-1295-4272-9138-f99709370657
2007-11-26 23:51:36 +00:00
Nicolas Pennequin
e24454f8b3
Buffering callbacks rework. There is now one callback for all the events that can occur. Callbacks are now registred only once instead of being removed after having been called.
...
Fix FS#8092 by flushing the audio when a rebuffer is needed.
Also add some comments here and there.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15816 a1c6a512-1295-4272-9138-f99709370657
2007-11-26 21:13:08 +00:00
Michael Sevakis
398d9fd8b4
Hopefully the last word on getting rid of yield_codecs loops (cut read chunk to 16kB). Sansa ata driver also didn't yield enough so buffering would starve other threads. Bump priority of audio thread to keep UI more responsive.
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15724 a1c6a512-1295-4272-9138-f99709370657
2007-11-20 22:45:46 +00:00
Michael Sevakis
fadbf0a6f7
Make threads responsible for explicit cancellation of their own boosted status. Sleeping and timeouts will no longer cancel it.
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15709 a1c6a512-1295-4272-9138-f99709370657
2007-11-20 03:44:25 +00:00
Nicolas Pennequin
51923703fd
Make the sim sleep between each file chunk, so that its buffering behaves more like that of a real target.
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15694 a1c6a512-1295-4272-9138-f99709370657
2007-11-19 16:37:55 +00:00
Nicolas Pennequin
87e5b1193c
The error checking for bitmap handling in bufopen was serioulsy broken, as loading a huge bitmap showed. Fix it and reorganise the code slightly.
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15597 a1c6a512-1295-4272-9138-f99709370657
2007-11-12 15:16:41 +00:00
Nicolas Pennequin
5e0e2391ff
Really fix red this time.
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15576 a1c6a512-1295-4272-9138-f99709370657
2007-11-11 13:28:24 +00:00
Nicolas Pennequin
a384fb6d8a
Fix red on the iFP.
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15575 a1c6a512-1295-4272-9138-f99709370657
2007-11-11 13:15:36 +00:00
Nicolas Pennequin
9d4bed7ff0
Album art support. Based on FS#3045, but heavily modified to adapt to MoB and for cleanness.
...
The cover pictures are loaded from external bitmaps. JPEG and embedded art are not supported. The pictures will only be drawn on the main display. There is no resizing but it is possible to specify the WPS bitmap size in the bitmap names (e.g. cover.100x100.bmp).
The bitmaps are stored in the main buffer and read directly from there. Currently, duplicate bitmaps will simply be present several times in the buffer, but this will be improved.
To enable for a target, #define HAVE_ALBUMART in its config file.
For more information, see the wiki page: http://www.rockbox.org/wiki/AlbumArt .
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15572 a1c6a512-1295-4272-9138-f99709370657
2007-11-11 12:29:37 +00:00
Brandon Low
dc0f497a4f
No functional change
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15542 a1c6a512-1295-4272-9138-f99709370657
2007-11-08 18:59:22 +00:00
Nicolas Pennequin
b50473ffd8
Fix a bug introduced by r15533 where end-of-file wouldn't be detected correctly.
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15541 a1c6a512-1295-4272-9138-f99709370657
2007-11-08 18:27:19 +00:00
Nicolas Pennequin
ca4771b40c
Thanks to the changes in prep_bufdata, bufgetdata can be simplified a bit.
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15537 a1c6a512-1295-4272-9138-f99709370657
2007-11-08 16:12:28 +00:00
Brandon Low
551db40abb
Clean up a (nearly impossible) null check. Add a comment.
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15536 a1c6a512-1295-4272-9138-f99709370657
2007-11-08 16:06:24 +00:00
Brandon Low
1db4243379
Change in function should be nearly zero, but change to proper naming and define use and allow a more liberal limit on bufgetdata to only ensure safety of wrapping, not the strict filechunk limit that I tried to impose earlier
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15535 a1c6a512-1295-4272-9138-f99709370657
2007-11-08 15:52:10 +00:00
Brandon Low
6e8ee408bf
Fix some bad where a handle is held across a sleep. We should probably audit this in other places as well.
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15533 a1c6a512-1295-4272-9138-f99709370657
2007-11-08 15:34:23 +00:00
Nicolas Pennequin
f56cb7e09f
Fix the bug where MPC files would be skipped by disabling the check of the requested size against the default filechunk size in prep_bufdata when the caller is bufread.
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15528 a1c6a512-1295-4272-9138-f99709370657
2007-11-08 13:28:13 +00:00
Nicolas Pennequin
71b40994e0
Fix a flaw in prep_bufdata() that would lead to all kinds of problems with codecs that used bufread (MPC is one).
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15501 a1c6a512-1295-4272-9138-f99709370657
2007-11-07 00:39:08 +00:00
Brandon Low
3eed6fc025
Fix thinko in last patch, shouldn't effect current buffering clients.
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15496 a1c6a512-1295-4272-9138-f99709370657
2007-11-06 16:57:07 +00:00
Brandon Low
9821cce484
Pull the size range checking and disk request into a separate function that both bufread and bufgetdata can use. Do better range checking to ensure that we don't get 'stuck' in the calls and warn with a logf if requests are made for which we cannot guarantee satisfaction.
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15495 a1c6a512-1295-4272-9138-f99709370657
2007-11-06 16:49:30 +00:00
Nicolas Pennequin
86b7c2b408
This was (probably) committed by accident, remove it.
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15491 a1c6a512-1295-4272-9138-f99709370657
2007-11-05 23:46:45 +00:00
Brandon Low
7ca056dc13
Don't yield twice in a row
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15490 a1c6a512-1295-4272-9138-f99709370657
2007-11-05 21:48:15 +00:00
Nicolas Pennequin
eac794de77
Types other than packet audio still need to yield while buffering.
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15489 a1c6a512-1295-4272-9138-f99709370657
2007-11-05 21:46:17 +00:00
Nicolas Pennequin
0c7b26d3a7
Readd yield_codec, making it check for useful data through buffer_is_low. Fixes the PCM buffer underruns.
...
Also move update_data_counters and make it static.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15487 a1c6a512-1295-4272-9138-f99709370657
2007-11-05 21:11:54 +00:00
Brandon Low
287f14b8ca
This was a bad change on my part earlier. Do not immediately start buffering codecs when they are bufopened
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15486 a1c6a512-1295-4272-9138-f99709370657
2007-11-05 18:58:50 +00:00
Nicolas Pennequin
6631e36fa7
Fix some logf warnings.
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15483 a1c6a512-1295-4272-9138-f99709370657
2007-11-05 18:19:38 +00:00
Brandon Low
86830b6566
Create two separate ways for a handle buffer request to be sent. One is when the buffer has gotten low, in this case, we want to start a buffer fill. The other is when the buffer itself requests a buffer as part of a running fill. Obviously this is not a new fill start
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15480 a1c6a512-1295-4272-9138-f99709370657
2007-11-05 17:51:55 +00:00
Brandon Low
76f9bfa945
When seeking foward off of the buffer, if it is a short seek don't rebuffer the whole track, just read enough to satisfy
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15479 a1c6a512-1295-4272-9138-f99709370657
2007-11-05 17:50:51 +00:00
Brandon Low
3379440a4b
Remove conf_filechunk, it should never have been a setting and its implementation doesn't do what it claims any way
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15478 a1c6a512-1295-4272-9138-f99709370657
2007-11-05 17:48:21 +00:00
Brandon Low
1df1e7b0c7
Remove unused conf_preseek from buffering.c and all of its accountraments. This is _not_ a setting. This is a guessing tool used by either playback or buffering to serve its clients better. Use the REBUFFER_GUESS size in resume to help obviate pondlife's bug. This will also need to be used when FS8092 gets fixed correctly with a complete rebuffer for backward movements. It may also belong in buffering not playback, haven't decided for sure
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15475 a1c6a512-1295-4272-9138-f99709370657
2007-11-05 16:02:12 +00:00
Brandon Low
560515fba1
Minor improvement in responsiveness to buffer_handle calls
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15473 a1c6a512-1295-4272-9138-f99709370657
2007-11-05 15:47:40 +00:00
Brandon Low
555a764dad
logging improvements
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15472 a1c6a512-1295-4272-9138-f99709370657
2007-11-05 15:24:21 +00:00
Brandon Low
47eb569b62
SHould fix FS#8074, is more better regardless though
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15466 a1c6a512-1295-4272-9138-f99709370657
2007-11-05 03:11:58 +00:00
Brandon Low
d02b5c744e
Don't keep useless id3v2 or other leading tag data on the buffer, it could be large
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15465 a1c6a512-1295-4272-9138-f99709370657
2007-11-05 01:56:12 +00:00
Brandon Low
31c1164c49
make handle_id of zero valid, stop using memsets to clear tracks, should be no functional changes
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15462 a1c6a512-1295-4272-9138-f99709370657
2007-11-04 19:01:02 +00:00
Brandon Low
2ecb3231c6
More residuals from 8077, sanitize chunk and watermark settings
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15452 a1c6a512-1295-4272-9138-f99709370657
2007-11-04 06:01:46 +00:00
Brandon Low
ebc981b233
More residuals from 8077 that should make buffering start up more smoothly and complete more completely
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15451 a1c6a512-1295-4272-9138-f99709370657
2007-11-04 05:57:48 +00:00
Brandon Low
3817acc682
Tweak the way the data_counters are calculated to make it more friendly to the potential read-during-write, probably has very little impact on the compiled code
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15448 a1c6a512-1295-4272-9138-f99709370657
2007-11-04 05:15:41 +00:00
Brandon Low
aabd6885bf
More try to fix 8077, BUF_USED is not a good way to determine if the buffer is healthy any more, we'll need a enw way if we need to resurrect yield_codec later
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15447 a1c6a512-1295-4272-9138-f99709370657
2007-11-04 02:40:24 +00:00
Brandon Low
1c36a660ea
Disable the already spinning optimization until it is written correctly
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15445 a1c6a512-1295-4272-9138-f99709370657
2007-11-04 00:23:22 +00:00
Brandon Low
9784f6b752
Make the use of signed int for buffer handles consistent and handle wrapping better. Number of handle_ids available is unchanged by this.
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15442 a1c6a512-1295-4272-9138-f99709370657
2007-11-03 22:06:56 +00:00
Brandon Low
7b74dd7574
Attempt to fix FS#8077... again
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15441 a1c6a512-1295-4272-9138-f99709370657
2007-11-03 21:57:27 +00:00
Brandon Low
c2e1cc1e39
Revert recent changes that are broken
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15439 a1c6a512-1295-4272-9138-f99709370657
2007-11-03 21:48:08 +00:00
Brandon Low
acb3e9af22
Make handle id semantics more like file id. This may need to be revisited if we ever start storing long lived things on the buffer (if an item lives through 32k other items coming and going, there will be an id collision and things will break)
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15437 a1c6a512-1295-4272-9138-f99709370657
2007-11-03 21:13:15 +00:00
Brandon Low
60d4e7c9c4
Buffering consistency improvements
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15436 a1c6a512-1295-4272-9138-f99709370657
2007-11-03 17:55:45 +00:00
Brandon Low
11a3661d73
Make atomic type work for even first track. Rework low buffer handling... uses a stateful variable because I'm a bitter old man and it works this way
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15425 a1c6a512-1295-4272-9138-f99709370657
2007-11-03 06:21:32 +00:00
Brandon Low
dc58c3d92e
Give lowmem targets or targets with broken ATA implementations more buffering opportunities. Fix part of hcs' long standing SPC bug by filling if the useful data is equal to the watermark as well as less than
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15417 a1c6a512-1295-4272-9138-f99709370657
2007-11-03 03:46:22 +00:00
Brandon Low
a042c720c3
Use a recursive depth-first shrinkage function, limit handles accordingly
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15414 a1c6a512-1295-4272-9138-f99709370657
2007-11-03 02:54:34 +00:00
Nicolas Pennequin
b838a62adf
Make bufread and bufgetdata blocking. They now return when enough data is available or when EOF is reached. This improves the API and removes the need for several duplicate waiting loops.
...
Also fix a few logfqueue messages.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15412 a1c6a512-1295-4272-9138-f99709370657
2007-11-02 19:13:03 +00:00
Brandon Low
dcca586a9b
Improve upon my hackity hack from before by separating audio into two types: that which may be large and can be streamed and that which is small and cannot be streamed. While modifying types, allow codecs to split across the buffer wrap and dig out/move around the code that reads a codec off of the buffer to facilitate that simple sounding change.
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15408 a1c6a512-1295-4272-9138-f99709370657
2007-11-02 14:06:48 +00:00
Brandon Low
ff9cdb464a
Temporary work around for the situation where a single codec request is for more data than a single file_chunk and that file gets stuck. This should be fixed differently as it could lead to unresponsive behavior from the buffering thread for the duration of a file load.
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15390 a1c6a512-1295-4272-9138-f99709370657
2007-11-01 05:12:55 +00:00
Nicolas Pennequin
09bce70f17
Slight rework of the buffering logic:
...
* Don't rely only on ata_disk_is_active, and also do buffer filling after buffer handle requests. Should fix FS#8049.
* Shrink the handles at the last possible moment. This allows more seeking without rebuffering for long tracks and minimises buffer waste.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15377 a1c6a512-1295-4272-9138-f99709370657
2007-10-30 17:24:31 +00:00
Brandon Low
151b7c9038
Further improve the mistakes I made in add_handle (thanks Nico_P for not beating me with them)
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15376 a1c6a512-1295-4272-9138-f99709370657
2007-10-30 15:09:52 +00:00
Nicolas Pennequin
4ff2f9f372
can_add_handle() can be removed, but its logic must remain: before adding a handle, we need to make sure the there'll be space left for the curent one to finish buffering. This should fix the audio dropout problems people were experiencing.
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15374 a1c6a512-1295-4272-9138-f99709370657
2007-10-30 14:11:03 +00:00
Brandon Low
4649eecc79
Fix yellow, not sure how to properly specify this argument's nature so this is fine
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15363 a1c6a512-1295-4272-9138-f99709370657
2007-10-29 17:00:03 +00:00
Brandon Low
483dca99c4
Remove can_add_handle, its safety and benefit are both questionable. Make shrink_buffer a function to reduce code duplication. Change move_handle semantics so that the caller never loses track of the current position of h, even if the move fails.
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15362 a1c6a512-1295-4272-9138-f99709370657
2007-10-29 16:48:16 +00:00
Nicolas Pennequin
d400e23e38
Prefix the error constants with ERR_
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15359 a1c6a512-1295-4272-9138-f99709370657
2007-10-29 14:15:59 +00:00
Brandon Low
4feab10a0c
Improve move_handle's semantics. Shoudl have no functional impact
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15351 a1c6a512-1295-4272-9138-f99709370657
2007-10-28 20:18:59 +00:00
Brandon Low
94b133ad33
Comment improvements
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15350 a1c6a512-1295-4272-9138-f99709370657
2007-10-28 19:19:54 +00:00
Nicolas Pennequin
7807279eaf
Add #defines for error values. Makes the code easier to read.
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15348 a1c6a512-1295-4272-9138-f99709370657
2007-10-28 15:54:10 +00:00
Brandon Low
18c9aba4b4
Hopefully fix codec load and data abort problems by making add_handle and move_handle much better at wrapping the buffer smartly and not putting the wrong things on the wrap
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15330 a1c6a512-1295-4272-9138-f99709370657
2007-10-27 04:49:04 +00:00
Brandon Low
7104ad54d0
Whoops, that thread can't run until the linked list is initialized
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15329 a1c6a512-1295-4272-9138-f99709370657
2007-10-27 04:29:46 +00:00