Analog TV

Analogue TV has been disappeared so it is time to digitalizes old analogue videos using a analogue TV card.

Analogue TV cards get usually modulated video channels from an antenna input using their tuner. Often they support also a not modulated analogue video signal via a dedicated input.

For digitalizing passing the not modulated video has some advantages: Better quality, no fiddling round with tuner and channel list setup. Audio can be passed to the standard audio card so no audio setup of the TV card is required.

Create kernel that supports the tv card and mark the driver as module to pass arguments to the driver. For help see: https://www.linuxtv.org/

For gentoo Linux set the v4l useflag to get support for Video 4 Linux.

To not make test with an antique VCR and then when ready it brakes due to a transmission rubber belt, a Raspberry (set resolution to 640*480) can be taken using a HDMI to video converter to get analog video and audio. VLC playing an Internet radio stream gets the audio.

No auto detected TV cards

TV cards are a combination of tuner and TV-decoder chip, there are various combinations but not all can be auto detected correctly. The drivers are based on the main chips and are written universally to work with all kinds on tuners. Check out:

/usr/src/linux/Documentation/video4linux

If the card isn't auto detected correctly, the missing information can be passed when loading the driver.

modprobe<drivername> radio=<radio number> card=<card number> tuner=<tuner number>

Check with dmesg | grep <driver name> that the parameters had been passed to the module.

Analog cards

Driver BTTV

Create a kernel with the bttv (BT848 Video For Linux) built as module, so you can pass command line parameters.

Card: Pinnacle PCTV

Check for the card and tuner number

/usr/src/linux/Documentation/video4linux/bttv

card=39 - Pinnacle PCTV Studio/Rave

tuner=0 - Temic PAL (4002 FH5)

Info about the device driver

modinfo /lib/modules/$(uname -r)/kernel/drivers/media/video/bttv.ko

Since the card is not auto detected load the driver manually:

modprobe bttv radio=0 card=39 tuner=0 gbuffers=32

If it is already loaded consider to unload it with rmmod bttv since the required arguments might not have passed. Not knowing the correct tuner makes the card unusable.

To have it started correctly put the lines

modules_3="${modules_3} bttv
module_bttv_args_3="radio=0 card=39 tuner=0 gbuffers=32"

in /etc/conf.d/modules.

Figure 12.4. PCTV

BT


Audio can be supported by connecting an internal audio cable from the vt card to the motherboard as shown in the above photo or by plug-in externally a 3.5mm Audio cable into the tv card an feed it to the external line in socket of the PC's audio card.

To checkout the card run as regular user mplayer tv:// -tvscan autostart and note a channel as channels=R6-ch1. Finally q brings you back.

To watch

mplayer tv:// \ -tv driver=v4l2:device=/dev/video0:width=768:height=576:channels=R6-ch1

To record a raw stream gets tricky when also audio has to be recorded. So two devices are required the tv card for the video and the sound card for the audio. To get the video without sound:

mencoder tv:// -tv \

driver=v4l2:device=/dev/video0:outfmt=yuy2:adevice=default:alsa:forceaudio \

-vc rawyuy2 -nosound -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=3200 -o output.avi

And to get the audio from the first alsa device hw.0,0 you need to enable the line input capture switch and set a good volume.

mencoder tv:// -tv \

driver=v4l2:device=/dev/video0:outfmt=yuy2:adevice=default:alsa:forceaudio:\ amode=0:\

adevice=hw.0,0 -vc rawyuy2 -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=3200 -oac \

mp3lame -lameopts cbr:br=128:mode=0 -o output.avi

It might happen that audio and video get out of sync using this approach, to fix that there is avifix -i reits-parijs.avi -f 2487,100

Ctrl-c stops the well working mencoder, if it does not stop then something is wrong like the audio.

Driver SAA7134

lspci shows Multimedia controller: Philips Semiconductors SAA7134/SAA7135HL Video Broadcast Decoder (rev 01)

The TV Card EASYLITE identifies itself as LifeView FlyVIDEO3000

Its internals are not auto-detected. Therefore it has to be done manually.

In Kernel 5.4.48 do cd /usr/src/linux/Documentation/media/v4l-drivers/ and check saa7134.rst

saa7134-cardlist.rst gives

card= 2

The tuner on the card is TNF-9935-B/DFF that is not listed in /usr/src/linux/Documentation/media/v4l-drivers/tuner-cardlist.rst but

is similar and works (61 works as well but no FM radio support). To test load the driver manually:

tuner= 69

Create a kernel that has the driver as module with CONFIG_VIDEO_SAA7134 so the correct card and tuner parameters can be passed as arguments.

Check dmesg | grep 7134 to see what the kernel did.

If after booting lsmod shows that it is already loaded try to unload it with rmmod saa7134

modprobe -v saa7134 card=2 tuner=69

To have this done automatically create a file /etc/modprobe.d/tv.conf with the line.

options saa7134 card=2 tuner=69  

Do not use OpenRC to load the module since the kernel will load the module before this.

Start mplayer tv:// -tv device=/dev/video0 and what what is written in the console as video input. Finally q brings you back.

