I suppose I'll share just a little bit more on this, without getting
more than knee deep into implementation.

Involving a ringbuffer in the crossfading output is something I am
trying to avoid. (There is a comparable-to-a-ringbuffer-buffer can be
used for say, the sound you would get if you say clicked next 10 times
in a row since there would then perhaps be some overlaps)

How is it avoided? xmms_output_peek (It exists in my tree..) those
familar with xmms_output_read, I think you can already imagine how
this works.

The output plugin can then keep a buffer on hand, so when a seek
happens for example, crossfading begins with zero delay.

How does the output plugin know about seek or track change events? The
callback based outputs already use a signal method from the output to
be notified if they should be reading the output buffer or not.. I
hijacked this method to also send seek and track change notifications.

If you want to know more please see libfaded (now used in my
crossfading jack output plugin version 2.0alpha)

https://github.com/oneman/libfaded/blob/master/libfaded.c

and https://github.com/oneman/xmms2-oneman/blob/oneman/src/plugins/jack/jack.c

If you actually want to test this, you need to pump up your output
buffer to say 150000, and run jack with 1024 frame period, currently
this alpha code uses hardcoded values as such.



-David

On Tue, Jan 4, 2011 at 10:27 AM, David Richards <[email protected]> wrote:
> Good amount of response from the crossfading apocalypse, opinions on
> the matter were like assholes, everyone had one and most of them
> stunk. One has said even puzzles rode his horse back to irc in
> response to the matter.
>
> Anyways, most folk did not want to talk about implementation detail,
> but expressed that it certainly must be a plugin. Ok, lets have it be
> a plugin then. Here is what I know from implementing it as a plugin.
>
> It doesn't belong in the input layer, where 'effects' are, ie, pre
> output buffer. Even though fading is effecting sound, its so tightly
> coupled to seek/pause etc operations that if its put in the input
> layer, then your talking maximum complexity
> and also DELAY, both are unacceptable trade-offs to me. No one but me
> and my invisible friend want it in the core, so what we are talking
> about here is chained output. A new output type is created called
> crossfade, and then a parameter of that
> is what output to pass it along to. This would require a few things.
> One, for non-callback based outputs the crossfading output would need
> a writer thread in it, and for callback based output we would need to
> add a parameter to those to tell them what function to call in order
> to read the output buffer.  Perhaps another use of advancing output a
> little more would be a multi-output plugin that would let you say, use
> jack, diskwriter and ices at the same time...
>
> Comments ?
>
> -David
>
> ps. To those offended by my curses and such, please be aware I've put
> a stupid amount of time and effort into xmms2 because I love it, and
> next to that probably most people interested in it, cursing is just
> another hobby of mine :D
>
> pss. I actually have working code if anyone is interested in such things...
>

--
_______________________________________________
Xmms2-devel mailing list
[email protected]
http://lists.xmms.se/cgi-bin/mailman/listinfo/xmms2-devel

Reply via email to