LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   tv card: bad quality in TVTime (https://www.linuxquestions.org/questions/linux-hardware-18/tv-card-bad-quality-in-tvtime-393977/)

huepfendes_schaf 12-17-2005 04:14 PM

tv card: bad quality in TVTime
 
Hi
I have a Pinnacle pctv usb2 tv card. I have installed the v4l2 driver with the em2820 module from (linuxtv.org). I have to use sox(sox -t ossdsp -r 48000 -b -c 2 /dev/dsp2 -t ossdsp /dev/dsp) to make the sound work.
Now the card works, but the quality of most senders is very bad. I use tvtime. In windows the quality is good.

In some senders, the sound is so bad that I can't understand anything.(even if I use finetune), but the pictures are ok.

With other senders I can receive a good sound quality with finetune, but with this adjustement, the pictures are bad and when I adjust that the pictures are good, the sound is bad. So I can choose between a good sound or good pictures, but both together doesn't work.

Some rare senders work perfectly.

Electro 12-17-2005 07:29 PM

Please describe these "senders". If they are media players, you can try using MPlayer or Xine. Really USB has high latency for multimedia transfer, so I suggest using Firewire.

Try using a DV camcorder that has analog to digital pass-thru if you want high quality. If you can use a PCI card, I suggest any card based on Philips SAA713x chip. Conexant based video captures cards decodes poor video quality or grainy video.

laurentwahl 12-18-2005 04:09 AM

I have the same problem as you, huepfendes_schaf.

This pinnacle tv-card annoyes me so much, it took me such a long time to make it work and the quality is awful. I would be glad if somebody could help.

huepfendes_schaf 12-18-2005 04:16 AM

Quote:

Originally Posted by Electro
Please describe these "senders".

The senders where the sound doesn't work at all have the band UHF, like for example DSF:
<station name="dsf" active="1" position="95" band="UHF" channel="U24" finetune="-3"/>

A sender where the adjustement of best audio and best video aren't together is e.g. RTL:
<station name="RTL" active="1" position="6" band="VHF E2-E12" channel="E6" finetune="16" norm="PAL" audio="bg"/>

I live in Switzerland.


Quote:

Originally Posted by Electro
If they are media players, you can try using MPlayer or Xine.

In mplayer I don't receive any sound, even with sox. I used the command:
mplayer -tv driver=v4l2:amode=0:input=0:norm=PAL:outfmt=yuy2:forceaudio:immediatemode=0 tv://

In xine I didn't succeed to make the tv work. Perhaps somebody can give me some advice, because I didn't find a good howto an google.


Quote:

Originally Posted by Electro
Really USB has high latency for multimedia transfer, so I suggest using Firewire.
Try using a DV camcorder that has analog to digital pass-thru if you want high quality. If you can use a PCI card, I suggest any card based on Philips SAA713x chip. Conexant based video captures cards decodes poor video quality or grainy video.

I have no firewire an no DV camcoder, an don't want to buy anything of this stuff, because in windows it works, so there must be a way to make it work in Linux.

Electro 12-18-2005 02:27 PM

Try the following command. I added a video filter so mplayer will not convert back to yv12 and lose video quality and you can get some acceleration from the video card. The command may work with audio sync lagging behind the vidoe or may not work. Play around with command. You do need xawtv and its utilities.
v4lctl setattr mute 0 ; mplayer -tv driver=v4l2:amode=0:input=0:norm=PAL:outfmt=yuy2:forceaudio:immediatemode=0 -audiofile /dev/dsp2 -audio-cache 8192 -channels 1 -rawaudio on:channels=1:rate=48000 -vf scale=-1,-1:yuy2 -ao oss:dsp-device=/dev/dsp -vo xv tv:// && v4lctl setattr mute 1

Another way is to use mencoder and pipe it to mplayer. There will be some video lag time if you compare what is recieved by a regular TV.

The TV viewing programs in Linux was written for a PCI card that has a loop cable going towards a sound card. This is the reason why I suggest a PCI video capture in the first place. You want to stick with a USB video capture device. That is fine, but you are on your own. If you know how to program, you can make a TV viewing program that works with these types of devices.

Electro 12-18-2005 03:00 PM

Quote:

The senders where the sound doesn't work at all have the band UHF, like for example DSF:
<station name="dsf" active="1" position="95" band="UHF" channel="U24" finetune="-3"/>

A sender where the adjustement of best audio and best video aren't together is e.g. RTL:
<station name="RTL" active="1" position="6" band="VHF E2-E12" channel="E6" finetune="16" norm="PAL" audio="bg"/>

I live in Switzerland.
They are not called senders. All you are doing is changing channel E6 frequency about 16 steps higher. The steps is designated by the tuner in hardware or by module (driver). For the audio informaiton, they come in as different stations for each channel (I think). The program sox is not able to change to different audio stations. It is up to the TV viewing program to do this or use xawtv utilities. A USB devices depends on software more than PCI cards, so that is one reason why I suggest getting a PCI card.

I live in the US where we use NTSC and there are no audio stations that is carry along the TV channels. The audio is carried on a FM signal at a fixed frequency. The TV channels are very accurate sending at a certain RF, so fine tunning is not needed.

You can try using MythTV if mplayer does not work.

huepfendes_schaf 12-19-2005 10:00 AM

With the command: "v4lctl setattr mute 0" and with sox I receive sound in mplayer.
But I receive some errors with your mplayer command.
The option "-audiofile /dev/dsp2" provides:
Quote:

audio block size too low, setting to 8192!
v4l2: ioctl query control failed: Invalid argument
Win32 LoadLibrary failed to load: avisynth.dll, /usr/lib/win32/avisynth.dll, /usr/local/lib/win32/avisynth.dll
and the option "-audio-cache":
Quote:

Unknown option on the command line: audio-cache
and the option "-rawaudio on" gives:
Quote:

Video: no video
And "-vf scale=-1,-1":
Quote:

Option vf: -1 doesn't exist.
and: "-vf yuy2":
Quote:

The h option must be an integer: yuy2
Option vf: Error while parsing scale parameter h (yuy2)
And finally with the persisting options:
"mplayer -tv driver=v4l2:amode=0:input=0:norm=PAL:outfmt=yuy2:forceaudio:immediatemode=0 -channels 1 -rawaudio channels=1:rate=48000 -vf scale=-1 -ao oss:dsp-device=/dev/dsp tv://"
I receive the pictures with the sound. But I don't yet see the advantages of this complicated command, compared to the command:
"mplayer -tv driver=v4l2:amode=0:input=0:norm=PAL:outfmt=yuy2:forceaudio:immediatemode=0 tv://"
I think that the first command has more channels, but I didn't have yet the time to compare the quality. But I saw already that the quality of some channels is still bad, but I think that other channels are better.

Sorry for my english. Now I know that the channels are not senders :-)

