SageTV Community  

Go Back   SageTV Community > SageTV Products > SageTV Linux
Forum Rules FAQs Community Downloads Today's Posts Search

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 02-10-2009, 01:16 PM
Ikarius's Avatar
Ikarius Ikarius is offline
Sage Advanced User
 
Join Date: Aug 2008
Posts: 84
SageTV on Linux tips

Okay,
So I'm writing up a compilation of tips for setting up/optimizing SageTV on linux, in the hopes that others may benefit.

You can probably run a 64-bit (x86_64) Linux OS, but you'll need to use a 32-bit JRE, and you'll need to install 32-bit compatability libraries. If you're new to linux and that statement didn't make sense to you, you'll probably have better luck/ less pain simply installing a 32-bit version of linux.

There are several possible Java Runtime Environments you can run. The Sage officially supported/recommended JRE is Sun Java 1.5. If you intend to use the SageMC custom interface, they prefer JRE 1.6, thought they do provide backwards-compatability code for 1.5. Aside from Sun's JRE, IBM has a JRE, which some folks have found to be faster. I'm currently running IBM 1.6.11, and it's been stable thus far (*knocks on wood*). Some other discussion of JREs can be found here: http://forums.sagetv.com/forums/showthread.php?t=38556

The easiest way I have found to try different JREs; I expand each of them to a different directory under /opt, and then in my /opt/sagetv/server/startsage script, I add the following:
PATH=/opt/path/to/jre/bin:$PATH

That goes at the top of the startsage script, and changes depending on which JRE I want to run.

One notable optimization that is commonly mentioned is increasing the Java heap size. On windows, that is done via a registry edit. On linux, it's done in the script /opt/sagetv/server/startsage. On the line that calls java with a bunch of parameters, you should find a parameter that reads "-Xmx256m". That tells java to use a max heap size of 256 meg. Adjust to your taste- Mine is currently bumped to 512m.

For HD-PVR users:
The (currently alpha) driver for the HD-PVR on linux is in a mercurial repository, and you must compile it yourself. Instructions for downloading and compiling it can be found here: http://www.mythtv.org/wiki/Hauppauge_HD-PVR. A patch for enabling the IR-blaster for the HD-PVR can be found at the following thread: http://forums.sagetv.com/forums/show...t=33185&page=5. I successfully used the patch with SageTV 6.5.9 release, Ubuntu server edition 8.0.4, and revision 9875eaae8c41 from the hdpvr repository. You can pull that specific version using hg clone -r 9875eaae8c41 http://hg.jannau.net/hdpvr/ . Hopefully, by the time you're reading this, the ir-blasting support will be integrated and those instructions will be unnecessary.

Once the driver is installed, you will want to make sure the kernel module is loaded by default. On Ubuntu, the file controlling kernel modules is /etc/modules. On other flavors, I've seen it in /etc/modprobe.conf. In order to ensure the driver is loaded at startup, you'll need to add a line to that file with the name of the driver on it. On my system, I need "hdpvr", and "i2c-dev" to load the hdpvr module, and the module to create a device for the ir-blaster. I strongly recommend rebooting to insure that your configuration is correct. You should see a /dev/video0 device if you only have one capture device. The output from "dmesg" should also provide clues as to whether the driver loaded successfully, or if there were any problems.

On i2c support; if you have enabled the IR-blaster stuff correctly, the system should create an i2c device for it. On Ubuntu, the OS creates /dev/i2c-0. Unfortunately, sagetv looks for a device resembling /dev/i2c/0.

If your OS uses "udev" (most of the current ones do), you can create a rule so that a correct device is created. On my system, I added a file in /etc/udev/rules.d named "96-i2c.rules". First look for any file in there already touching i2c. If one exists, go ahead and modify it. If not, go ahead and create one. The contents of the file should be a single line like this:
KERNEL=="i2c-[0-9]*", GROUP="i2c", SYMLINK+="i2c/%n"

That will insure that an alias is created which sagetv can use, linked to the correct device.


Further optimizations:
Depending on how slow/fast your hard drive is, how much memory you have, and how much work SageTV is doing in the /tmp directory (temporary workspace), you may want to use a memory-based temp directory. To do this, I added the following line to /etc/fstab:
tmpfs /tmp tmpfs size=1G,nr_inodes=10k,mode=1777 0 0

This sets up a memory based /tmp directory, which can grow to a maximum memory size of 1G (it will grow or shrink based on how much is written into it). Note that you'll need to reboot linux in order for this to take effect- many thing use /tmp as a temporary workspace, and mounting a fresh space on top of the existing /tmp directory after boot may cause troubles for things.


I saw very significant speed improvement for the UI on an HD extender by setting the following sage config in /opt/sagetv/server/Sage.properties:
ui/enable_hardware_scaling_cache=true

