alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* buffer_size return by snd_pcm_hw_params_get_buffer_size_max
@ 2011-04-04  3:54 Raymond Yau
  2011-04-04 11:01 ` Takashi Iwai
  0 siblings, 1 reply; 3+ messages in thread
From: Raymond Yau @ 2011-04-04  3:54 UTC (permalink / raw)
  To: ALSA Development Mailing List

it seem that the value return by snd_pcm_hw_params_get_buffer_size_max()
depend on /proc/asound/Intel/pcm0p/sub0/prealloc

Is it a bug in alsa-lib or snd-hda-intel driver

refer to pulseaudio/src/modules/alsa/alsa-util.c

       if ((ret = snd_pcm_hw_params_get_buffer_size_max(hwparams,
&max_frames)) < 0)
            pa_log_warn("snd_pcm_hw_params_get_buffer_size_max() failed:
%s", pa_alsa_strerror(ret));
        else
            pa_log_debug("Maximum hw buffer size is %lu ms", (long unsigned)
(max_frames * PA_MSEC_PER_SEC / _ss.rate));



cat /proc/asound/Intel/pcm0p/sub0/prealloc
64

D: alsa-util.c: Checking for superset analog-stereo (front:%f)
D: alsa-util.c: Trying front:1 with SND_PCM_NO_AUTO_FORMAT ...
D: alsa-util.c: Managed to open front:1
I: alsa-util.c: Trying to disable ALSA period wakeups, using timers only
D: alsa-util.c: Maximum hw buffer size is 371 ms
D: alsa-util.c: Set buffer size first (to 88200 samples), period size second
(to 88200 samples).
I: alsa-util.c: ALSA period wakeups disabled
I: alsa-source.c: Successfully opened device front:1.
I: alsa-source.c: Selected mapping 'Analog Stereo' (analog-stereo).
I: alsa-source.c: Successfully enabled mmap() mode.
I: alsa-source.c: Successfully enabled timer-based scheduling mode.


echo 32768 > /proc/asound/Intel/pcm0p/sub0/prealloc


D: alsa-util.c: Checking for superset analog-stereo (front:%f)
D: alsa-util.c: Trying front:1 with SND_PCM_NO_AUTO_FORMAT ...
D: alsa-util.c: Managed to open front:1
I: alsa-util.c: Trying to disable ALSA period wakeups, using timers only
D: alsa-util.c: Maximum hw buffer size is 190217 ms
D: alsa-util.c: Set buffer size first (to 88200 samples), period size second
(to 88200 samples).
I: alsa-util.c: ALSA period wakeups disabled
I: alsa-sink.c: Successfully opened device front:1.
I: alsa-sink.c: Selected mapping 'Analog Stereo' (analog-stereo).
I: alsa-sink.c: Successfully enabled mmap() mode.
I: alsa-sink.c: Successfully enabled timer-based scheduling mode.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: buffer_size return by snd_pcm_hw_params_get_buffer_size_max
  2011-04-04  3:54 buffer_size return by snd_pcm_hw_params_get_buffer_size_max Raymond Yau
@ 2011-04-04 11:01 ` Takashi Iwai
  2011-05-08 13:49   ` Raymond Yau
  0 siblings, 1 reply; 3+ messages in thread
From: Takashi Iwai @ 2011-04-04 11:01 UTC (permalink / raw)
  To: Raymond Yau; +Cc: ALSA Development Mailing List

At Mon, 4 Apr 2011 11:54:45 +0800,
Raymond Yau wrote:
> 
> it seem that the value return by snd_pcm_hw_params_get_buffer_size_max()
> depend on /proc/asound/Intel/pcm0p/sub0/prealloc
> 
> Is it a bug in alsa-lib or snd-hda-intel driver

No bug.  This is the designed behavior.


Takashi

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: buffer_size return by snd_pcm_hw_params_get_buffer_size_max
  2011-04-04 11:01 ` Takashi Iwai
