SageTV Community  

Go Back   SageTV Community > SageTV Products > SageTV Linux

Notices

SageTV Linux Discussion related to the SageTV Media Center for Linux. Questions, issues, problems, suggestions, etc. relating to the SageTV Linux should be posted here.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 01-06-2011, 08:51 PM
boil42 boil42 is offline
Sage User
 
Join Date: Jul 2010
Location: Perth
Posts: 10
ubuntu playback problems and HD Homerun tuners

Ive been a Sage user for 8 months now with my only real successful installation on a windows xp device. windows 7 Installs have all caused me some performance problems so decided to go Linux.

Installed latest Ubuntu and SageTV without problems but watching TV has issues.

When first selectign a chanel is appears to run in fast forward mode without sound bu in fact it appears to be skipping frames. this goes for about 10 seconds then everything catches up and works fine. except for some channels and this happens about every minute or so. This is on the extenders BTW.

i have not installed any HDHOMERUN SW. sage ppicked up the tuners automatically.

Same happens every time I change to another channel. any help would be appreciated.

Ubuntu V10
AMD Phenom II x 4 processor
2gb RAM
HD HomeRun Dual Tuners x 2
2 x HD200 extenders
1 x HD300 extender
Reply With Quote
  #2  
Old 01-07-2011, 07:14 AM
drewg drewg is offline
Sage Icon
 
Join Date: Aug 2007
Location: Richmond, VA
Posts: 1,040
It wasn't clear from your post -- does this happen only on live TV, or also on recordings as well?

What does your network topology look like? Do you have a 1Gb/s link to a switch, and the from that 1Gb/s switch, links to the HDHR & the extenders? Or are you all 100Mb/s? In a terminal window, what does "sudo ethtool eth0" report back do you?

When playing something back on an extender, do you see an ffmpeg process active? Start a terminal window and run the command "top" while you're playing something back on an extender. (hit q to exit from top).

Drew
__________________
Server HW: AMD Ryzen Threadripper 2990WX 32-Core
Server SW: FreeBSD-current, ZFS, linux-oracle-jdk1.8.0, sagetv-server_9.2.2_amd64
Tuner HW: HDHR
Client: Nvidia Shield (HD300, HD100 in storage)
Reply With Quote
  #3  
Old 01-10-2011, 01:51 AM
boil42 boil42 is offline
Sage User
 
Join Date: Jul 2010
Location: Perth
Posts: 10
Thanks Drew.. was away for the weekend so only just saw your reply.

It's live TV only.

I have since installed ubuntu and SAGE TV on onother PC and I have the same problem. Alos it os not all channels but only the 10 network and ABC (in australia).

I have an idea it is a tuner problem. These are the weaker chanels in Perth. I'll do some more investigating.
Reply With Quote
  #4  
Old 01-10-2011, 07:40 AM
kbyrd kbyrd is offline
Sage Aficionado
 
Join Date: Sep 2008
Location: SF Bay Area, CA
Posts: 282
If it's only live, could it be an issue with the storage? Watching live tv is basically recording and playing at the same time. Maybe your disk, the connection to the disk, or the settings in the kernel are causing some problems. One possible test of this would be to watch one previously recorded show while recording a new show. They should both be on the same drive. It's not quite the same stress as watching a live stream, but it's similar. When you do this look for skips in the show you're playing then later go back and look for gaps in the recorded show. If this happens, I suspect your storage system is overtaxed. If the physical hardware is all the same as it was on XP when it worked, then I would look to some of the storage-related settings in the Linux kernel.
__________________
Current Server: Sage v7.1.9.1 beta w/ Diamond UI on Ubuntu 11.10 x86_64 | Storage: Linux md's raid10,f2 | Client: HD300 extender | Tuner: HDHomeRun for QAM
Reply With Quote
  #5  
Old 01-10-2011, 09:56 AM
drewg drewg is offline
Sage Icon
 
Join Date: Aug 2007
Location: Richmond, VA
Posts: 1,040
Quote:
Originally Posted by kbyrd View Post
If it's only live, could it be an issue with the storage? Watching live tv is basically recording and playing at the same time. Maybe your disk, the connection to the disk, or the settings in the kernel are causing some problems. One possible test of this would be to watch one previously recorded show while recording a new show.
That would actually be a harder test than live TV. The reason is that the live tv stream's recording file should be hot in the file cache. This will result in almost no increase in disk IO over just recording (as long as you're not too far behind the current time) since reads will be satisfied from the cache, and will not reach the disk. Watching one recording while playing back in another is more stressful, as the old recording will not be hot in the cache, and will result in 2x as much disk IO.

