<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rockbox/apps/buffering.c, branch duke3d</title>
<subtitle>My Rockbox tree</subtitle>
<link rel='alternate' type='text/html' href='https://www.franklinwei.com/cgit/rockbox/'/>
<entry>
<title>Buffering: Missed converting one case assuming const handle size.</title>
<updated>2017-12-19T19:19:39+00:00</updated>
<author>
<name>Michael Sevakis</name>
<email>jethead71@rockbox.org</email>
</author>
<published>2017-12-19T18:48:14+00:00</published>
<link rel='alternate' type='text/html' href='https://www.franklinwei.com/cgit/rockbox/commit/?id=d35a18f6b4f6b0871cf5369fa9bc2d6ea990fa82'/>
<id>d35a18f6b4f6b0871cf5369fa9bc2d6ea990fa82</id>
<content type='text'>
Must now be h-&gt;size, not sizeof (type).

Change-Id: Ia0b1b552a486ddbc28b80542cfa76bed9e7cfdb3
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Must now be h-&gt;size, not sizeof (type).

Change-Id: Ia0b1b552a486ddbc28b80542cfa76bed9e7cfdb3
</pre>
</div>
</content>
</entry>
<entry>
<title>Buffering: Get rid of disabled code I have no intention of using</title>
<updated>2017-12-17T23:49:24+00:00</updated>
<author>
<name>Michael Sevakis</name>
<email>jethead71@rockbox.org</email>
</author>
<published>2017-12-17T23:49:24+00:00</published>
<link rel='alternate' type='text/html' href='https://www.franklinwei.com/cgit/rockbox/commit/?id=786fbbfa20e106f9d19607d841e74116ee2b608a'/>
<id>786fbbfa20e106f9d19607d841e74116ee2b608a</id>
<content type='text'>
Change-Id: I0e5a20e042291180391b0b0059e44705c256d3e5
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Change-Id: I0e5a20e042291180391b0b0059e44705c256d3e5
</pre>
</div>
</content>
</entry>
<entry>
<title>Get rid of useless playlist probing and fix up some data types.</title>
<updated>2017-12-17T21:33:50+00:00</updated>
<author>
<name>Michael Sevakis</name>
<email>jethead71@rockbox.org</email>
</author>
<published>2017-12-17T21:12:10+00:00</published>
<link rel='alternate' type='text/html' href='https://www.franklinwei.com/cgit/rockbox/commit/?id=dfff938dff089667038041fcb66262c87c3186c2'/>
<id>dfff938dff089667038041fcb66262c87c3186c2</id>
<content type='text'>
Playback checked the files' presence before attempting to buffer
the track. Just get rid of that and save an extra open/close call.
It will find out if the path is bad when the metadata fails.

Fix some size_t/off_t conflation. No need to update plugin version
because no plugin actually uses bufopen().

Change-Id: I3db112449dc0b2eeb91c546f308880ac82494fc7
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Playback checked the files' presence before attempting to buffer
the track. Just get rid of that and save an extra open/close call.
It will find out if the path is bad when the metadata fails.

Fix some size_t/off_t conflation. No need to update plugin version
because no plugin actually uses bufopen().

Change-Id: I3db112449dc0b2eeb91c546f308880ac82494fc7
</pre>
</div>
</content>
</entry>
<entry>
<title>Buffering: Remove statically-sized path buffer from handle struct</title>
<updated>2017-12-10T19:51:43+00:00</updated>
<author>
<name>Michael Sevakis</name>
<email>jethead71@rockbox.org</email>
</author>
<published>2017-12-09T14:41:34+00:00</published>
<link rel='alternate' type='text/html' href='https://www.franklinwei.com/cgit/rockbox/commit/?id=cd3ea086ec3db709c6682d85f8a97b96646cbb4f'/>
<id>cd3ea086ec3db709c6682d85f8a97b96646cbb4f</id>
<content type='text'>
Paths are stored after the structure at their actual length plus
any aligment padding. In principle, any type of auxilliary data
could go there.

Change-Id: Ic5487dc4089781b5cc52414d1691ba6d9dc1893c
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Paths are stored after the structure at their actual length plus
any aligment padding. In principle, any type of auxilliary data
could go there.

