At Thu, 23 Jan 2014 16:21:39 +0000, LANGLOIS Olivier PIS -EXT wrote:
As small unrelated sidenote,
If I let aplay choose the hw params itself, how comes it ends up with 16 periods when it calculates the period time to have 4 periods?
How 4 periods come up...? period_time = period_size / rate.
Takashi
If noone knows, I guess that I'll need to reactivate the REFINE_DEBUGs to figure out...
-----Original Message----- From: alsa-devel-bounces@alsa-project.org [mailto:alsa-devel- bounces@alsa-project.org] On Behalf Of LANGLOIS Olivier PIS -EXT Sent: Thursday, January 23, 2014 11:15 AM To: Takashi Iwai; Olivier Langlois Cc: alsa-devel@alsa-project.org; linux-wireless@vger.kernel.org; James Cameron; daniel@zonque.org Subject: Re: [alsa-devel] [ISSUE] rtl8192ce appears to interfere with ALSA playback
Takashi,
- I was expecting to see XRUN entries in dmesg but I didn't. The
closest that I have is [ 1700.756017] PCM: Lost interrupts? [Q] (stream=0, delta=16108, new_hw_ptr=383756, old_hw_ptr=367648) 3. I didn't realise that the default ALSA device was a plugin using dmix. I have no underruns by using directly the ALSA HW device (hw:0,0)
The dmix uses the fixed configuration. Did you try playback using hw but with the same configuration (period size, buffer size, format)?
this is a very good observation.
With the same buffer/period sizes at a sampling rate of 44100 (this slightly modify the buffer/period times), I have 0 underruns. As soon as I resample my wav file to 48kHz, boom the underruns happens.
So if I understand correctly by reducing the buffer time correctly from 371504 usec to 341328 usec and by assuming that the buffer is full, if the snd_hda_intel irq/timer are delayed to a greater amount of time than 341328 usec, this is what is causing the underruns.
Maybe it is important to the discussion that my CONFIG_HZ=1000 and
$ zgrep PREEMPT /proc/config.gz CONFIG_TREE_PREEMPT_RCU=y CONFIG_PREEMPT_RCU=y # CONFIG_PREEMPT_NONE is not set # CONFIG_PREEMPT_VOLUNTARY is not set CONFIG_PREEMPT=y CONFIG_PREEMPT_COUNT=y # CONFIG_DEBUG_PREEMPT is not set # CONFIG_PREEMPT_TRACER is not set
$ aplay -Dhw:0,0 --period-size=1024 --buffer-size=16384 -v sine.wav Playing WAVE 'sine.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo Hardware PCM card 0 'HDA Intel' device 0 subdevice 0 Its setup is: stream : PLAYBACK access : RW_INTERLEAVED format : S16_LE subformat : STD channels : 2 rate : 44100 exact rate : 44100 (44100/1) msbits : 16 buffer_size : 16384 period_size : 1024 period_time : 23219 tstamp_mode : NONE period_step : 1 avail_min : 1024 period_event : 0 start_threshold : 16384 stop_threshold : 16384 silence_threshold: 0 silence_size : 0 boundary : 1073741824 appl_ptr : 0 hw_ptr : 0
$ aplay -Dhw:0,0 --period-size=1024 --buffer-size=16384 -v sine_48000.wav Playing WAVE 'sine_48000.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Stereo Hardware PCM card 0 'HDA Intel' device 0 subdevice 0 Its setup is: stream : PLAYBACK access : RW_INTERLEAVED format : S16_LE subformat : STD channels : 2 rate : 48000 exact rate : 48000 (48000/1) msbits : 16 buffer_size : 16384 period_size : 1024 period_time : 21333 tstamp_mode : NONE period_step : 1 avail_min : 1024 period_event : 0 start_threshold : 16384 stop_threshold : 16384 silence_threshold: 0 silence_size : 0 boundary : 1073741824 appl_ptr : 0 hw_ptr : 0 underrun!!! (at least 0.075 ms long) Status: state : XRUN trigger_time: 2155.298508067 tstamp : 2155.299242462 delay : 0 avail : 16815 avail_max : 16815
CONFIDENTIALITY : This e-mail and any attachments are confidential and may be privileged. If you are not a named recipient, please notify the sender immediately and do not disclose the contents to another person, use it for any purpose or store or copy the information in any medium. _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
CONFIDENTIALITY : This e-mail and any attachments are confidential and may be privileged. If you are not a named recipient, please notify the sender immediately and do not disclose the contents to another person, use it for any purpose or store or copy the information in any medium.