Monday, July 6, 2009

Switching display resolution for hdtv watching

While watching tv using the hdtv usb tuner mentioned in my previous posts, I noticed that some programs which have a native resolution of 720p come in a smaller box in the middle of the screen.
On the other hand the programs with 1080i native resolution comes beautifully to fill the screen.

I figured out that if use the nvidia-settings interface of my Nvidia gpu and and set panning to 1552x964 in 'X server Display Configuration'-> 'Advanced', my whole desktop becomes of resolution 1552x964 of which only the 1152x864 (the original resolution) portion is displayed on my screen. The hidden portion can be revealed by moving the mouse. Thus using the mouse I could position the 720p video to fill the screen. Nice.

Now the question is how to make the switch easy using command-line.
We are in luck.
Go to ftp://download.nvidia.com/XFree86/nvidia-settings/ and downloaded
nvidia-settings-185.18.14.tar.gz

sudo apt-get install libxxf86vm-dev ( dependency to make nvidia-settings)
tar zxvf nvidia-settings-185.18.14.tar.gz
make
cd samples
make
sudo cp nv-control-dpy /usr/local/bin

nv-control-dpy --add-metamode "1152x864_75 @1552x964 +0+0"
This adds the necessary meta mode to the Nvidia card.


nv-control-dpy --print-metamodes
This prints out the current metamodes. Note down the id of the added metamode.
In my case it was 107. Nvidia uses the frame-rate to store the id.


xrandr --output default --mode 1552x964 --rate id
will switch to the required screen mode and resolution. Replace the id with the actual id noted in the previouse step (107 for me).
To go back note down the metamode id of the original resolution and call xrandr again

xrandr --output default --mode 1152x864 --rate id

Some scripts with more functionality and more details are available here
http://ubuntuforums.org/showthread.php?t=922956

Happy watching.

Arun

Sunday, July 5, 2009

AverMedia AverTV Hybrid Volar Max (H826D)

I bought an AverMedia usb tuner stick. It works really well in Ubuntu 9.04 with the driver provided on their web site. I get above 30 digital channels with an external antenna. I am 10 miles from DC. After enjoying some crisp HD pictures (1080i) and the 5.1 digital surround audio free over the air (OTA) what better thing to do than to open it up and see what is inside?
Here it goes.







The pictures are taken at night, so excuse the quality.
The main chips used are:

LGDT3304 - ATSC (digital tv) decoder
NXP TDA18271HDC2 - tuner
SAA7136E/1/G - analog demodulator
CY7C68013A - usb driver, 8051 microcontroller

Hauppauge HVR 950Q usb hd/analog tv stick under Ubuntu

Hi,
I got the HVR 950q working under Ubuntu 8.04 Hardy Heron. Both analog and atsc digital are working. I am using 2.6.24-23-generic kernel. The procedure I followed is:

1. download and install the cvs version of v4l-dvb (http://linuxtv.org/hg/v4l-dvb) .

2. download the firmwaredvb-fe-xc5000-1.6.114.fw from http://kernellabs.com/firmware/xc5000/ and copy to /lib/firmware/2.6.24-23-generic .

3. Channel scan works only with the versions of Kaffeine greater than 0.8.6 .
Download the 0.8.8 sources from http://kaffeine.kde.org/. Configure, make and install. Before compilation it is important to copy the file linux/include/linux/dvb/frontend.h from the v4l-dvb source tree to /usr/include/linux/dvb/frontend.h. (See http://ubuntuforums.org/showthread.php?t=1098016 for a list of dependencies needed to compile Kaffeine.)

4. You may need to reboot first. Connect the 950Q stick, fire up Kaffeine, see in dmesg that the firmware is getting loaded. Scan for channels and get ready for the show.

Arun


#########
For reference:
The dmesg gives the following output:
usb 1-3: new high speed USB device using ehci_hcd and address 6
[66364.034517] usb 1-3: configuration #1 chosen from 1 choice
[66364.396092] au0828: i2c bus registered
[66364.663852] tveeprom 3-0050: Hauppauge model 72001, rev B3F0, serial# 6158723
[66364.663858] tveeprom 3-0050: MAC address is 00-0D-FE-5D-F9-83
[66364.663862] tveeprom 3-0050: tuner model is Xceive XC5000 (idx 150, type 76)
[66364.663865] tveeprom 3-0050: TV standards NTSC(M) ATSC/DVB Digital (eeprom 0x88)
[66364.663869] tveeprom 3-0050: audio processor is AU8522 (idx 44)
[66364.663872] tveeprom 3-0050: decoder processor is AU8522 (idx 42)
[66364.663875] tveeprom 3-0050: has no radio, has IR receiver, has no IR transmitter
[66364.663878] hauppauge_eeprom: hauppauge eeprom: model=72001
[66364.754291] au8522 3-0047: creating new instance
[66364.754296] au8522_decoder creating new instance...
[66364.775858] tuner 3-0061: chip found @ 0xc2 (au0828)
[66364.777820] xc5000 3-0061: creating new instance
[66364.783578] xc5000: Successfully identified at address 0x61
[66364.783583] xc5000: Firmware has not been loaded previously
[66364.784524] au8522 3-0047: attaching existing instance
[66364.795598] xc5000 3-0061: attaching existing instance
[66364.801072] xc5000: Successfully identified at address 0x61
[66364.801077] xc5000: Firmware has not been loaded previously
[66364.801082] DVB: registering new adapter (au0828)
[66364.801087] DVB: registering adapter 0 frontend 0 (Auvitek AU8522 QAM/8VSB Frontend)...
[66364.801540] Registered device AU0828 [Hauppauge HVR950Q]
###################

My experience with HDTV usb sticks

I could install 950Q under ubuntu 9.04 (earlier under 8.04 also). I used the cvs version of v4l-dvb (checked out Jul-4-09). I use kaffeine 0.8.8 to tune and watch. It works fine in the sense that I am able to watch crisp 1080i video with 5.1 Dolby audio. The experience is fantastic.
Though there are some issues which I would like to share:

1. Once a channel is tuned to, for several tens of seconds I keep getting patches in the video similar to a weak signal. But the signal is strong. Another usb stick that I tried (AVerMedia) works fine with the same antenna.

2. On HD channels the audio doesn't come on for an unpredictable amount of time after tuning in. If I pause and unpause the audio seems to come quickly.

3. SNR reading and epg don't work.

4. Signal strength LED doesn't seem to work. On strong strations, if I bring up the channel tuning window (by pressing c) the LED will quickly become green.

5. Overall my impression is that the reception stability (video interference due to may be multipath, other channel interference, or tuning stability) of Hauppauge 950Q is poorer compared to AVerMedia AverTV Hybrid Volar Max (H826D) whose driver provided on their site just worked (except the epg and FM).

Arun