Change-Id: Ic5487dc4089781b5cc52414d1691ba6d9dc1893c
</pre>
</div>
</content>
</entry>
<entry>
<title>buffering.c: Fix oopses with caching handle pointer</title>
<updated>2017-12-10T04:45:53+00:00</updated>
<author>
<name>Michael Sevakis</name>
<email>jethead71@rockbox.org</email>
</author>
<published>2017-12-10T04:26:05+00:00</published>
<link rel='alternate' type='text/html' href='https://www.franklinwei.com/cgit/rockbox/commit/?id=6ee3b6feeea0430e153f0c8851c8c52d345b6fbc'/>
<id>6ee3b6feeea0430e153f0c8851c8c52d345b6fbc</id>
<content type='text'>
The location of the handle cannot be kept across calls to
shrink_handle() since it may move the structure. The error was
there in one place at the inception, corrected, then reintroduced.

Make shrink_handle() return the new location and use it, which
makes the side effects of the function clearer.

Change-Id: Icae6a0ad6f7bb0d6645b044cccfa4aef88db42ad
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The location of the handle cannot be kept across calls to
shrink_handle() since it may move the structure. The error was
there in one place at the inception, corrected, then reintroduced.

Make shrink_handle() return the new location and use it, which
makes the side effects of the function clearer.

Change-Id: Icae6a0ad6f7bb0d6645b044cccfa4aef88db42ad
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove recursion from shrink_buffer()</title>
<updated>2017-12-10T02:57:01+00:00</updated>
<author>
<name>Michael Sevakis</name>
<email>jethead71@rockbox.org</email>
</author>
<published>2017-12-10T02:57:01+00:00</published>
<link rel='alternate' type='text/html' href='https://www.franklinwei.com/cgit/rockbox/commit/?id=8be40746b81c4fde8f990c13f1359ebbc88d048f'/>
<id>8be40746b81c4fde8f990c13f1359ebbc88d048f</id>
<content type='text'>
There's no need for it any longer since the list is now doubly-
linked. As a bonus, stack limits pose no barrier to the length of
the list.

Change-Id: I41c567f946b640ef1e3c2d93da2f5aef9a763c66
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There's no need for it any longer since the list is now doubly-
linked. As a bonus, stack limits pose no barrier to the length of
the list.

Change-Id: I41c567f946b640ef1e3c2d93da2f5aef9a763c66
</pre>
</div>
</content>
</entry>
<entry>
<title>Playback: Move internal track list onto buffer</title>
<updated>2017-12-09T22:05:59+00:00</updated>
<author>
<name>Michael Sevakis</name>
<email>jethead71@rockbox.org</email>
</author>
<published>2017-12-08T18:01:25+00:00</published>
<link rel='alternate' type='text/html' href='https://www.franklinwei.com/cgit/rockbox/commit/?id=c1a01beded5103df32ea2e3ec596e80de740cf2e'/>
<id>c1a01beded5103df32ea2e3ec596e80de740cf2e</id>
<content type='text'>
Does away the statically-allocated track list which frees quite
a fair amount of in-RAM size.

There's no compile-time hard track limit.

Recommended TODO (but not right away): Have data small enough use
the handle structure as its buffer data area. Almost the entire
handle structure is unused for simple allocations without any
associated filesystem path.

Change-Id: I74a4561e5a837e049811ac421722ec00dadc0d50
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Does away the statically-allocated track list which frees quite
a fair amount of in-RAM size.

There's no compile-time hard track limit.

Recommended TODO (but not right away): Have data small enough use
the handle structure as its buffer data area. Almost the entire
handle structure is unused for simple allocations without any
associated filesystem path.

Change-Id: I74a4561e5a837e049811ac421722ec00dadc0d50
</pre>
</div>
</content>
</entry>
<entry>
<title>Buffering: Switch to a more general handle caching type</title>
<updated>2017-05-08T10:24:02+00:00</updated>
<author>
<name>Michael Sevakis</name>
<email>jethead71@rockbox.org</email>
</author>
<published>2017-04-13T22:53:17+00:00</published>
<link rel='alternate' type='text/html' href='https://www.franklinwei.com/cgit/rockbox/commit/?id=65c6a14e5fa41906176f93aa04512508e719d970'/>
<id>65c6a14e5fa41906176f93aa04512508e719d970</id>
<content type='text'>
It sort of implemented an MRU cache but just kept track of the most
recent access and checked the one after it, otherwise searching from
the beginning.

