%T#13960 Comment added by Bilgus: Add functions for playing tracks in plugins without playlist manipulations

Rockbox via rockbox-sf <[email protected]> Fri, 17 Jul 2026 15:25:22 +0000
Newsgroups gmane.comp.systems.archos.rockbox.sourceforge
Message-ID <[email protected]>
THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.

The following task has a new comment added:

FS#13960 - Add functions for playing tracks in plugins without playlist manipulations
User who did this - Willliam W (Bilgus)

----------
I had patches to do in this in lua at one point but lua is not near quick enough
from the standpoint of feeding the PCM buffer to avoid dropouts while doing literally anything else AND that API has since been changed as well see the patch below
https://gerrit.rockbox.org/r/c/rockbox/+/7244

Thats why lua now uses rb.playlist("start", 0, 0, 0)


Plugins are already capable of accessing and feeding the mixer see the 
Plugin API functions:

    mixer_channel_status(enum pcm_mixer_channel channel);
    mixer_channel_get_buffer(enum pcm_mixer_channel channel,
                                             int *count);
    mixer_channel_calculate_peaks(enum pcm_mixer_channel channel,
                                          struct pcm_peaks *peaks);
    mixer_channel_play_data(enum pcm_mixer_channel channel,
                                    const struct mixer_play_cbs* cbs,
                                    const void *start, size_t size);
    mixer_channel_play_pause(enum pcm_mixer_channel channel, bool play);
    mixer_channel_stop(enum pcm_mixer_channel channel);
    mixer_channel_set_amplitude(enum pcm_mixer_channel channel,
                                        unsigned int amplitude);
    mixer_channel_get_bytes_waiting(enum pcm_mixer_channel channel);
    mixer_channel_set_buffer_hook(enum pcm_mixer_channel channel,
                                          const struct mixer_buffer_cbs* cbs);
    mixer_set_frequency(unsigned int samplerate);
    mixer_get_frequency(void);
    pcmbuf_fade(bool fade, bool in);
    pcmbuf_set_low_latency(bool state);

see rb->mixer_channel_play_data in:
https://github.com/Rockbox/rockbox/blob/master/apps/plugins/midi/midiplay.c#L639
or
https://github.com/Rockbox/rockbox/blob/master/apps/plugins/mikmod/mikmod.c#L816
or
https://github.com/Rockbox/rockbox/blob/master/apps/plugins/mpegplayer/pcm_output.c#L242

----------

More information can be found at the following URL:
https://www.rockbox.org/tracker/task/13960#comment45639

You are receiving this message because you have requested it from the Flyspray bugtracking system.  If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.
-- 
rockbox-sf mailing list
[email protected]
https://lists.haxx.se/mailman/listinfo/rockbox-sf