Note in order to edit this file, you *must* stop the sage server, edit the file, save your changes, then restart the sage server.


That's what I've got for now, as I come up with additional useful bits, I'll add them. Hopefully someone will find this useful!
__________________

SageTV 6.6.2, SageMC+CenterSage Theme
Server: Intel Core2 Q6600, 8gb memory, 3x 1tb WD EACS drives, software RAID5 2tb capacity, 4gb Flash boot drive, Ubuntu 8.0.4 Server edition
Capture: 1x HD-PVR -> Motorola DTC6200
Clients: 1x STX-HD100 1x STX-HD200, Windows & OSX Clients

Last edited by Ikarius; 02-10-2009 at 01:32 PM.
Reply With Quote
  #2  
Old 02-12-2009, 12:11 PM
MrD MrD is offline
Sage Aficionado
 
Join Date: Feb 2005
Location: Washington DC
Posts: 387
What's the impact to the extender setting this to true?

Quote:
ui/enable_hardware_scaling_cache=true
I assume it uses extender memory, so what is the tradeoff?
__________________
[size=1]-MrD
=============
Linux Server 7.1.9 (1)HD300 (1) HD200 (1) HD100 (2) PC Clients
Intel Xeon L? 32Gb
CetonTV cable card /FIOS
Reply With Quote
  #3  
Old 02-12-2009, 02:07 PM
bcjenkins bcjenkins is offline
SageTVaholic
 
Join Date: Jan 2006
Posts: 3,764
Your advice on the HDPVR driver build is ok if you're not trying to make use of newer drivers in the v4l-dvb tree too.

I run into this enough where I ask Janne to update his tree to sync up with the shifting driver calls.

B
__________________
Running SageTV on unRAID via Docker
Tuning handled by HDHR3-6CC-3X2 using OpenDCT
Reply With Quote
  #4  
Old 02-13-2009, 11:48 AM
Ikarius's Avatar
Ikarius Ikarius is offline
Sage Advanced User
 
Join Date: Aug 2008
Posts: 84
The parameter about ui scaling cache tells sagetv to cache the scaled results of images it needed to scale in order to display, typically thumbnails.

I have not seen it cause a significant memory impact on the server, and I don't have insight into the memory on the extender.

It significantly improved scrolling through albums/movies on my system. My primary client is a first gen HD extender.
__________________

SageTV 6.6.2, SageMC+CenterSage Theme
Server: Intel Core2 Q6600, 8gb memory, 3x 1tb WD EACS drives, software RAID5 2tb capacity, 4gb Flash boot drive, Ubuntu 8.0.4 Server edition
Capture: 1x HD-PVR -> Motorola DTC6200
Clients: 1x STX-HD100 1x STX-HD200, Windows & OSX Clients
Reply With Quote
  #5  
Old 10-24-2009, 02:04 PM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
I've had the hdpvr working under linux for some time now, but I've never tried to get the ir blaster working, until today

I've applied the patches to the hdpvr drive and when I do a
# i2cdetect -l

it shows the following....
Code:
i2c-0	i2c       	NVIDIA i2c adapter              	I2C adapter
i2c-1	i2c       	NVIDIA i2c adapter              	I2C adapter
i2c-2	i2c       	NVIDIA i2c adapter              	I2C adapter
i2c-3	i2c       	Hauppauge HD PVR I2C            	I2C adapter
I see the HD PVR in there, but I'm not sure if it's telling me that it's working or not. The /dev/i2c-3 does exist.

EDITE:
In SageTV, when I select the hdpvr video source, I select Component, and then I choose the Infrared Blaster option and select port 3, but i just get a failed to open port message.

Any help appreciated.
Thanks.

Last edited by stuckless; 10-24-2009 at 02:15 PM. Reason: updated output when running as root....
Reply With Quote
  #6  
Old 10-25-2009, 10:40 AM
loonsailor loonsailor is offline
Sage Advanced User
 
Join Date: Jul 2009
Location: Berkeley, CA, USA
Posts: 176
Unless you're running sage as the root user, there may be a permissions problem. On my system, the i2c devices are created with permission 600, owned by root. If that's the problem, you'll need to make a udev rule to create i2c with, say, 644 permissions, or different ownership.

Have you tried accessing the port with lirc, or just cat'ing to/from it?
Reply With Quote
  #7  
Old 10-25-2009, 12:23 PM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Against my better judgement, i run the SageTV server as root

I haven't tried to use lirc... I'm not sure how i'd do that. I use lirc for my current usb blaster (ms blaster). I'll run the lirc config and see if hdpvr is in that list.

As for catting to it... not sure what i'd cat to it. I did run

