[pulseaudio-discuss] Problems with pulseaudio / asla on PS3
Lennart Poettering
lennart at poettering.net
Sat Aug 30 16:37:02 PDT 2008
On Sun, 31.08.08 09:10, Kevin Gilbert (kevin952 at tpg.com.au) wrote:
> > It's totally fine to support only NONINTERLEAVED channel setups, but
> > then the alsa driver needs to refuse enabling INTERLEAVED mode,
> > i.e. snd_pcm_hw_params_set_access() must fail -- which it doesn't.
> >
> > The relevant code in PA you find here:
> >
> > http://pulseaudio.org/browser/src/modules/alsa-util.c#L324
>
> OK, I've downloaded the latest PulseAudio source code, upgraded ALSA to the
> latest (Rawhide) bleeding-edge Fedora version. There are some differences in
> the trace but it still fails.
>
> 1) I suspect there may be a problem with the code:
>
> === begin ===
> if (_use_mmap) {
> if ((ret = snd_pcm_hw_params_set_access(pcm_handle, hwparams,
> SND_PCM_ACCESS_MMAP_INTERLEAVED)) < 0) {
>
> /* mmap() didn't work, fall back to interleaved */
>
> if ((ret = snd_pcm_hw_params_set_access(pcm_handle, hwparams,
> SND_PCM_ACCESS_RW_INTERLEAVED)) < 0)
> goto finish;
>
> _use_mmap = FALSE;
> }
>
> } else if ((ret = snd_pcm_hw_params_set_access(pcm_handle, hwparams,
> SND_PCM_ACCESS_RW_INTERLEAVED)) < 0)
> goto finish;
> === end ===
>
> Are the two "< 0" comparisons correct?
Yes. Though I see three "< 0" checks here...
If mmap is enabled (it is by default) we try setting the access mode
to MMAP_INTERLEAVED and if that fails fall back to RW_INTERLEAVED. If
that fails too, we give up and fail. If mmap is disabled we try only
RW_INTERLEAVED.
> 2) There is no file in the PulseAudio source package that has the string
> SNDRV_PCM_INFO_NONINTERLEAVED or even just the word NONINTERLEAVED! Therefore,
> does PulseAudio support devices that use the NONINTERLEAVED mode?
We don't support NONTERLEAVED natively. We rely on ALSA to reformat
the data properly for us. ALSA does this for us when we open it via
the "plughw" device string, which we try to open as last resort if all
the other strings (like "front") don't work.[^1]
Lennart
[1] Which means you won't get surround sound on your machine. We
probably should be opening plug:surround51:0 instead of just
surround51:0.... But that's a different problem.
--
Lennart Poettering Red Hat, Inc.
lennart [at] poettering [dot] net ICQ# 11060553
http://0pointer.net/lennart/ GnuPG 0x1A015CC4
More information about the pulseaudio-discuss
mailing list