[mythtv-users] mythfrontend is always hungry for ALSA Hardware audio buffer

Andrey Zhunev a-j at a-j.ru
Thu Nov 8 20:24:49 UTC 2012


Hello All,


I just noticed that mythfrontend is asking to allocate a larger buffer for alsa:


2012-11-08 23:58:12.444863 I [3616/3616] CoreContext audio/audiooutputalsa.cpp:139 (TryOpenDevice) - ALSA: OpenDevice default
2012-11-08 23:58:12.446646 I [3616/3616] CoreContext audio/audiooutputalsa.cpp:678 (SetParameters) - ALSA: SetParameters(format=10, channels=2, rate=48000, buffer_time=500000, period_time=4)
2012-11-08 23:58:12.446948 I [3616/3616] CoreContext audio/audiooutputalsa.cpp:736 (SetParameters) - ALSA: Buffer size range from 2048 to 16384
2012-11-08 23:58:12.446957 I [3616/3616] CoreContext audio/audiooutputalsa.cpp:739 (SetParameters) - ALSA: Period size range from 1024 to 1024
2012-11-08 23:58:12.446997 E [3616/3616] CoreContext audio/audiooutputalsa.cpp:783 (SetParameters) - ALSA: Requested 500000us got 341333 buffer time
2012-11-08 23:58:12.447110 I [3616/3616] CoreContext audio/audiooutputalsa.cpp:224 (IncPreallocBufferSize) - ALSA: Hardware audio buffer cur: 512 need: 768 max allowed: 32768
2012-11-08 23:58:12.447139 E [3616/3616] CoreContext audio/audiooutputalsa.cpp:242 (IncPreallocBufferSize) - ALSA: Try to manually increase audio buffer with: echo 768 | sudo tee /proc/asound/card0/pcm0p/sub0/prealloc
2012-11-08 23:58:12.447162 I [3616/3616] CoreContext audio/audiooutputalsa.cpp:791 (SetParameters) - ALSA: Buffer time = 341333 us
2012-11-08 23:58:12.447172 I [3616/3616] CoreContext audio/audiooutputalsa.cpp:797 (SetParameters) - ALSA: Period time = 16 periods
2012-11-08 23:58:12.447288 I [3616/3616] CoreContext audio/audiooutputalsa.cpp:806 (SetParameters) - ALSA: Buffer size = 16384 | Period size = 1024


So I increased the value of /proc/asound/card0/pcm0p/sub0/prealloc to
'1024' - even more than requested. Strangely, mythfrontend asked for more:


2012-11-09 00:10:18.681551 I [3892/3892] CoreContext audio/audiooutputalsa.cpp:139 (TryOpenDevice) - ALSA: OpenDevice default
2012-11-09 00:10:18.683052 I [3892/3892] CoreContext audio/audiooutputalsa.cpp:678 (SetParameters) - ALSA: SetParameters(format=10, channels=2, rate=48000, buffer_time=500000, period_time=4)
2012-11-09 00:10:18.683407 I [3892/3892] CoreContext audio/audiooutputalsa.cpp:736 (SetParameters) - ALSA: Buffer size range from 2048 to 16384
2012-11-09 00:10:18.683421 I [3892/3892] CoreContext audio/audiooutputalsa.cpp:739 (SetParameters) - ALSA: Period size range from 1024 to 1024
2012-11-09 00:10:18.683483 E [3892/3892] CoreContext audio/audiooutputalsa.cpp:783 (SetParameters) - ALSA: Requested 500000us got 341333 buffer time
2012-11-09 00:10:18.683615 I [3892/3892] CoreContext audio/audiooutputalsa.cpp:224 (IncPreallocBufferSize) - ALSA: Hardware audio buffer cur: 1024 need: 1536 max allowed: 32768
2012-11-09 00:10:18.683648 E [3892/3892] CoreContext audio/audiooutputalsa.cpp:242 (IncPreallocBufferSize) - ALSA: Try to manually increase audio buffer with: echo 1536 | sudo tee /proc/asound/card0/pcm0p/sub0/prealloc
2012-11-09 00:10:18.683666 I [3892/3892] CoreContext audio/audiooutputalsa.cpp:791 (SetParameters) - ALSA: Buffer time = 341333 us
2012-11-09 00:10:18.683677 I [3892/3892] CoreContext audio/audiooutputalsa.cpp:797 (SetParameters) - ALSA: Period time = 16 periods
2012-11-09 00:10:18.683823 I [3892/3892] CoreContext audio/audiooutputalsa.cpp:806 (SetParameters) - ALSA: Buffer size = 16384 | Period size = 1024


Ok, trying to increase it to '32768'... still no luck:


2012-11-09 00:11:58.244562 I [3892/3892] CoreContext audio/audiooutputalsa.cpp:139 (TryOpenDevice) - ALSA: OpenDevice default
2012-11-09 00:11:58.246046 I [3892/3892] CoreContext audio/audiooutputalsa.cpp:678 (SetParameters) - ALSA: SetParameters(format=10, channels=2, rate=48000, buffer_time=500000, period_time=4)
2012-11-09 00:11:58.246312 I [3892/3892] CoreContext audio/audiooutputalsa.cpp:736 (SetParameters) - ALSA: Buffer size range from 2048 to 16384
2012-11-09 00:11:58.246319 I [3892/3892] CoreContext audio/audiooutputalsa.cpp:739 (SetParameters) - ALSA: Period size range from 1024 to 1024
2012-11-09 00:11:58.246355 E [3892/3892] CoreContext audio/audiooutputalsa.cpp:783 (SetParameters) - ALSA: Requested 500000us got 341333 buffer time
2012-11-09 00:11:58.246448 I [3892/3892] CoreContext audio/audiooutputalsa.cpp:224 (IncPreallocBufferSize) - ALSA: Hardware audio buffer cur: 32768 need: 48064 max allowed: 32768
2012-11-09 00:11:58.246475 I [3892/3892] CoreContext audio/audiooutputalsa.cpp:791 (SetParameters) - ALSA: Buffer time = 341333 us
2012-11-09 00:11:58.246481 I [3892/3892] CoreContext audio/audiooutputalsa.cpp:797 (SetParameters) - ALSA: Period time = 16 periods
2012-11-09 00:11:58.246571 I [3892/3892] CoreContext audio/audiooutputalsa.cpp:806 (SetParameters) - ALSA: Buffer size = 16384 | Period size = 1024



Not sure how important this is, but maybe worth looking into...

I can provide more logs, if needed.


# mythfrontend --version
Please attach all output as a file in bug reports.
MythTV Version : v0.26.0-2-ga49c750
MythTV Branch : fixes/0.26
Network Protocol : 75
Library API : 0.26.20120822-1
QT Version : 4.6.2
Options compiled in:
 linux profile use_hidesyms using_alsa using_jack using_oss
 using_pulse using_pulseoutput using_backend using_bindings_perl
 using_bindings_python using_bindings_php using_dvb using_frontend
 using_iptv using_ivtv using_libcrypto using_libudf using_lirc
 using_mheg using_opengl_video using_qtwebkit using_qtscript
 using_qtdbus using_v4l2 using_v4l1 using_x11 using_xrandr using_xv
 using_bindings_perl using_bindings_python using_bindings_php
 using_mythtranscode using_opengl using_vaapi using_vdpau
 using_ffmpeg_threads using_live using_mheg using_libass using_libudf




-- 
Best regards,
 Andrey                    



More information about the mythtv-users mailing list