@ 2011-05-08 13:49   ` Raymond Yau
  0 siblings, 0 replies; 3+ messages in thread
From: Raymond Yau @ 2011-05-08 13:49 UTC (permalink / raw)
  To: Takashi Iwai, ALSA Development Mailing List

2011/4/4 Takashi Iwai <tiwai@suse.de>

> At Mon, 4 Apr 2011 11:54:45 +0800,
> Raymond Yau wrote:
> >
> > it seem that the value return by snd_pcm_hw_params_get_buffer_size_max()
> > depend on /proc/asound/Intel/pcm0p/sub0/prealloc
> >
> > Is it a bug in alsa-lib or snd-hda-intel driver
>
> No bug.  This is the designed behavior.
>
>
> Takashi
>

This explain why my hda-intel fail in tsched=0 but work quite well in
tsched=1



I: module-suspend-on-idle.c: Sink alsa_output.1.analog-stereo idle for too
long, suspending ...
D: sink.c: Suspend cause of sink alsa_output.1.analog-stereo is 0x0004,
suspending
E: alsa-util.c: snd_pcm_dump():
E: alsa-util.c: Soft volume PCM
E: alsa-util.c: Control: PCM Playback Volume
E: alsa-util.c: min_dB: -51
E: alsa-util.c: max_dB: 0
E: alsa-util.c: resolution: 256
E: alsa-util.c: Its setup is:
E: alsa-util.c:   stream       : PLAYBACK
E: alsa-util.c:   access       : MMAP_INTERLEAVED
E: alsa-util.c:   format       : S16_LE
E: alsa-util.c:   subformat    : STD
E: alsa-util.c:   channels     : 2
E: alsa-util.c:   rate         : 44100
E: alsa-util.c:   exact rate   : 44100 (44100/1)
E: alsa-util.c:   msbits       : 16
E: alsa-util.c:   buffer_size  : 16384
E: alsa-util.c:   period_size  : 8192
E: alsa-util.c:   period_time  : 185759
E: alsa-util.c:   tstamp_mode  : ENABLE
E: alsa-util.c:   period_step  : 1
E: alsa-util.c:   avail_min    : 8192
E: alsa-util.c:   period_event : 1
E: alsa-util.c:   start_threshold  : -1
E: alsa-util.c:   stop_threshold   : 1073741824
E: alsa-util.c:   silence_threshold: 0
E: alsa-util.c:   silence_size : 0
E: alsa-util.c:   boundary     : 1073741824
E: alsa-util.c: Slave: Hardware PCM card 1 'HDA Intel' device 0 subdevice 0
E: alsa-util.c: Its setup is:
E: alsa-util.c:   stream       : PLAYBACK
E: alsa-util.c:   access       : MMAP_INTERLEAVED
E: alsa-util.c:   format       : S16_LE
E: alsa-util.c:   subformat    : STD
E: alsa-util.c:   channels     : 2
E: alsa-util.c:   rate         : 44100
E: alsa-util.c:   exact rate   : 44100 (44100/1)
E: alsa-util.c:   msbits       : 16
E: alsa-util.c:   buffer_size  : 16384
E: alsa-util.c:   period_size  : 8192
E: alsa-util.c:   period_time  : 185759
E: alsa-util.c:   tstamp_mode  : ENABLE
E: alsa-util.c:   period_step  : 1
E: alsa-util.c:   avail_min    : 8192
E: alsa-util.c:   period_event : 1
E: alsa-util.c:   start_threshold  : -1
E: alsa-util.c:   stop_threshold   : 1073741824
E: alsa-util.c:   silence_threshold: 0
E: alsa-util.c:   silence_size : 0
E: alsa-util.c:   boundary     : 1073741824
E: alsa-util.c:   appl_ptr     : 163888
E: alsa-util.c:   hw_ptr       : 227328
I: alsa-sink.c: Underrun!
I: alsa-sink.c: Device suspended...
I: module-suspend-on-idle.c: Sink alsa_output.0.analog-stereo idle for too
long, suspending ...
D: sink.c: Suspend cause of sink alsa_output.0.analog-stereo is 0x0004,
suspending
I: alsa-sink.c: Device suspended...

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-05-08 13:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-04  3:54 buffer_size return by snd_pcm_hw_params_get_buffer_size_max Raymond Yau
2011-04-04 11:01 ` Takashi Iwai
2011-05-08 13:49   ` Raymond Yau

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).