Code:
# udevadm info --name=/dev/i2c-3 --attribute-walk
And it did respond with some information....
Code:
Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.

  looking at device '/devices/pci0000:00/0000:00:04.1/usb2/2-5/i2c-adapter/i2c-3/i2c-3':
    KERNEL=="i2c-3"
    SUBSYSTEM=="i2c-dev"
    DRIVER==""
    ATTR{name}=="Hauppauge HD PVR I2C"

  looking at parent device '/devices/pci0000:00/0000:00:04.1/usb2/2-5/i2c-adapter/i2c-3':
    KERNELS=="i2c-3"
    SUBSYSTEMS=="i2c-adapter"
    DRIVERS==""
    ATTRS{name}=="Hauppauge HD PVR I2C"

  looking at parent device '/devices/pci0000:00/0000:00:04.1/usb2/2-5':
    KERNELS=="2-5"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb"
    ATTRS{configuration}==""
    ATTRS{bNumInterfaces}==" 1"
    ATTRS{bConfigurationValue}=="1"
    ATTRS{bmAttributes}=="c0"
    ATTRS{bMaxPower}=="  4mA"
    ATTRS{urbnum}=="1378"
    ATTRS{idVendor}=="2040"
    ATTRS{idProduct}=="4900"
    ATTRS{bcdDevice}=="0000"
    ATTRS{bDeviceClass}=="00"
    ATTRS{bDeviceSubClass}=="00"
    ATTRS{bDeviceProtocol}=="00"
    ATTRS{bNumConfigurations}=="1"
    ATTRS{bMaxPacketSize0}=="64"
    ATTRS{speed}=="480"
    ATTRS{busnum}=="2"
    ATTRS{devnum}=="5"
    ATTRS{version}==" 2.00"
    ATTRS{maxchild}=="0"
    ATTRS{quirks}=="0x0"
    ATTRS{authorized}=="1"
    ATTRS{manufacturer}=="AMBA"
    ATTRS{product}=="Hauppauge HD PVR"
    ATTRS{serial}=="00A1FEA2"

  looking at parent device '/devices/pci0000:00/0000:00:04.1/usb2':
    KERNELS=="usb2"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb"
    ATTRS{configuration}==""
    ATTRS{bNumInterfaces}==" 1"
    ATTRS{bConfigurationValue}=="1"
    ATTRS{bmAttributes}=="e0"
    ATTRS{bMaxPower}=="  0mA"
    ATTRS{urbnum}=="90"
    ATTRS{idVendor}=="1d6b"
    ATTRS{idProduct}=="0002"
    ATTRS{bcdDevice}=="0206"
    ATTRS{bDeviceClass}=="09"
    ATTRS{bDeviceSubClass}=="00"
    ATTRS{bDeviceProtocol}=="00"
    ATTRS{bNumConfigurations}=="1"
    ATTRS{bMaxPacketSize0}=="64"
    ATTRS{speed}=="480"
    ATTRS{busnum}=="2"
    ATTRS{devnum}=="1"
    ATTRS{version}==" 2.00"
    ATTRS{maxchild}=="6"
    ATTRS{quirks}=="0x0"
    ATTRS{authorized}=="1"
    ATTRS{manufacturer}=="Linux 2.6.28-16-generic ehci_hcd"
    ATTRS{product}=="EHCI Host Controller"
    ATTRS{serial}=="0000:00:04.1"
    ATTRS{authorized_default}=="1"

  looking at parent device '/devices/pci0000:00/0000:00:04.1':
    KERNELS=="0000:00:04.1"
    SUBSYSTEMS=="pci"
    DRIVERS=="ehci_hcd"
    ATTRS{vendor}=="0x10de"
    ATTRS{device}=="0x077e"
    ATTRS{subsystem_vendor}=="0x1043"
    ATTRS{subsystem_device}=="0x82f2"
    ATTRS{class}=="0x0c0320"
    ATTRS{irq}=="21"
    ATTRS{local_cpus}=="ffffffff,ffffffff"
    ATTRS{local_cpulist}=="0-63"
    ATTRS{modalias}=="pci:v000010DEd0000077Esv00001043sd000082F2bc0Csc03i20"
    ATTRS{broken_parity_status}=="0"
    ATTRS{msi_bus}==""

  looking at parent device '/devices/pci0000:00':
    KERNELS=="pci0000:00"
    SUBSYSTEMS==""
    DRIVERS==""
thanks
Reply With Quote
Reply


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

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
Linux OEM Server Tips and Tricks bcjenkins SageTV Linux 10 09-27-2009 07:25 AM
SageTV Server Tips For XP?? Stuntman SageTV Software 3 03-11-2008 10:14 AM
Linux related tips, info, how-to, etc. Opus4 SageTV Linux 0 02-11-2008 09:57 PM
SageTV Tweaks & Tips For A Newbie Please HELP! ccerj8 SageTV Software 14 01-13-2005 01:21 PM
Tips for Hipix control with SageTV Mark Lamutt Hardware Support 9 11-03-2003 10:35 AM


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


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