My thought was that it might be a network problem. Is the problematic channel higher bandwidth than other, working channels? You can see the bandwidth using the HDHR tools (or by looking at the recording file's size & doing the math).

Things to check for are:

1) UDP "RcvbufErrors:" in netstat -s. Increasing values here while recording or watching Live TV indicates that the kernel is dropping packets because SageTV is not consuming from the HDHR UDP socket fast enough. Possible culprits could be java garbage collection.

2) Network congestion causing the HDHR to drop packets. You can look for non-zero "err=X" in hdhomerun_config FFFFFFFF get /tuner0/debug
(assumes tuner0 is what you're using, it could be tuner1). These stats are only active while a channel is being recorded (or viewed via live tv).

3) other network issues resulting in your NIC dropping packets. Look for increasing "dropped" counters from ifconfig eth0. Many NICs have more detailed stats available via ethttool -S eth0.
(assumes eth0 is the interface you're using, it could be eth1, etc).

Drew
__________________
Server HW: AMD Ryzen Threadripper 2990WX 32-Core
Server SW: FreeBSD-current, ZFS, linux-oracle-jdk1.8.0, sagetv-server_9.2.2_amd64
Tuner HW: HDHR
Client: Nvidia Shield (HD300, HD100 in storage)
Reply With Quote
  #6  
Old 01-10-2011, 06:36 PM
amt amt is offline
Sage User
 
Join Date: Sep 2010
Location: Austin, TX
Posts: 40
I have a similar experience on my linux sageTV with HD300. Shows have a pause for a second or two then they catch back up. Playing recorded programs have a similar effect, but I am not sure if its because the recording had a glitch, or simply a glitch during its playback (I should have "rewound" and checked to see if it's in the same sport every time).

I did have a look at the disk performance stats (iostat -x -m 2) in the SageTV server. I observed that the disk would go to 100% busy on ~12MB/sec writes for about a second, then drop down to near zero. The frequency seems to be the same as the glitch viewed from the HD300. I have a not so optimal disk subsystem, where I write to mirrored disks across a single USB port, so I am limited to about 12.5 MB/sec writes. I would think these writes would be asynchronous, so the app should not get blocked by the writes, but it may be starved for reading as the same time the writes occur.

This was as of yesterday. I have not checked today, but it's been about 24 hours now since the installation of sageTV. I am wondering if there was just a bunch of "up-front" work to do in the beginning and maybe this problem will just go away. I'll be looking for it tonight and reporting back.
Reply With Quote
  #7  
Old 01-11-2011, 07:34 AM
kbyrd kbyrd is offline
Sage Aficionado
 
Join Date: Sep 2008
Location: SF Bay Area, CA
Posts: 282
Quote:
Originally Posted by drewg View Post
That would actually be a harder test than live TV. The reason is that the live tv stream's recording file should be hot in the file cache. This will result in almost no increase in disk IO over just recording (as long as you're not too far behind the current time) since reads will be satisfied from the cache, and will not reach the disk. Watching one recording while playing back in another is more stressful, as the old recording will not be hot in the cache, and will result in 2x as much disk IO.
Interesting. Does the Linux page cache actually work that way? For some reason, I assumed the page cache wouldn't save the results of writes, you'd have to do a read to get pages in the cache. Regardless, this discussion won't help solve the OPs problem and I don't want to jack the thread.
__________________
Current Server: Sage v7.1.9.1 beta w/ Diamond UI on Ubuntu 11.10 x86_64 | Storage: Linux md's raid10,f2 | Client: HD300 extender | Tuner: HDHomeRun for QAM
Reply With Quote
  #8  
Old 01-11-2011, 10:35 PM
amt amt is offline
Sage User
 
Join Date: Sep 2010
Location: Austin, TX
Posts: 40
Unless the program opens a file with o_direct flag, writes to the file will be stored in page cache, and the contents also may not go immediately to disk. Depending on the amount of memory, the contents of the writes may get pushed out of page cache sooner or later. For viewing live programs, it's very very likely there will be no reading from disk to playback what is being simultaneously being recorded (pausing playback for a long time may lower that likeliness). I have no real insight in to how SageTV does what it does, so actual behavior could be very different.
Reply With Quote
  #9  
Old 01-12-2011, 08:46 AM
drewg drewg is offline
Sage Icon
 
Join Date: Aug 2007
Location: Richmond, VA
Posts: 1,040
Quote:
Originally Posted by amt View Post
I did have a look at the disk performance stats (iostat -x -m 2) in the SageTV server. I observed that the disk would go to 100% busy on ~12MB/sec writes for about a second, then drop down to near zero. The frequency seems to be the same as the glitch viewed from the HD300. I have a not so optimal disk subsystem, where I write to mirrored disks across a single USB port, so I am limited to about 12.5 MB/sec writes. I would think these writes would be asynchronous, so the app should not get blocked by the writes, but it may be starved for reading as the same time the writes occur.
12.5MB/sec should be plenty for a few HD recordings at once (each will be about 2.5MB/sec steady state). But I think you're getting killed by how pdflush works. Read http://evanjones.ca/linux-write-caching.html

I'd suggest halving vm.dirty_background_ratio so that writes are done more proactively, and (maybe) doubling vm.dirty_ratio, so that SageTV doesn't get blocked until the I/O finishes.

Drew
__________________
Server HW: AMD Ryzen Threadripper 2990WX 32-Core
Server SW: FreeBSD-current, ZFS, linux-oracle-jdk1.8.0, sagetv-server_9.2.2_amd64
Tuner HW: HDHR
Client: Nvidia Shield (HD300, HD100 in storage)
Reply With Quote
  #10  
Old 01-12-2011, 02:57 PM
amt amt is offline
Sage User
 
Join Date: Sep 2010
Location: Austin, TX
Posts: 40
I suspected that might be a problem, but I have not had a chance to look at it again, as I had a problem with my btrfs filesystem which has caused me to re-install. I probably should not have tried btrfs anyway. This may have been a contributor to the problem. Anyway, I am taking the opportunity to move to new HW with more memory, faster cpu, and faster pipe to disks (sata).
Reply With Quote
  #11  
Old 01-13-2011, 07:42 AM
drewg drewg is offline
Sage Icon
 
Join Date: Aug 2007
Location: Richmond, VA
Posts: 1,040
Quote:
Originally Posted by amt View Post
I suspected that might be a problem, but I have not had a chance to look at it again, as I had a problem with my btrfs filesystem which has caused me to re-install. I probably should not have tried btrfs anyway. This may have been a contributor to the problem. Anyway, I am taking the opportunity to move to new HW with more memory, faster cpu, and faster pipe to disks (sata).
Aha! Yes, I think there might be something funky about BTRFS. I've got a 10.04 box as my sage server (updated from 8.04 by adding a new disk) and used BTRFS for /. When I untar a large tarball (like the linux kernel) on my / partition, the system becomes unresponsive for a long time. I've been using xfs for my recording & home directory partitions (on a RAID5 LVM) and have never had that sort of behaviour from XFS.

Drew
__________________
Server HW: AMD Ryzen Threadripper 2990WX 32-Core
Server SW: FreeBSD-current, ZFS, linux-oracle-jdk1.8.0, sagetv-server_9.2.2_amd64
Tuner HW: HDHR
Client: Nvidia Shield (HD300, HD100 in storage)
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Ubuntu and PVR-150 blasting problems dougbrose SageTV Linux 0 04-27-2010 02:59 PM
Playback issues with HD Homerun recordings pknowles Hardware Support 3 12-20-2009 08:31 PM
Placeshifter on Ubuntu - no video on playback dflachbart SageTV Linux 31 05-29-2009 03:30 PM
Sage TV for Windows Home Server Software, HPMediaSmart Server, and HD homerun tuners c309 SageTV Software 15 08-17-2008 06:03 AM
2 Tuners = problems? cyphorx SageTV Software 3 12-24-2004 07:51 PM


All times are GMT -6. The time now is 01:10 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, vBulletin Solutions Inc.
Copyright 2003-2005 SageTV, LLC. All rights reserved.