huepfendes_schaf 12-19-2005 11:45 AM

the channels, where I didn't understand anything in tvtime, are as bad in mplayer.

in mplayer I receive often the message:
Quote:

too bad - dropping audio frame !
and I receive often the message
Quote:

video buffer full - dropping frame
When one of these messages comes once, it keeps coming continuously till I quit the program.

Electro 12-19-2005 10:53 PM

I did say you have to play around the settings. Did you ever check man mplayer.

The following command does two things. One it previews the video in a window and it plays the audio stream with out the need for sox. I changed it and add a few things like using larger cache to compensate for high latency that USB has.
mplayer -tv driver=v4l2:amode=0:input=0:norm=PAL:outfmt=yuy2:forceaudio:immediatemode=0 -channels 1 -rawaudio channels=1:rate=48000 -vf scale=-1:-1,yuy2 -audiofile-cache 8192 -cache 32768 -cache-min 25 -ao oss:dsp-device=/dev/dsp tv://

You do need a lot of memory to do the command above. I think it may be better to change outfmt to some RGB color space. I suggest doing mplayer -tv outfmt=help to get a list of supported colorspace for your video capture device.

I still recommend that you get a PCI video capture card so you do not have any future problems.

huepfendes_schaf 12-20-2005 01:49 PM

I have only a laptop,so I can't buy a pci card.

I read the man of player but I am quite a newbie in linux, so I don't understand everything and there is not written everything. For example you said to use -ao dsp-device=/dev/dsp. In the man is nothing written of this suboption:
Quote:

-ao <driver1[:suboption1[=value]:...],driver2,...[,]> Specify a priority list of audio output drivers to be used.

If the list has a trailing ’,’ MPlayer will fall back on drivers not contained in the list. Suboptions are optional and can mostly be omitted.
NOTE: See -ao help for a list of compiled-in audio output drivers.

EXAMPLE:
-ao alsa,oss,
Try the ALSA driver, then the OSS driver, then others.
-ao alsa:mmap:noblock:device=hw=0.3
Sets noblock-mode, mmap-mode and the device-name as first card, fourth device.

Available audio output drivers are:

alsa
ALSA 0.9/1.x audio output driver
mmap
Sets experimental mmap-mode (does not work for more than 2 channels).
noblock
Sets noblock-mode.
device=<device>
Sets the device name. Replace any ’,’ with ’.’ and any':’ with ’=’ in the ALSA device name. Make sure you do not set this when you want hwac3 output via S/PDIF, unless you really know how to set it correctly.

alsa5
ALSA 0.5 audio output driver

oss
OSS audio output driver
dsp-device
Sets the audio-output device (default: /dev/dsp).

and so on...
So now I don't know how the right command is, because with the command you proposed I receive:
Quote:

[AO OSS] audio_setup: Can't open audio device dsp-device=/dev/dsp: No such file or directory
Could not open/initialize audio device -> no sound.
Audio: no sound
Without the dev-device= command, I can hear my microphone. So could you please give me some advice, or where can I see a manual of all the suboptions, because I couldn't find one.

Thanks for your help electro

Electro 12-20-2005 03:46 PM

Quote:

I have only a laptop,so I can't buy a pci card.
You should of said this before.

I did not include -ao dsp-device=/dev/dsp. I included -ao oss:dsp-device=/dev/dsp. Not all distributions set /dev/dsp to /dev/dsp0 by a symbolic link. Also if you get device busy for /dev/dsp0. You will have to close the program(s) that is using it and then run it again. Laptop sound can only handle one PCM (audio) at a time. To ge around this issue is to use artsd or alsa dmix library.

If you have a desktop computer and it has an open PCI slot, use a MPEG-1/MPEG-2 PVR or bt878 based video capture card. Then use Video Lan Client to broadcast the video to your notebook computer. I suggest a PVR card because you can setup a web server and write a perl script to change the TV channels or switch to other inputs.

Have you looked in using PCMCIA.

Sorry about the simile in the mplayer syntax. Below is with out the simile enabled.
mplayer -tv driver=v4l2:amode=0:input=0:norm=PAL:outfmt=yuy2:forceaudio:immediatemode=0 -channels 1 -rawaudio channels=1:rate=48000 -vf scale=-1:-1,yuy2 -audiofile-cache 8192 -cache 32768 -cache-min 25 -ao oss:dsp-device=/dev/dsp tv://

gradedcheese 12-21-2005 12:37 AM

huepfendes_schaf -- slightly off-topic but did you try the composite video input on this card? I am looking for a way to get composite video on my laptop so I am wondering if that part of this card works well. I posted a question about it here:

http://www.linuxquestions.org/questi...d.php?t=395117

huepfendes_schaf 12-21-2005 07:31 AM

Quote:

Originally Posted by Electro
I did not include -ao dsp-device=/dev/dsp. I included -ao oss:dsp-device=/dev/dsp. Not all distributions set /dev/dsp to /dev/dsp0 by a symbolic link. Also if you get device busy for /dev/dsp0. You will have to close the program(s) that is using it and then run it again. Laptop sound can only handle one PCM (audio) at a time. To ge around this issue is to use artsd or alsa dmix library.

Yes I made it like you said too, in the post I only forgot to mention it, because I receive almost the same error if I add "oss" or not. With "-ao oss:dsp-device=/dev/dsp" I receive:
"[AO OSS] audio_setup: Can't open audio device dsp-device=/dev/dsp: No such file or directory
Could not open/initialize audio device -> no sound.
Audio: no sound"

It was clear to me, that I only can run one programm which uses oss. This is not the Problem

Many thanks Electro


To gradedcheese:
The composite audio works with tvtime and sox perfectly. I couldn't test the video yet, but this week-end, when I go home from school, I will test it. then I tell you if it works. But I am pretty sure that it works.

huepfendes_schaf 12-23-2005 07:03 AM

I succeeded now to make the sound work without sox. I only have to use the option "alsa:adevice=hw.2" (because it's the /dev/dsp2)
Quote:

v4lctl setattr mute 0
mplayer -tv driver=v4l2:amode=0:input=0:norm=PAL:alsa:adevice=hw.2:outfmt=yuy2:forceaudio:immediatemode=0 -channels 1 -rawaudio channels=1:rate=48000 -vf scale=-1:-1,yuy2 -audiofile-cache 8192 -cache 32768 -cache-min 25 -ao oss tv://
But in the channels where the sound didn't work with sox, it still don't work. How can I finetune a channel in mplayer? I haven't found such a function in mplayer? Any advice?

Electro 12-23-2005 05:15 PM

You might want to use freq for each channel. You can not change channels if you use this setting. To get around this issue, you can try making a perl or python script that closes and opens up mplayer for every channel. The hard part is finding the channel's frequency.


All times are GMT -5. The time now is 12:26 AM.