[pulseaudio-discuss] [PATCH] alsa-util: No logging when sound card only supports non-interleaved sample format

Raymond Yau superquad.vortex2 at gmail.com
Mon Nov 17 19:34:45 PST 2014


74
2014-11-16 下午8:31 於 "Peter Meerwald" <pmeerw at pmeerw.net> 寫道:
>
>
> > > as suggested by
> > >https://bugs.freedesktop.org/show_bug.cgi?id=84804
> > >
> > > Signed-off-by: Peter Meerwald <pmeerw at pmeerw.net>
> > > ---
> > >  src/modules/alsa/alsa-util.c | 15 +++++++++++++++
> > >  1 file changed, 15 insertions(+)
> > >
> > > diff --git a/src/modules/alsa/alsa-util.c
b/src/modules/alsa/alsa-util.c
> > > index 4131cff..e382d4f 100644
> > > --- a/src/modules/alsa/alsa-util.c
> > > +++ b/src/modules/alsa/alsa-util.c
> > > @@ -183,6 +183,19 @@ static int set_buffer_size(snd_pcm_t *pcm_handle,
> > snd_pcm_hw_params_t *hwparams,
> > >      return 0;
> > >  }
> > >
> > > +static void check_access(snd_pcm_t *pcm_handle, snd_pcm_hw_params_t
> > *hwparams, bool use_mmap) {
> > > +    if ((use_mmap && !snd_pcm_hw_params_test_access(pcm_handle,
> > hwparams, SND_PCM_ACCESS_MMAP_INTERLEAVED)) ||
> > > +        !snd_pcm_hw_params_test_access(pcm_handle, hwparams,
> > SND_PCM_ACCESS_RW_INTERLEAVED))
> > > +        pa_log_error("Weird, PCM claims to support interleaved
access,
> > but snd_pcm_hw_params_set_access() failed.");
> >
> > HW Params of device "hw:0,0":
> > --------------------
> > ACCESS:  MMAP_NONINTERLEAVED RW_NONINTERLEAVED
> > FORMAT:  S32_LE
> > SUBFORMAT:  STD
> > SAMPLE_BITS: 32
> > FRAME_BITS: [448 832]
> > CHANNELS: [14 26]
> > RATE: [32000 96000]
> > PERIOD_TIME: (666 256000]
> > PERIOD_SIZE: [64 8192]
> > PERIOD_BYTES: [3584 851968]
> > PERIODS: 2
> > BUFFER_TIME: (1333 512000]
> > BUFFER_SIZE: [128 16384]
> > BUFFER_BYTES: [7168 1703936]
> > TICK_TIME: ALL
> >
> > if use of test_access is to prevent set_access corrupt the configuration
> > space of hw_param when access is not supported,
>
> I am not sure if I understand your comment correctly
>
> the idea of the patch is to improve the logging in case _INTERLEAVED is
> not supported (but NONINTERLEAVED is)
>
> I don't want to change the current behaviour in the normal case, hence
> check_access() is called after trying to set the access method
>
> what do you means with corruption of config space?
>
If the application did not explicilty set_access

snd_pcm_hw_params()  choose the first supported access from the
configuration space created by snd_pcm_hw_params_any()

this mean that if pulseaudio  use test_access to find the access is
supported and set_access for those two non interleaved access types( i.e.
not set_access for any unsupported access type) the configuration space is
left with mmap non interleaved, non interleaved or complex which are not
supported by pulseaudio

snd_pcm_hw_params() will select first supported access from configuration
space

mmap non interleaved for rme9652

for example,

snd_output_stdio_attach(&log, stderr, 0);
snd_pcm_hw_params_any(pars);
snd_pcm_hw_params_dump(pars, log);
snd_pcm_hw_params(pcm,pars);
snd_pcm_dump(pcm, log)

the first supported access for snd-hda-intel which is mmap interleaved will
be selected when the application did not explicitly set the access type
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/pulseaudio-discuss/attachments/20141118/674de179/attachment.html>


More information about the pulseaudio-discuss mailing list