On Mon, Sep 1, 2008 at 1:24 AM, Magnus Holmgren <[EMAIL PROTECTED]> wrote:
> Joseph Garvin wrote: > > I tried: >> >> struct dsp_config* dsp = (struct dsp_config *)rb->dsp_configure(NULL, >> DSP_MYDSP, >> >> CODEC_IDX_AUDIO); >> rb->dsp_configure(dsp, DSP_SWITCH_FREQUENCY, 22050); >> rb->pcm_set_frequency(22050); >> rb->pcm_apply_settings(); >> >> 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.