dev builds
themes manual
device status forums
mailing lists
IRC bugs
dev guide

Rockbox mail archive

Subject: Re: IRAM patch and swapping codecs

Re: IRAM patch and swapping codecs

From: Steve B <>
Date: Thu, 9 Nov 2006 07:37:41 -0000

Hi Tomasz

I'm no expert on the IRAM stuff, but no objection here.

> > The second thing is codec swapping. Do we really need two codec
> > buffers with voice turned on and one without the voice? With voice
> > turned off we do not need a buffer, with voice turned on one buffer
> > for the codec that is not in use is enough?
> This is something that needs addressing for sure. I left things alone for
> the moment until I was sure there'd be no way a swap could be attempted on
> any codecs with no buffer available to use. I find it not entirely trivial
> to determine. I've been told there is a patch to just exchange the codecs
> using a single buffer.

A single buffer would be an improvement. All we need is a suitably
optimised memswap() call. Even better, would be a removal of the swapping
and corresponding mutex.

> I'm not sure that a voice thread is even necessary frankly. The voice
> thread can't possibly be doing anything but waiting for the mutex during
> playback (codec thread already owns it when an encoder is loaded) so it
> be handled elsewhere. Seems the codec thread could handle it during stop
> and a swap could be single thread and the playback engine could be
> simplified. Tell if I'm wrong, please.

Not sure I totally understand this either, but bear in mind that the voice
output should work at all times - whether music is playing, stopped or
paused (something that is currently broken). My (uninformed) gut feeling is
that the voice thread is needed, but should be able to feed PCM data to the
output entirely freely and without interacting with the codec thread - i.e
they should be peers, with no swapping/mutex/swap buffers required.

Steve B
Received on 2006-11-09

Page template was last modified "Tue Sep 7 00:00:02 2021" The Rockbox Crew -- Privacy Policy