<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hi all,<br>
<br>
I found some audio noise problem when I trying to set the sink
latency to a lower value.<br>
<br>
here is the alsa dump:<br>
<br>
D/NMAudio ( 1959): Its setup is:<br>
D/NMAudio ( 1959): stream : PLAYBACK<br>
D/NMAudio ( 1959): access : MMAP_INTERLEAVED<br>
D/NMAudio ( 1959): format : S16_LE<br>
D/NMAudio ( 1959): subformat : STD<br>
D/NMAudio ( 1959): channels : 2<br>
D/NMAudio ( 1959): rate : 22050<br>
D/NMAudio ( 1959): exact rate : 22050 (22050/1)<br>
D/NMAudio ( 1959): msbits : 16<br>
D/NMAudio ( 1959): buffer_size : 8192<br>
D/NMAudio ( 1959): period_size : 2048<br>
D/NMAudio ( 1959): period_time : 92879<br>
D/NMAudio ( 1959): tstamp_mode : ENABLE<br>
D/NMAudio ( 1959): period_step : 1<br>
D/NMAudio ( 1959): avail_min : 7751<br>
D/NMAudio ( 1959): period_event : 0<br>
D/NMAudio ( 1959): start_threshold : -1<br>
D/NMAudio ( 1959): stop_threshold : 1073741824<br>
D/NMAudio ( 1959): silence_threshold: 0<br>
D/NMAudio ( 1959): s<br>
<br>
here is the log when problem happened:<br>
<br>
<font color="#000099">E/NMAudio ( 1959): [1991] ( 355.00387|
0.000) pcm_avail = 30124 , 7531</font><br>
D/NMAudio ( 1959): [1991] ( 355.00387| 0.000) avail: 30124,
left_to_play: 29.98ms, process_usec=20.00ms, max_sleep_usec=10.00ms<br>
D/NMAudio ( 1959): [1991] ( 355.00387| 0.000) Not filling up,
because too early.<br>
D/NMAudio ( 1959): [1991][audioio]
snd_pcm_avail[0][0xb344efa0]=7531<br>
<font color="#000099">E/NMAudio ( 1959): [1991] ( 355.00387|
0.000) pcm_avail = 30124 , 7531</font><br>
D/NMAudio ( 1959): [1991] ( 355.00388| 0.000) avail: 30124,
left_to_play: 29.98ms, process_usec=20.00ms, max_sleep_usec=10.00ms<br>
D/NMAudio ( 1959): [1991] ( 355.00388| 0.000) Not filling up,
because too early.<br>
D/NMAudio ( 1959): [1991][audioio]
snd_pcm_avail[0][0xb344efa0]=7531<br>
<font color="#000099">E/NMAudio ( 1959): [1991] ( 355.00388|
0.000) pcm_avail = 30124 , 7531</font><br>
D/NMAudio ( 1959): [1991] ( 355.00388| 0.000) avail: 30124,
left_to_play: 29.98ms, process_usec=20.00ms, max_sleep_usec=10.00ms<br>
D/NMAudio ( 1959): [1991] ( 355.00388| 0.000) Not filling up,
because too early.<br>
D/NMAudio ( 1959): [1991][audioio]
snd_pcm_avail[0][0xb344efa0]=7531<br>
<font color="#000099">E/NMAudio ( 1959): [1991] ( 355.00388|
0.000) pcm_avail = 30124 , 7531</font><br>
D/NMAudio ( 1959): [1991] ( 355.00388| 0.000) avail: 30124,
left_to_play: 29.98ms, process_usec=20.00ms, max_sleep_usec=10.00ms<br>
D/NMAudio ( 1959): [1991] ( 355.00388| 0.000) Not filling up,
because too early.<br>
D/NMAudio ( 1959): [1991][audioio]
snd_pcm_avail[0][0xb344efa0]=7531<br>
<font color="#000099">E/NMAudio ( 1959): [1991] ( 355.00388|
0.000) pcm_avail = 30124 , 7531</font><br>
D/NMAudio ( 1959): [1991] ( 355.00388| 0.000) avail: 30124,
left_to_play: 29.98ms, process_usec=20.00ms, max_sleep_usec=10.00ms<br>
D/NMAudio ( 1959): [1991] ( 355.00388| 0.000) Not filling up,
because too early.<br>
D/NMAudio ( 1959): [1991][audioio]
snd_pcm_avail[0][0xb344efa0]=7531<br>
<font color="#000099">E/NMAudio ( 1959): [1991] ( 355.00388|
0.000) pcm_avail = 30124 , 7531</font><br>
D/NMAudio ( 1959): [1991] ( 355.00388| 0.000) avail: 30124,
left_to_play: 29.98ms, process_usec=20.00ms, max_sleep_usec=10.00ms<br>
D/NMAudio ( 1959): [1991] ( 355.00388| 0.000) Not filling up,
because too early.<br>
D/NMAudio ( 1959): [1991][audioio]
snd_pcm_avail[0][0xb344efa0]=7531 <br>
<font color="#000099">E/NMAudio ( 1959): [1991] ( 355.00388|
0.000) pcm_avail = 30124 , 7531</font><br>
D/NMAudio ( 1959): [1991] ( 355.00388| 0.000) avail: 30124,
left_to_play: 29.98ms, process_usec=20.00ms, max_sleep_usec=10.00ms<br>
D/NMAudio ( 1959): [1991] ( 355.00388| 0.000) Not filling up,
because too early.<br>
D/NMAudio ( 1959): [1991][audioio]
snd_pcm_avail[0][0xb344efa0]=7531<br>
<font color="#000099">E/NMAudio ( 1959): [1991] ( 355.00399|
0.010) pcm_avail = 30124 , 7531</font><br>
D/NMAudio ( 1959): [1991] ( 355.00399| 0.000) avail: 30124,
left_to_play: 29.98ms, process_usec=20.00ms, max_sleep_usec=10.00ms<br>
D/NMAudio ( 1959): [1991] ( 355.00399| 0.000) Not filling up,
because too early.<br>
D/NMAudio ( 1959): [1991][audioio]
snd_pcm_avail[0][0xb344efa0]=7531<br>
<font color="#000099">E/NMAudio ( 1959): [1991] ( 355.00405|
0.005) pcm_avail = 30124 , 7531</font><br>
D/NMAudio ( 1959): [1991] ( 355.00405| 0.000) avail: 30124,
left_to_play: 29.98ms, process_usec=20.00ms, max_sleep_usec=10.00ms<br>
D/NMAudio ( 1959): [1991] ( 355.00405| 0.000) Not filling up,
because too early.<br>
D/NMAudio ( 1959): [1991][audioio]
snd_pcm_avail[0][0xb344efa0]=7531<br>
<font color="#000099">E/NMAudio ( 1959): [1991] ( 355.00405|
0.000) pcm_avail = 30124 , 7531</font><br>
D/NMAudio ( 1959): [1991] ( 355.00405| 0.000) avail: 30124,
left_to_play: 29.98ms, process_usec=20.00ms, max_sleep_usec=10.00ms<br>
D/NMAudio ( 1959): [1991] ( 355.00405| 0.000) Not filling up,
because too early.<br>
D/NMAudio ( 1959): [1991] ( 355.00405| 0.000) Wakeup from ALSA!<br>
D/NMAudio ( 1959): [1991][audioio]
snd_pcm_avail[0][0xb344efa0]=9579<br>
<font color="#cc0000">E/NMAudio ( 1959): [1991] ( 355.00406|
0.000) pcm_avail = 38316 , 9579</font><br>
D/NMAudio ( 1959): [1991] ( 355.00406| 0.000)
Underrun(sink-state=0)! (alsa-left=38316, whole-buffer=32768)<br>
I/NMAudio ( 1959): [1991] ( 355.00406| 0.000) Increasing minimal
latency to 2.00 ms<br>
I/NMAudio ( 1959): [1991] ( 355.00406| 0.000) sink audioio.0
latency range(2000, 371519)<br>
D/NMAudio ( 1959): [1991] ( 355.00406| 0.000) update_sw_params
get_request_latency = 30000<br>
<br>
<br>
seems like snd_pcm_avail result is not so reliable<br>
<br>
first of all, the hw buffer size is set to 8192 frames, but in
the red line, it became 9579. <br>
<br>
second, check the blue lines from time <font color="#000099">355.00387</font>
to <font color="#000099">355.00405</font><br>
the snd_pcm_avail is always 7531 frames, this is 19 ms long,
but snd_pcm_avail value is never changed, is it <br>
a problem ? <br>
<br>
Does anyone met this problem before? I would appreciate hearing
your advice on this.<br>
Thanks!<br>
<br>
<br>
<br>
<br>
BR,<br>
Lixin<br>
</body>
</html>