[mythtv-users] Audio buffer overflow, audio data lost! - NForce2 audio

Dmitry Komarov dmit at dza.lv
Thu Nov 3 06:03:43 EST 2005


Hello to all,

I've been fighting with mythtv for last couple of days with no success. Tried 
all and everything, including googling, forums, list archives etc. Now I am 
totally frustrated with mythtv and start thinking if mythtv is just a myth 
and nothing else. So this is the last attempt before I give up - asking the 
mailing list people.

What do I have:
Athlon XP 2500+ 512 MB RAM (it is an MSI barebone called MEGA 180);
Motherboard is nForce2 with onboard GeForce4 MX - nForce GPU;
Sound is onboard nForce2 Soundstorm device;
Pinnacle PCTV (BT878) TV capture board, audio-out comes into sound cards' 
Line-In jack;
OS: freshly installed and recompiled Gentoo system, linux kernel 2.6.13-r3
MythTV:  emerged and compiled MythTV ver. 0.18.1

Now to the problem itself. It is quite "popular", as far as I discovered while 
digging through archives. 

I have MythTV compiled and installed successfully, all the modules work just 
fine EXCEPT the Live TV itself. TV tuner board is working OK with xawtv, xdtv 
etc, but when I go to watching TV in Myth, the 1 second sound cycles for a 
while and the picture freezes every 5-10 seconds. Sometimes I even get the 
mythbackend crashed if it is run as a daemon.

Changing different sound drivers and different sound systems gives almost the 
same results, differs only amount of errors mythfrontend produces but not the 
errors itself. Playing with different options in myth configuration 
(including sound buffers, sound device, capture resolutions, sampling rates 
etc) gives no result.

I have tried 4 different sound modes:

1) Original NVIDIA sound driver nvsound (it is OSS mode only driver). 
MythTV device settings - /dev/dsp and /dev/mixer;

mythfrontend errors:
2005-11-03 12:30:13.347 Opening audio device '/dev/dsp'.
2005-11-03 12:30:13.347 Opening OSS audio device '/dev/dsp'.
2005-11-03 12:30:13.418 Using XV port 105
2005-11-03 12:30:14.148 Changing from None to WatchingLiveTV
2005-11-03 12:30:14.196 Audio buffer overflow, audio data lost!
2005-11-03 12:30:14.197 Audio buffer overflow, audio data lost!
2005-11-03 12:30:14.197 Audio buffer overflow, audio data lost!
and the last error goes for a while.

mythbackend errors:
2005-11-03 12:30:14.206 NVR: Ran out of free AUDIO buffers :-(
2005-11-03 12:30:14.207 NVR: Ran out of free AUDIO buffers :-(
2005-11-03 12:30:14.207 NVR: Ran out of free AUDIO buffers :-(
and also for a while.

2) Now the ALSA drivers:
snd_pcm_oss, snd_mixer_oss, snd_seq_oss, snd_seq_midi_event, snd_seq, 
snd_seq_device, snd_intel8x0, snd_ac97_codec, snd_pcm, snd_timer, snd, 
snd_page_alloc.

2a) Running in OSS mode, MythTV device settings - /dev/dsp and /dev/mixer;

mythfrontend errors:
2005-11-03 12:40:41.670 Opening audio device '/dev/dsp'.
2005-11-03 12:40:41.670 Opening OSS audio device '/dev/dsp'.
2005-11-03 12:40:41.690 Using XV port 105
2005-11-03 12:40:42.100 Changing from None to WatchingLiveTV
2005-11-03 12:40:42.107 Realtime priority would require SUID as root.
2005-11-03 12:40:42.461 Video timing method: SGI OpenGL
2005-11-03 12:40:48.840 prebuffering pause
2005-11-03 12:40:56.153 prebuffering pause
2005-11-03 12:41:01.139 prebuffering pause
2005-11-03 12:41:06.825 prebuffering pause
2005-11-03 12:41:12.302 prebuffering pause
2005-11-03 12:41:13.206 Audio buffer overflow, audio data lost!
2005-11-03 12:41:13.207 Audio buffer overflow, audio data lost!
2005-11-03 12:41:13.207 Audio buffer overflow, audio data lost!
2005-11-03 12:41:13.211 Audio buffer overflow, audio data lost!
2005-11-03 12:41:13.212 Audio buffer overflow, audio data lost!
etc.

mythbackend errors:
2005-11-03 12:40:40.643 Changing from None to WatchingLiveTV
strange error flushing buffer ...

2b) ALSA default mode, MythTV device settings - ALSA:default and mixer 
default;