Implement a true MRU list of all open handles. Handles of the current
track will tend to stay up front for faster access.

Switch to common linked list functions

Use double-linked lists to have insert, remove and move_handle
operations in O(1)-- no more searching to find the previous handle,
which is very often required.

Smaller code too. :)

Change-Id: I9ae8f3f96d225a5d54b94133f499268007274784
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It sort of implemented an MRU cache but just kept track of the most
recent access and checked the one after it, otherwise searching from
the beginning.

Implement a true MRU list of all open handles. Handles of the current
track will tend to stay up front for faster access.

Switch to common linked list functions

Use double-linked lists to have insert, remove and move_handle
operations in O(1)-- no more searching to find the previous handle,
which is very often required.

Smaller code too. :)

Change-Id: I9ae8f3f96d225a5d54b94133f499268007274784
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix some problems with playback crashing</title>
<updated>2017-04-08T22:32:54+00:00</updated>
<author>
<name>Michael Sevakis</name>
<email>jethead71@rockbox.org</email>
</author>
<published>2017-04-08T22:11:25+00:00</published>
<link rel='alternate' type='text/html' href='https://www.franklinwei.com/cgit/rockbox/commit/?id=eefc7c73e2495decdc6f242515696fe0e3f85609'/>
<id>eefc7c73e2495decdc6f242515696fe0e3f85609</id>
<content type='text'>
I'm not sure all the situations it affects, to be honest. The fix
aimed to address the strange symptom here:
http://forums.rockbox.org/index.php/topic,50793.0.html

It turns out that ringbuf_add_cross was used when handles were
butted up against one another with the first parameter equal to
the last, which it interprets as being an empty case when it should
be interpreted as full in the context it was used. To fix this,
introduce full/empty variants of ringbuf_add_cross and ringbuf_sub
and use them at the appropriate time.

The other way to address the problem is ensure there's always at
least a space byte between the end of one handle and the start of
another but this make the code a bit trickier to reason about than
using additional function variants.

bufopen() may yield after creating a handle and so do some more
locking so that the buffering thread doesn't mess things up by
moving anything or not seeing the yet-to-be linked-in allocation.

Add alignof() macro to use proper method to get alignment of
struct memory_handle. That should be useful in general anyway.
It's merely defined as __alignof__ but looks nicer.

Change-Id: If21739eaa33a4f6c084a28ee5b3c8fceecfd87ce
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
I'm not sure all the situations it affects, to be honest. The fix
aimed to address the strange symptom here:
http://forums.rockbox.org/index.php/topic,50793.0.html

It turns out that ringbuf_add_cross was used when handles were
butted up against one another with the first parameter equal to
the last, which it interprets as being an empty case when it should
be interpreted as full in the context it was used. To fix this,
introduce full/empty variants of ringbuf_add_cross and ringbuf_sub
and use them at the appropriate time.

The other way to address the problem is ensure there's always at
least a space byte between the end of one handle and the start of
another but this make the code a bit trickier to reason about than
using additional function variants.

bufopen() may yield after creating a handle and so do some more
locking so that the buffering thread doesn't mess things up by
moving anything or not seeing the yet-to-be linked-in allocation.

Add alignof() macro to use proper method to get alignment of
struct memory_handle. That should be useful in general anyway.
It's merely defined as __alignof__ but looks nicer.

Change-Id: If21739eaa33a4f6c084a28ee5b3c8fceecfd87ce
</pre>
</div>
</content>
</entry>
<entry>
<title>Cleanup unused function</title>
<updated>2016-04-04T09:06:29+00:00</updated>
<author>
<name>Mihail Zenkov</name>
<email>mihail.zenkov@gmail.com</email>
</author>
<published>2014-10-02T11:27:46+00:00</published>
<link rel='alternate' type='text/html' href='https://www.franklinwei.com/cgit/rockbox/commit/?id=47d6d268c031dacb60929a21f6cceb09400c5e46'/>
<id>47d6d268c031dacb60929a21f6cceb09400c5e46</id>
<content type='text'>
Change-Id: I10aac94906607a74f05a687cb3d0029cb6faea6e
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Change-Id: I10aac94906607a74f05a687cb3d0029cb6faea6e
</pre>
</div>
</content>
</entry>
</feed>
