Video stuttering: messages about RingBuf, video buffers
I'm having playback issues on a combined frontend/backend myth system. I've been using MythTV for about three years now with no playback issues. I've upgraded hardware several times, most recently replacing a single WD20EARS with an SSD for the system and a WD20EARX for videos. Now I get errors like this during video playback or while watching live TV:
Code:
Sep 29 21:40:22 mythtv mythfrontend[8385]: I Decoder ringbuffer.cpp:1086 (WaitForAvail) RingBuf(/second_drive/recordings/3130_20120103210000.mpg): Waited 2.0 seconds for data #012#011#011#011to become available... 0 < 32768
Sep 29 21:40:22 mythtv mythfrontend[8385]: N CoreContext mythplayer.cpp:2078 (PrebufferEnoughFrames) Player(g): Waited 3719ms for video buffers AAAAAAAAAAALff
Sep 29 21:40:22 mythtv mythfrontend[8385]: N CoreContext mythplayer.cpp:2078 (PrebufferEnoughFrames) Player(g): Waited 3823ms for video buffers AAAAAAAAAAALff
Sep 29 21:40:22 mythtv mythfrontend[8385]: N CoreContext mythplayer.cpp:2078 (PrebufferEnoughFrames) Player(g): Waited 3926ms for video buffers AAAAAAAAAAALff
Sep 29 21:40:22 mythtv mythfrontend[8385]: N CoreContext mythplayer.cpp:2078 (PrebufferEnoughFrames) Player(g): Waited 4029ms for video buffers AAAAAAAAAAALff
If a recording is being made while watching a different recording or live TV the problem is exacerbated.
Ubuntu 12.04.1 LTS (GNU/Linux 3.2.0-31-generic-pae i686)
MythTV Version : v0.25.2-15-g46cab93
MythTV Branch : fixes/0.25
Playback is set to VDPAU slim
Combined frontend/backend onIntel i5-2400S
ASUS ENGT520 SL/DI/2GD3
Crucial CT64M4SSD2
Western Digital WD20EARX
I searched for related issues and found several threads, most nearly a year old, regarding various issues like playback from a NAS, using multiple frontends, etc. But none of the cases I've found represent my situation.
What might cause these issues?
Re: Video stuttering: messages about RingBuf, video buffers
What filesystem are you using?
A friend of mine had issues about R/W speed with an SSD drive. A BIOS update fixed that. No idea if your issue could be related to BIOS as well.
Re: Video stuttering: messages about RingBuf, video buffers
Thanks for the reply.
Quote:
Originally Posted by
Rotak
What filesystem are you using?
The operating system ('/') resides on an ext4 partition on the SSD. All recordings are written to an XFS partition on the 2 TB WD drive.
Code:
$ df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda2 57927924 6128544 48856816 12% /
udev 2047276 4 2047272 1% /dev
tempfs 2054548 3788 2050760 1% /tmp
tmpfs 821820 1064 820756 1% /run
none 5120 4 5116 1% /run/lock
none 2054548 148 2054400 1% /run/shm
/dev/sdb1 1952559608 881549900 1071009708 46% /second_drive
$ sudo parted /dev/sda
GNU Parted 2.3
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print
Model: ATA M4-CT064M4SSD2 (scsi)
Disk /dev/sda: 64.0GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
1 17.4kB 1018kB 1000kB bios_grub
2 1018kB 60.3GB 60.3GB ext4
3 60.3GB 64.0GB 3758MB linux-swap(v1)
$ sudo parted /dev/sdb
Using /dev/sdb
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print
Model: ATA WDC WD20EARX-008 (scsi)
Disk /dev/sdb: 2000GB
Sector size (logical/physical): 512B/4096B
Partition Table: msdos
Number Start End Size Type File system Flags
1 1049kB 2000GB 2000GB primary xfs
Quote:
Originally Posted by
Rotak
A friend of mine had issues about R/W speed with an SSD drive. A BIOS update fixed that. No idea if your issue could be related to BIOS as well.
I haven't looked for motherboard BIOS updates recently but last time I checked I was at the latest version. The MB is an ASUS P8H67-M PRO/CSM. Checking the website just now, it appears there are no downloads (BIOS or otherwise) which, presumably, is either a bug or an indication that the product is deprecated (http://usa.asus.com/Motherboards/Int...OCSM/#download).
Were your friend's recordings written to the SSD?
Re: Video stuttering: messages about RingBuf, video buffers
I will ask my friend. I know it was an ASUS board, too.
He changed his setup a few months ago. He's now only writing LiveTV to the SSD and is storing recordings on a NAS.
Maybe you can "benchmark" your HDDs by using:
Code:
sudo hdparm -tT /dev/sda
(and sdb, of course)
Here is the output of my myth server, while I was watching TV (system not idle):
Code:
sudo hdparm -tT /dev/sda
/dev/sda:
Timing cached reads: 14488 MB in 2.00 seconds = 7252.89 MB/sec
Timing buffered disk reads: 166 MB in 3.02 seconds = 54.88 MB/sec
Re: Video stuttering: messages about RingBuf, video buffers
Quote:
Originally Posted by
Rotak
Maybe you can "benchmark" your HDDs by using:
Code:
sudo hdparm -tT /dev/sda
(and sdb, of course)
Cool utility...I didn't know there was a quick way to check disk performance.
Here are some results:
http://i1075.photobucket.com/albums/...erformance.jpg
Looks like (by this metric at least) there should be sufficient throughput on /dev/sdb and the SSD on /dev/sda appears to perform as expected for an SSD.
On a whim, I watched atop while viewing a recording and another one was being written to disk. I saw this during smooth playback:
Code:
DSK | sdb | busy 17% | read 70 | write 47 | KiB/r 244 | | KiB/w 357 | MBr/s 1.67 | MBw/s 1.64 | avq 1.49 | avio 14.7 ms |
When a playback stall occurred, I saw this:
Code:
DSK | sdb | busy 98% | read 22 | write 7 | KiB/r 302 | | KiB/w 258 | MBr/s 0.65 | MBw/s 0.18 | avq 6.74 | avio 334 ms |
Obviously the busy percentage is a problem. The other obvious issue is avio (far right, you have to scroll over in the code section of the post), which I assume is some measure of access time based on its healthy number.
I've never seen anything like this before. Any thoughts on what might cause intermittent high disk latency?
Re: Video stuttering: messages about RingBuf, video buffers
Phew. I experimented with file systems a long time ago (Mythbuntu 10.04).
With kernel 2.6, I (sooner or later) experienced speed problems with any journaling file system. Therefore, I switched to ext2.
Maybe a filesystem geek could comment this. 8-[
Re: Video stuttering: messages about RingBuf, video buffers
Quote:
Originally Posted by
Rotak
With kernel 2.6, I (sooner or later) experienced speed problems with any journaling file system. Therefore, I switched to ext2.
Huh...hadn't considered that angle. In hopes of expert filesystem insight, here's my fstab (parameters for the XFS partition that all recordings go on are "defaults"):
Code:
$ cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc nodev,noexec,nosuid 0 0
UUID=0efa47e2-b174-49be-8726-dfcca4fb9c10 / ext4 errors=remount-ro 0 1
UUID=e728f64d-4c7a-4d1a-bd1a-efce96c6274e none swap sw 0 0
tempfs /tmp tmpfs nodev,nosuid 0 0
UUID="35fa6798-8564-46e2-8714-6c5385df220b" /second_drive xfs defaults 0 0
Re: Video stuttering: messages about RingBuf, video buffers
I am hesitant to give any advice on XFS mount options or on using and fs-tools to set options, because I have no XFS partition running.
As far as I remember, it's not possible to turn off journaling on XFS. But maybe somebody knows other optimization options. I read of some optimizations, but those have to be done when creating the filesystem. :(
Re: Video stuttering: messages about RingBuf, video buffers
It is unlikely that your filesystem is to blame. There was a bug I saw fixed for 0.26 about the livetv buffer being out by a factor of 10 (ie 1/10th the size it should have been). I recall seeing the fix committed for 0.26, not sure if it was for 0.25 or 0.24. I cannot find the damned commit now and therefore can't confirm.
Try pausing, let the buffer build up a bit and restart. Should only take a short pause. If that works we have probably at least found the bug, even if the workaround is a PITA. (albeit an easy to implement PITA).
Re: Video stuttering: messages about RingBuf, video buffers
Got it, it's ticket 10428 in track and commit 483e06f in git. Unfortunately not backported to 0.25 so far as I can see.
http://code.mythtv.org/trac/ticket/10428
https://github.com/MythTV/mythtv/com...a5f844519f51f9
Time to try 0.26?