Rockbox mail archiveSubject: Re: pcm_set_frequency is ignored
Re: pcm_set_frequency is ignored
From: Joseph Garvin <k04jg02_at_gmail.com>
Date: Mon, 1 Sep 2008 08:48:46 -0400
On Mon, Sep 1, 2008 at 1:24 AM, Magnus Holmgren <lear_at_algonet.se> wrote:
> Joseph Garvin wrote:
> I tried:
>> struct dsp_config* dsp = (struct dsp_config *)rb->dsp_configure(NULL,
>> rb->dsp_configure(dsp, DSP_SWITCH_FREQUENCY, 22050);
>> But this still had no effect, at least in the simulator. Do I need to use
>> dsp_process somehow? It's unclear to me how it works. I'm still playing the
>> sound with pcm_play_data.
> Ah, yes. pcm_play_data is a low-level interface, which is only capable of
> playing what the hardware supports. dsp.c can be used to do the conversions
> needed, as well as some other audio processing (like the equalizer). As this
> is "apps" code, the DSP works fine in the simulator.
> By the way, from what I can tell, on Sansas (and most PortalPlayer
> targets), the frequency argument in pcm_set_frequency is ignored.
Ah, OK. So I'm guessing I need to make a buffer, and give pcm_play_data a
callback that will use dsp_process to fill that buffer (I'm assuming
dsp_process's output is sound converted to the player's preferred
frequency, channels, etc. and that you use dsp_configure to let it know the
format of the input). I'll give that a try.
Received on 2008-09-01