summaryrefslogtreecommitdiff
path: root/apps/buffering.c (follow)
Commit message (Collapse)AuthorAge
* Hopefully the last word on getting rid of yield_codecs loops (cut read chunk ↵Michael Sevakis2007-11-20
| | | | | | 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
* Make threads responsible for explicit cancellation of their own boosted ↵Michael Sevakis2007-11-20
| | | | | | status. Sleeping and timeouts will no longer cancel it. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15709 a1c6a512-1295-4272-9138-f99709370657
* Make the sim sleep between each file chunk, so that its buffering behaves ↵Nicolas Pennequin2007-11-19
| | | | | | more like that of a real target. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15694 a1c6a512-1295-4272-9138-f99709370657
* The error checking for bitmap handling in bufopen was serioulsy broken, as ↵Nicolas Pennequin2007-11-12
| | | | | | 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
* Really fix red this time.Nicolas Pennequin2007-11-11
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15576 a1c6a512-1295-4272-9138-f99709370657
* Fix red on the iFP.Nicolas Pennequin2007-11-11
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15575 a1c6a512-1295-4272-9138-f99709370657
* Album art support. Based on FS#3045, but heavily modified to adapt to MoB ↵Nicolas Pennequin2007-11-11
| | | | | | | | | | | | 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
* No functional changeBrandon Low2007-11-08
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15542 a1c6a512-1295-4272-9138-f99709370657
* Fix a bug introduced by r15533 where end-of-file wouldn't be detected correctly.Nicolas Pennequin2007-11-08
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15541 a1c6a512-1295-4272-9138-f99709370657
* Thanks to the changes in prep_bufdata, bufgetdata can be simplified a bit.Nicolas Pennequin2007-11-08
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15537 a1c6a512-1295-4272-9138-f99709370657
* Clean up a (nearly impossible) null check. Add a comment.Brandon Low2007-11-08
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15536 a1c6a512-1295-4272-9138-f99709370657
* Change in function should be nearly zero, but change to proper naming and ↵Brandon Low2007-11-08
| | | | | | 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
* Fix some bad where a handle is held across a sleep. We should probably ↵Brandon Low2007-11-08
| | | | | | audit this in other places as well. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15533 a1c6a512-1295-4272-9138-f99709370657
* Fix the bug where MPC files would be skipped by disabling the check of the ↵Nicolas Pennequin2007-11-08
| | | | | | 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
* Fix a flaw in prep_bufdata() that would lead to all kinds of problems with ↵Nicolas Pennequin2007-11-07
| | | | | | codecs that used bufread (MPC is one). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15501 a1c6a512-1295-4272-9138-f99709370657
* Fix thinko in last patch, shouldn't effect current buffering clients.Brandon Low2007-11-06
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15496 a1c6a512-1295-4272-9138-f99709370657
* Pull the size range checking and disk request into a separate function that ↵Brandon Low2007-11-06
| | | | | | 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
* This was (probably) committed by accident, remove it.Nicolas Pennequin2007-11-05
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15491 a1c6a512-1295-4272-9138-f99709370657
* Don't yield twice in a rowBrandon Low2007-11-05
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15490 a1c6a512-1295-4272-9138-f99709370657
* Types other than packet audio still need to yield while buffering.Nicolas Pennequin2007-11-05
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15489 a1c6a512-1295-4272-9138-f99709370657
* Readd yield_codec, making it check for useful data through buffer_is_low. ↵Nicolas Pennequin2007-11-05
| | | | | | | | 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
* This was a bad change on my part earlier. Do not immediately start ↵Brandon Low2007-11-05
| | | | | | buffering codecs when they are bufopened git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15486 a1c6a512-1295-4272-9138-f99709370657
* Fix some logf warnings.Nicolas Pennequin2007-11-05
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15483 a1c6a512-1295-4272-9138-f99709370657
* Create two separate ways for a handle buffer request to be sent. One is ↵Brandon Low2007-11-05
| | | | | | 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
* When seeking foward off of the buffer, if it is a short seek don't rebuffer ↵Brandon Low2007-11-05
| | | | | | the whole track, just read enough to satisfy git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15479 a1c6a512-1295-4272-9138-f99709370657
* Remove conf_filechunk, it should never have been a setting and its ↵Brandon Low2007-11-05
| | | | | | implementation doesn't do what it claims any way git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15478 a1c6a512-1295-4272-9138-f99709370657
* Remove unused conf_preseek from buffering.c and all of its accountraments. ↵Brandon Low2007-11-05
| | | | | | 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
* Minor improvement in responsiveness to buffer_handle callsBrandon Low2007-11-05
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15473 a1c6a512-1295-4272-9138-f99709370657
* logging improvementsBrandon Low2007-11-05
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15472 a1c6a512-1295-4272-9138-f99709370657
* SHould fix FS#8074, is more better regardless thoughBrandon Low2007-11-05
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15466 a1c6a512-1295-4272-9138-f99709370657
* Don't keep useless id3v2 or other leading tag data on the buffer, it could ↵Brandon Low2007-11-05
| | | | | | be large git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15465 a1c6a512-1295-4272-9138-f99709370657
* make handle_id of zero valid, stop using memsets to clear tracks, should be ↵Brandon Low2007-11-04
| | | | | | no functional changes git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15462 a1c6a512-1295-4272-9138-f99709370657
* More residuals from 8077, sanitize chunk and watermark settingsBrandon Low2007-11-04
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15452 a1c6a512-1295-4272-9138-f99709370657
* More residuals from 8077 that should make buffering start up more smoothly ↵Brandon Low2007-11-04
| | | | | | and complete more completely git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15451 a1c6a512-1295-4272-9138-f99709370657
* Tweak the way the data_counters are calculated to make it more friendly to ↵Brandon Low2007-11-04
| | | | | | 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
* More try to fix 8077, BUF_USED is not a good way to determine if the buffer ↵Brandon Low2007-11-04
| | | | | | 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
* Disable the already spinning optimization until it is written correctlyBrandon Low2007-11-04
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15445 a1c6a512-1295-4272-9138-f99709370657
* Make the use of signed int for buffer handles consistent and handle wrapping ↵Brandon Low2007-11-03
| | | | | | 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
* Attempt to fix FS#8077... againBrandon Low2007-11-03
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15441 a1c6a512-1295-4272-9138-f99709370657
* Revert recent changes that are brokenBrandon Low2007-11-03
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15439 a1c6a512-1295-4272-9138-f99709370657
* Make handle id semantics more like file id. This may need to be revisited ↵Brandon Low2007-11-03
| | | | | | 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
* Buffering consistency improvementsBrandon Low2007-11-03
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15436 a1c6a512-1295-4272-9138-f99709370657
* Make atomic type work for even first track. Rework low buffer handling... ↵Brandon Low2007-11-03
| | | | | | 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
* Give lowmem targets or targets with broken ATA implementations more ↵Brandon Low2007-11-03
| | | | | | 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
* Use a recursive depth-first shrinkage function, limit handles accordinglyBrandon Low2007-11-03
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15414 a1c6a512-1295-4272-9138-f99709370657
* Make bufread and bufgetdata blocking. They now return when enough data is ↵Nicolas Pennequin2007-11-02
| | | | | | | | 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
* Improve upon my hackity hack from before by separating audio into two types: ↵Brandon Low2007-11-02
| | | | | | 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
* Temporary work around for the situation where a single codec request is for ↵Brandon Low2007-11-01
| | | | | | 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
* Slight rework of the buffering logic:Nicolas Pennequin2007-10-30
| | | | | | | * 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
* Further improve the mistakes I made in add_handle (thanks Nico_P for not ↵Brandon Low2007-10-30
| | | | | | beating me with them) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15376 a1c6a512-1295-4272-9138-f99709370657