mythfrontend errors:
2005-11-03 12:44:44.107 Changing from None to WatchingLiveTV
2005-11-03 12:44:44.328 Video timing method: SGI OpenGL
2005-11-03 12:44:49.017 prebuffering pause
2005-11-03 12:44:49.423 WriteAudio: buffer underrun
2005-11-03 12:44:55.949 prebuffering pause
2005-11-03 12:44:56.340 WriteAudio: buffer underrun
2005-11-03 12:45:00.572 prebuffering pause
2005-11-03 12:45:01.072 WriteAudio: buffer underrun
2005-11-03 12:45:05.805 prebuffering pause
2005-11-03 12:45:06.188 WriteAudio: buffer underrun
2005-11-03 12:45:10.746 prebuffering pause
2005-11-03 12:45:11.180 WriteAudio: buffer underrun
2005-11-03 12:45:11.558 Audio buffer overflow, audio data lost!
2005-11-03 12:45:11.562 Audio buffer overflow, audio data lost!
2005-11-03 12:45:11.563 Audio buffer overflow, audio data lost!
2005-11-03 12:45:11.563 Audio buffer overflow, audio data lost!
2005-11-03 12:45:11.567 Audio buffer overflow, audio data lost!
etc.

mythbackend errors:
2005-11-03 12:44:42.626 Changing from None to WatchingLiveTV
strange error flushing buffer ...

2c) ALSA mode with patched .asaundrc file (added dmix and rate):
pcm.nforce-hw {
type hw
card 0
}
pcm.!default {
type plug
slave.pcm "nforce"
}
pcm.nforce {
type dmix
ipc_key 1234
slave {
pcm "hw:0,0"
period_time 0
period_size 1024
buffer_size 4096
rate 32000
}
}
ctl.nforce-hw {
type hw
card 0
}

mythfrontend errors:
2005-11-03 12:52:01.248 Opening audio device 'nforce'.
2005-11-03 12:52:01.279 Using XV port 105
2005-11-03 12:52:01.694 Changing from None to WatchingLiveTV
2005-11-03 12:52:01.911 Video timing method: SGI OpenGL
2005-11-03 12:52:06.487 prebuffering pause
2005-11-03 12:52:06.882 WriteAudio: buffer underrun
2005-11-03 12:52:12.428 prebuffering pause
2005-11-03 12:52:12.899 WriteAudio: buffer underrun
2005-11-03 12:52:17.209 prebuffering pause
2005-11-03 12:52:17.635 WriteAudio: buffer underrun
2005-11-03 12:52:22.259 prebuffering pause
2005-11-03 12:52:22.755 WriteAudio: buffer underrun
2005-11-03 12:52:27.716 prebuffering pause
2005-11-03 12:52:28.136 WriteAudio: buffer underrun
2005-11-03 12:52:28.622 Audio buffer overflow, audio data lost!
2005-11-03 12:52:28.633 Audio buffer overflow, audio data lost!
2005-11-03 12:52:28.634 Audio buffer overflow, audio data lost!
2005-11-03 12:52:28.639 Audio buffer overflow, audio data lost!
etc.

mythbackend errors:
2005-11-03 12:52:00.354 Changing from None to WatchingLiveTV
strange error flushing buffer ...


Running myth with debug audio options produces the following (lot of similar 
lines skipped):