mplayer tv:// -tv device=/dev/video0:input=3 will get the video from the composite2 input.

To get the audio, the audio input of the card can be used using the saa7134_alsa driver or any other audio card having a line input can be used.

Recording video and audio can be done with mencoder tv:// -tv \ driver=v4l2:device=/dev/video0:input=3:outfmt=yuy2:adevice=plughw.0,0:alsa \

-vc rawyuy2 -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=3200 -oac mp3lame \

-lameopts cbr:br=128:mode=0 -o output1.avi

Note

This takes the audio from card 0 device 0 that is probably an other sound card as aplay -l would show. plughw:0.0 needs to be replaced by plughw,0.0

Important

alsamixer must be adjusted so the gain is not too high and other capture devices are off.

To checkout signals from the antenna run mplayer tv:// -tvscan autostart and note some channel as channels=R6-ch1,SR2-ch2. R6 is the channel ch1 is the name.

To watch (k and h zap through the channels)

mplayer tv:// \

-tv driver=v4l2:device=/dev/video0:width=768:height=576:channels=R6-ch1,SR2-ch2

Figure 12.5. SAA3134

Fly


saa7134 alsa

This card is also detected as additional alsa card, so check if the soundsystem is still working. Maybe it misses the loudspeakers on this tv card so it will be quiet. So test alsa and configure it to have the soundcard as card 0 and this tv card as card 1.

Probably no sound comes.

There are two options:

  1. Cable between audio out of the tv card and audio in of the soundcard. This occupies the socket audio in of the soundcard, and puts the work when digitizing sound to the soundcard and not the tv card. It is also expected that the sound quality will decrease.

    With the jumper cable two sound cards are involved:

    1. TV card sound output (sound level can be adjusted and can be muted)

    2. Line in of the sound card where the loudspeakers are (where the sound level can be adjusted and also can be muted). Additionally there is the capture sound level used for recording, that also can be muted.

    There are so many parameters to be adjusted, so some luck is required! In case of troubles replace the jumper cable with a headphone to listen what comes out of the TV card and on the other end plug in via jumper cable a MP3 player that pumps sound into the sound card, so it can determined, if the problem is with the TV card or the sound card or both.

  2. Use the alsa sound on the tv card. If not already loaded modprobe saa7134_alsa. Doing this or it has been automatically done, results in adding a new sound card to the computer, watch out that the sequence of sound card is not get messed up. The sound gets to the tv cards audio chip, but does not find the way to the soundcards loudspeakers.

    A way out is the following command that reads from the TV card, writes it into a buffer and that reads it out of the buffer from your sound card. It basically replaces the jumper cable.

    arecord -D hw:1,0 -r 32000 -c 2 -f S16_LE | aplay -

To record video (until Ctrl+C) with sound from the tv card

mencoder tv:// -tv \ driver=v4l2:device=/dev/video0:outfmt=yuy2:adevice=default:alsa:forceaudio \

-vc rawyuy2 -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=3200 -oac mp3lame \

-lameopts cbr:br=128:mode=0 -o output.avi

FM

For the on board FM radio check that the module tuner is loaded and fmtools that includes the fm and the fmscan application. Type fmscan and not how it finds station by printing their frequency and level to the screen. To listen type fm 99.8 to get the radio at 99.8 MHz with default volume. To have something nicer gnomeradio.

There is also the program radio that has a user interface in the console. It comes with xawtv. Since it does not find the radio type radio -c /dev/radio0.

gnomeradio holds all its setting in ~/.gconf/apps

To record it is important to set the mixer input appropriate. In the mixer applications the red lights for line and capture should be on.

TV Applications

The classic TV application is xawtv that has some not obvious and ugly user interface behavior. Arrow up and down select channels, mouse click left and right when mouse cursor is over slide bar increases and decreases (e.g. brightness). Capture in the pop up menu lets you select how the video comes to the screen, probably not all works so try out. Select some tv stations and save it, the result will be in ~/.xawtv, so next time it keeps up on running.

xawtv -hwscan

xawtv -nodga -c /dev/video0

If you like to have something less ugly lookingemerge tvtime or put a home theater application as vdr or mythtv or use the standard tv application that comes with your desktop environment. Or use mplayer on the command line or with some front-end.

tvtime

tvtime is a nice looking tv application that does not depend on the desktop environment. Configuration is done via menu as well as scanning the channels.

Figure 12.6. Tvtime

TV time


AleVT

Alevt is a standalone video text (VT) application (or teletext).

Make sure the use flag zvbi is set, so also other applications will get video text support.

Check that daemons such as nxtvepg or even other TV programs are not running, since they can obviously occupy the video text decoder circuitry in the TV card and therefore aleVT can not access it and will not work. Unfortunately aleVT does not give an error message in this case.

Figure 12.7. Aletv

Aletv


A channel must be tuned in as when watching TV

alevt was written for analog cards, with

alevt -vbi /dev/vbi0

However the new versions work also for digital cards:

alevt -vbi /dev/dvb/adapter0/demux0


Linurs startpage