mythfrontend:
2005-11-03 12:55:03.500 Killing AudioOutputDSP
2005-11-03 12:55:03.500 Opening audio device 'nforce'.
2005-11-03 12:55:03.511 in SetParameters(format=2, channels=2, rate=32000, 
buffer_time=500000, period_time=125000)
2005-11-03 12:55:03.512 get_buffer_size returned 16384
2005-11-03 12:55:03.512 set_period_time_near returned 128000
2005-11-03 12:55:03.512 get_period_size returned 4096
2005-11-03 12:55:03.527 Opening mixer default
2005-11-03 12:55:03.529 Setting Master volume to 70
2005-11-03 12:55:03.530 Volume range is 0 to 31, mult=3.22581
2005-11-03 12:55:03.530 channel 0 vol set to 22
2005-11-03 12:55:03.530 Setting Master volume to 70
2005-11-03 12:55:03.530 Volume range is 0 to 31, mult=3.22581
2005-11-03 12:55:03.530 channel 1 vol set to 22
2005-11-03 12:55:03.530 Setting PCM volume to 70
2005-11-03 12:55:03.530 Volume range is 0 to 31, mult=3.22581
2005-11-03 12:55:03.531 channel 0 vol set to 22
2005-11-03 12:55:03.531 Setting PCM volume to 70
2005-11-03 12:55:03.531 Volume range is 0 to 31, mult=3.22581
2005-11-03 12:55:03.531 channel 1 vol set to 22
2005-11-03 12:55:03.531 Volume range is 0 to 31, mult=3.22581
2005-11-03 12:55:03.531 Audio fragment size: 4096
2005-11-03 12:55:03.531 Audio Stretch Factor: 1
2005-11-03 12:55:03.532 Ending reconfigure
2005-11-03 12:55:03.575 Using XV port 105
2005-11-03 12:55:03.697 kickoffOutputAudioLoop: pid = 22903
2005-11-03 12:55:03.698 OutputAudioLoop: Play Event
2005-11-03 12:55:03.698 Broadcasting free space avail
2005-11-03 12:55:03.717 Broadcasting free space avail
2005-11-03 12:55:03.753 Broadcasting free space avail
...
2005-11-03 12:55:04.299 OutputAudioLoop: audio paused
2005-11-03 12:55:04.299 65536 bytes free on soundcard
2005-11-03 12:55:04.299 WriteAudio: Preparing 4096 bytes (1024 frames)
2005-11-03 12:55:04.313 61440 bytes free on soundcard
2005-11-03 12:55:04.313 WriteAudio: Preparing 4096 bytes (1024 frames)
2005-11-03 12:55:04.325 57344 bytes free on soundcard
2005-11-03 12:55:04.340 _AddSamples bytes=9216, used=1, free=511999, 
timecode=92
2005-11-03 12:55:04.347 Video timecode = 0
2005-11-03 12:55:04.366 _AddSamples bytes=4608, used=9217, free=502783, 
timecode=130
2005-11-03 12:55:04.367 _AddSamples bytes=4608, used=13825, free=498175, 
timecode=158
2005-11-03 12:55:04.367 _AddSamples bytes=4608, used=18433, free=493567, 
timecode=194
2005-11-03 12:55:04.368 _AddSamples bytes=4608, used=23041, free=488959, 
timecode=226
2005-11-03 12:55:04.378 _AddSamples bytes=4608, used=27649, free=484351, 
timecode=284
2005-11-03 12:55:04.378 _AddSamples bytes=4608, used=32257, free=479743, 
timecode=316
2005-11-03 12:55:04.384 _AddSamples bytes=4608, used=36865, free=475135, 
timecode=348
2005-11-03 12:55:04.389 Changing from None to WatchingLiveTV
2005-11-03 12:55:04.396 _AddSamples bytes=4608, used=41473, free=470527, 
timecode=380
2005-11-03 12:55:04.397 _AddSamples bytes=4608, used=46081, free=465919, 
timecode=412
2005-11-03 12:55:04.397 _AddSamples bytes=4608, used=50689, free=461311, 
timecode=444
2005-11-03 12:55:04.609 _AddSamples bytes=4608, used=55297, free=456703, 
timecode=476
2005-11-03 12:55:04.610 _AddSamples bytes=4608, used=59905, free=452095, 
timecode=508
...
2005-11-03 12:55:04.708 _AddSamples bytes=4608, used=124417, free=387583, 
timecode=1020
2005-11-03 12:55:04.708 _AddSamples bytes=4608, used=129025, free=382975, 
timecode=1052
2005-11-03 12:55:04.743 _AddSamples bytes=4608, used=133633, free=378367, 
timecode=1089
...
2005-11-03 12:55:04.744 _AddSamples bytes=4608, used=142849, free=369151, 
timecode=1180
2005-11-03 12:55:04.750 Video timecode = 30
2005-11-03 12:55:04.750 SetEffDsp: 3294369
2005-11-03 12:55:04.769 _AddSamples bytes=4608, used=147457, free=364543, 
timecode=1219
2005-11-03 12:55:04.770 _AddSamples bytes=4608, used=152065, free=359935, 
timecode=1245
2005-11-03 12:55:04.770 _AddSamples bytes=4608, used=156673, free=355327, 
timecode=1276
2005-11-03 12:55:04.780 _AddSamples bytes=4608, used=161281, free=350719, 
timecode=1316
2005-11-03 12:55:04.781 _AddSamples bytes=4608, used=165889, free=346111, 
timecode=1342
2005-11-03 12:55:04.781 _AddSamples bytes=4608, used=170497, free=341503, 
timecode=1372
2005-11-03 12:55:04.781 OutputAudioLoop: Play Event
2005-11-03 12:55:04.787 Broadcasting free space avail
2005-11-03 12:55:04.788 WriteAudio: Preparing 4096 bytes (1024 frames)
2005-11-03 12:55:04.788 Broadcasting free space avail
2005-11-03 12:55:04.788 WriteAudio: Preparing 4096 bytes (1024 frames)
2005-11-03 12:55:04.788 Broadcasting free space avail
2005-11-03 12:55:04.788 WriteAudio: Preparing 4096 bytes (1024 frames)
2005-11-03 12:55:04.788 Broadcasting free space avail
2005-11-03 12:55:04.789 WriteAudio: Preparing 4096 bytes (1024 frames)
2005-11-03 12:55:04.789 Broadcasting free space avail
2005-11-03 12:55:04.791 WriteAudio: Preparing 4096 bytes (1024 frames)
2005-11-03 12:55:04.791 audio waiting for space on soundcard: have 0 need 4096
2005-11-03 12:55:04.821 _AddSamples bytes=4608, used=117761, free=394239, 
timecode=1440
2005-11-03 12:55:04.821 _AddSamples bytes=4608, used=122369, free=389631, 
timecode=1472
2005-11-03 12:55:04.822 _AddSamples bytes=4608, used=126977, free=385023, 
timecode=1502
2005-11-03 12:55:04.864 _AddSamples bytes=4608, used=131585, free=380415, 
timecode=1534
2005-11-03 12:55:04.864 _AddSamples bytes=4608, used=136193, free=375807, 
timecode=1564
2005-11-03 12:55:04.865 _AddSamples bytes=4608, used=140801, free=371199, 
timecode=1596
2005-11-03 12:55:04.869 _AddSamples bytes=4608, used=145409, free=366591, 
timecode=1630
2005-11-03 12:55:04.876 _AddSamples bytes=4608, used=150017, free=361983, 
timecode=1663
2005-11-03 12:55:04.892 Video timing method: SGI OpenGL
2005-11-03 12:55:04.921 Broadcasting free space avail
2005-11-03 12:55:04.922 WriteAudio: Preparing 4096 bytes (1024 frames)
2005-11-03 12:55:04.922 Broadcasting free space avail
2005-11-03 12:55:04.922 WriteAudio: Preparing 4096 bytes (1024 frames)
2005-11-03 12:55:04.922 Broadcasting free space avail
2005-11-03 12:55:04.922 WriteAudio: Preparing 4096 bytes (1024 frames)
2005-11-03 12:55:04.922 audio waiting for space on soundcard: have 3456 need 
4096
2005-11-03 12:55:05.054 Broadcasting free space avail
2005-11-03 12:55:05.054 WriteAudio: Preparing 4096 bytes (1024 frames)
2005-11-03 12:55:05.054 Broadcasting free space avail
...
2005-11-03 12:59:00.777 _AddSamples bytes=4608, used=197121, free=314879, 
timecode=14491
2005-11-03 12:59:00.778 _AddSamples bytes=4608, used=201729, free=310271, 
timecode=14523
2005-11-03 12:59:00.778 _AddSamples bytes=4608, used=206337, free=305663, 
timecode=14561
2005-11-03 12:59:00.779 _AddSamples bytes=4608, used=210945, free=301055, 
timecode=14587
2005-11-03 12:59:00.783 _AddSamples bytes=4608, used=215553, free=296447, 
timecode=14623
2005-11-03 12:59:00.783 _AddSamples bytes=4608, used=220161, free=291839, 
timecode=14683
2005-11-03 12:59:00.787 _AddSamples bytes=4608, used=224769, free=287231, 
timecode=14717
2005-11-03 12:59:00.787 _AddSamples bytes=4608, used=229377, free=282623, 
timecode=14747
2005-11-03 12:59:00.788 _AddSamples bytes=4608, used=233985, free=278015, 
timecode=14779
2005-11-03 12:59:00.805 _AddSamples bytes=4608, used=238593, free=273407, 
timecode=14811
2005-11-03 12:59:00.805 _AddSamples bytes=4608, used=243201, free=268799, 
timecode=14843
2005-11-03 12:59:00.806 _AddSamples bytes=4608, used=247809, free=264191, 
timecode=14875
2005-11-03 12:59:00.806 _AddSamples bytes=4608, used=252417, free=259583, 
timecode=14907
2005-11-03 12:59:00.806 Video timecode = 420
2005-11-03 12:59:00.806 SetEffDsp: 3206896
2005-11-03 12:59:00.810 Broadcasting free space avail
2005-11-03 12:59:00.811 WriteAudio: Preparing 4096 bytes (1024 frames)
2005-11-03 12:59:00.811 Broadcasting free space avail
...2005-11-03 12:59:01.185 prebuffering pause
2005-11-03 12:59:01.200 OutputAudioLoop: audio paused
2005-11-03 12:59:01.203 _AddSamples bytes=4608, used=191489, free=320511, 
timecode=14971
2005-11-03 12:59:01.204 _AddSamples bytes=4608, used=196097, free=315903, 
timecode=15003
2005-11-03 12:59:01.207 _AddSamples bytes=4608, used=200705, free=311295, 
timecode=15035
2005-11-03 12:59:01.208 _AddSamples bytes=4608, used=205313, free=306687, 
timecode=15067
2005-11-03 12:59:01.208 _AddSamples bytes=4608, used=209921, free=302079, 
timecode=15099
2005-11-03 12:59:01.212 _AddSamples bytes=4608, used=214529, free=297471, 
timecode=15135
2005-11-03 12:59:01.233 _AddSamples bytes=4608, used=219137, free=292863, 
timecode=15163
2005-11-03 12:59:01.233 _AddSamples bytes=4608, used=223745, free=288255, 
timecode=15195
2005-11-03 12:59:01.251 _AddSamples bytes=4608, used=228353, free=283647, 
timecode=15259
2005-11-03 12:59:01.252 _AddSamples bytes=4608, used=232961, free=279039, 
timecode=15291
2005-11-03 12:59:01.252 _AddSamples bytes=4608, used=237569, free=274431, 
timecode=15323
2005-11-03 12:59:01.308 18592 bytes free on soundcard
2005-11-03 12:59:01.440 34976 bytes free on soundcard
2005-11-03 12:59:01.564 51360 bytes free on soundcard
2005-11-03 12:59:01.704 67744 bytes free on soundcard
...
2005-11-03 12:59:01.704 WriteAudio: Preparing 4096 bytes (1024 frames)
2005-11-03 12:59:01.704 WriteAudio: buffer underrun
2005-11-03 12:59:01.717 61440 bytes free on soundcard
2005-11-03 12:59:01.717 WriteAudio: Preparing 4096 bytes (1024 frames)
2005-11-03 12:59:01.728 _AddSamples bytes=4608, used=242177, free=269823, 
timecode=15356
2005-11-03 12:59:01.728 _AddSamples bytes=4608, used=246785, free=265215, 
timecode=15389
2005-11-03 12:59:01.729 _AddSamples bytes=4608, used=251393, free=260607, 
timecode=15419
2005-11-03 12:59:01.738 57344 bytes free on soundcard
2005-11-03 12:59:01.738 _AddSamples bytes=4608, used=256001, free=255999, 
timecode=15455
2005-11-03 12:59:01.738 _AddSamples bytes=4608, used=260609, free=251391, 
timecode=15483
2005-11-03 12:59:01.751 _AddSamples bytes=4608, used=265217, free=246783, 
timecode=15548
2005-11-03 12:59:01.752 _AddSamples bytes=4608, used=269825, free=242175, 
timecode=15579
2005-11-03 12:59:01.759 _AddSamples bytes=4608, used=274433, free=237567, 
timecode=15610
2005-11-03 12:59:01.759 _AddSamples bytes=4608, used=279041, free=232959, 
timecode=15642
2005-11-03 12:59:01.763 _AddSamples bytes=4608, used=283649, free=228351, 
timecode=15675
2005-11-03 12:59:01.764 _AddSamples bytes=4608, used=288257, free=223743, 
timecode=15706
2005-11-03 12:59:01.764 _AddSamples bytes=4608, used=292865, free=219135, 
timecode=15738
2005-11-03 12:59:01.774 _AddSamples bytes=4608, used=297473, free=214527, 
timecode=15771
2005-11-03 12:59:01.774 _AddSamples bytes=4608, used=302081, free=209919, 
timecode=15834
2005-11-03 12:59:02.158 _AddSamples bytes=4608, used=306689, free=205311, 
timecode=15866
2005-11-03 12:59:02.158 _AddSamples bytes=4608, used=311297, free=200703, 
timecode=15901
2005-11-03 12:59:02.159 _AddSamples bytes=4608, used=315905, free=196095, 
timecode=15933
2005-11-03 12:59:02.159 _AddSamples bytes=4608, used=320513, free=191487, 
timecode=15962
2005-11-03 12:59:02.159 Video timecode = 450
2005-11-03 12:59:02.159 SetEffDsp: 3206640
2005-11-03 12:59:02.170 _AddSamples bytes=4608, used=325121, free=186879, 
timecode=15994
2005-11-03 12:59:02.171 _AddSamples bytes=4608, used=329729, free=182271, 
timecode=16026
2005-11-03 12:59:02.171 _AddSamples bytes=4608, used=334337, free=177663, 
timecode=16059
2005-11-03 12:59:02.172 OutputAudioLoop: Play Event
2005-11-03 12:59:02.175 Broadcasting free space avail
2005-11-03 12:59:02.175 WriteAudio: Preparing 4096 bytes (1024 frames)
2005-11-03 12:59:02.175 Broadcasting free space avail
2005-11-03 12:59:02.175 WriteAudio: Preparing 4096 bytes (1024 frames)
2005-11-03 12:59:02.175 audio waiting for space on soundcard: have 0 need 4096
2005-11-03 12:59:02.179 _AddSamples bytes=4608, used=281601, free=230399, 
timecode=16122
2005-11-03 12:59:02.179 _AddSamples bytes=4608, used=286209, free=225791, 
timecode=16154
2005-11-03 12:59:02.183 _AddSamples bytes=4608, used=290817, free=221183, 
timecode=16191
2005-11-03 12:59:02.184 _AddSamples bytes=4608, used=295425, free=216575, 
timecode=16218
2005-11-03 12:59:02.184 _AddSamples bytes=4608, used=300033, free=211967, 
timecode=16250
2005-11-03 12:59:02.185 _AddSamples bytes=4608, used=304641, free=207359, 
timecode=16282
2005-11-03 12:59:02.216 audio waiting for space on soundcard: have 3648 need 
4096


More information about the mythtv-users mailing list