Available for testing: Kbtv -- KDE TV viewer for bktr

Danny Pansters danny at ricin.com
Thu Nov 3 14:57:52 PST 2005


On Thursday 3 November 2005 19:40, you wrote:
> On Thu, 3 Nov 2005 20:11:50 +0200
>
> Ion-Mihai Tetcu <itetcu at people.tecnik93.com> wrote:
> > On Thu, 3 Nov 2005 19:39:38 +0200
> >
> > Ion-Mihai Tetcu <itetcu at people.tecnik93.com> wrote:
> > > > >  > /var/ports/kbtv/bin/kbtv
> > > > >
> > > > > Traceback (most recent call last):
> > > > >   File "kbtv.py", line 428, in ?
> > > > >     btc = BTControl()
> > > > >   File "/var/ports/kbtv/share/apps/kbtv/btcontrol.py", line 115,
> > > > > in __init__ self.probeTuner()
> > > > >   File "/var/ports/kbtv/share/apps/kbtv/btcontrol.py", line 146,
> > > > > in probeTuner vsrc = int(__btcontrol_get__("videosource"))
> > > > > ValueError: invalid literal for int(): btcontrol: not found
> > > > >
> > > > >
> > > > > Note that I've build with PREFIX=/var/ports/kbtv
> > > >
> > > > You're using a non-i386 box, right? This is due to a bug in
> > > > btcontrol.c. I forgot to include <sys/param.h>. I just uploaded a
> > > > new tarball alpha2 (note that the port changed as well).
> > >
> > >  # uname -rp 6.0-RC1 i386
> >
> > The same (minus line numbers).
> >
> > I have the feeling it's not PREFIX clean.

I'll look into this later, it's not essential ATM.

> Yup. Installed with standard PREFIX it starts OK.
>
>  # sysctl hw.bt848.
> hw.bt848.slow_msp_audio: -1
> hw.bt848.format: -1
> hw.bt848.reverse_mute: -1
> hw.bt848.tuner: 10
> hw.bt848.card: 11
>
>  > cat .mplayer/config
>
> # Write your default config options here!
> skin = Blue
> fs = no
> tv=driver=bsdbt848:width=768:height=576:device=/dev/vbi:input=1:norm=PAL:ch
>anlist=europe-east:channels=E8-A1,E9-TVR1,E11-TVR2,SE19-B1,SR2-NationaTV,E10
>-Prima,E12-ProTV,SE3-NationalTv,25-TVRCultural,SE11-AXN,SE6-Halmark,SE10-Car
>toon/TCM,22-ProCinema,SE4-RealitateaTv,SE7-A3,27-N24,37-EuroNews,S23-BBCWorl
>d,23-CNN,SE17-EuroSport,SE18-Discovery,24-Senso,SE5-NationalGeographic,SE14-
>AnimalPlanet,S22-Mezzo,SE8-TvK,E5-U,SE15-Animax/CherryMusic,26-VH1,SE2-MTv,2
>8-TV5,S26-F2,SE20-Jetix/ESPN,S25-Extreme,29-Explorer,30-FashionTv,32-Romanti
>ca,33-DDTV,35-Duna,36-RaiUno,E6-RCS,E7-Acasa,SE16-OTv,S27-TVE,S28-Pro7,S29-T
>eleShop,21-EtnoTV,S21-CanalTeleshopTv,S24-RTL:audioid=1
>
> With this settings ``mplayer tv://'' works as it should.
>
>
> Now the problem is that it doesn't show any image: bktv window is
> green, it opens a blue mplayer window and that's all. I get the sound
> OK for the first channel (E8-A1).

Can you try renaming or removing ~/.mplayer/config or commenting the "tv=" 
lines out. I've made no use of chanlist, instead I set freq=0 and chanlist 
and freq are mutually exclusive options.

>  > btcontrol get videosource; btcontrol get channelset; btcontrol get
>
> channel; btcontrol get frequency; btcontrol get audiosource
> 14001

Note: btcontrol can use channelset but kbtv only uses frequencies.

> (BTW, could we have: a new line \n at after the outputed number;
> eventually ``btcontrol get all'' ).

A \n sounds good, but it is not so handy if you want to call btcontrol from a 
program or script. I might change it...

"get all" is a no.

> This is console output:
>  > kbtv
>
> MPlayer 1.0pre7try2-3.4.4 (C) 2000-2005 MPlayer Team
> CPU: Advanced Micro Devices Athlon MP/XP Thoroughbred (Family: 6, Stepping:
> 1) Detected cache-line size is 64 bytes
> CPUflags:  MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 1 SSE: 1 SSE2: 0
> Compiled for x86 CPU with extensions: MMX MMX2 3DNow 3DNowEx SSE
>
>
> Playing tv://.
> TV detected! ;-)
> Selected driver: bsdbt848
>  name: Brooktree848 Support
>  author: Charles Henrich
>  comment: in development
> TV channel names detected.
> Selected channel: E8 - A1 (freq: 196.250)
> MPlayer 1.0pre7try2-3.4.4 (C) 2000-2005 MPlayer Team
> CPU: Advanced Micro Devices Athlon MP/XP Thoroughbred (Family: 6, Stepping:
> 1) Detected cache-line size is 64 bytes
> CPUflags:  MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 1 SSE: 1 SSE2: 0
> Compiled for x86 CPU with extensions: MMX MMX2 3DNow 3DNowEx SSE
>
>
> Failed to open /dev/rtc: Device busy (it should be readable by the user.)

I assume that this is not an issue for you. I don't see this (but I use 
mplayer built with runtime cpu detection).

> Playing tv://.
> TV detected! ;-)
> Selected driver: dummy
>  name: NULL-TV
>  author: alex
> Selected input hasn't got a tuner!
> ID_VIDEO_ID=0
> ID_FILENAME=tv://
> ID_VIDEO_FORMAT=YV12
> ID_VIDEO_BITRATE=0
> ID_VIDEO_WIDTH=768
> ID_VIDEO_HEIGHT=576
> ID_VIDEO_FPS=25.000
> ID_VIDEO_ASPECT=0.0000
> ID_LENGTH=0
> vo: X11 running at 1152x864 with depth 24 and 32 bpp (":0" => local
> display) Opening video filter: [crop w=768 h=574]
> Crop: 768 x 574, -1 ; -1
> ==========================================================================
> Opening video decoder: [raw] RAW Uncompressed Video
> VDec: vo config request - 768 x 576 (preferred csp: Planar YV12)
> VDec: using Planar YV12 as output csp (no 0)
> Movie-Aspect is 1.33:1 - prescaling to correct movie aspect.
> VO: [x11] 768x574 => 768x574 Planar YV12  [zoom]
> X11 error: BadAccess during XSelectInput Call
> X11 error: The 'ButtonPressMask' mask of specified window has probably
> already used by another appication (see man XSelectInput) X11 error:
> MPlayer discards mouse control (reconfiguring)
> X11 error: BadAccess during XSelectInput Call
> X11 error: The 'ButtonPressMask' mask of specified window has probably
> already used by another appication (see man XSelectInput) X11 error:
> MPlayer discards mouse control (reconfiguring)
> SwScaler: using unscaled Planar YV12 -> BGRA special converter
> Selected video codec: [rawyv12] vfm:raw (RAW YV12)
> ==========================================================================
> Audio: no sound
> Starting playback...
> Selected font is fixed-width.
> ID_VIDEO_ID=0
> START
> ID_FILENAME=tv://
> ID_VIDEO_FORMAT=UYVY
> ID_VIDEO_BITRATE=0
> ID_VIDEO_WIDTH=768
> ID_VIDEO_HEIGHT=576
> ID_VIDEO_FPS=25.000
> ID_VIDEO_ASPECT=0.0000
> ID_LENGTH=0
> vo: X11 running at 1152x864 with depth 24 and 32 bpp (":0" => local
> display) Opening video filter: [crop w=768 h=574]
> Crop: 768 x 574, -1 ; -1
> ==========================================================================
> Opening video decoder: [raw] RAW Uncompressed Video
> VDec: vo config request - 768 x 576 (preferred csp: Packed UYVY)
> Could not find matching colorspace - retrying with -vf scale...
> Opening video filter: [scale]
> VDec: using Packed UYVY as output csp (no 0)
> Movie-Aspect is 1.33:1 - prescaling to correct movie aspect.
> SwScaler: reducing / aligning filtersize 1 -> 4
> SwScaler: reducing / aligning filtersize 1 -> 4
> SwScaler: reducing / aligning filtersize 1 -> 1
> SwScaler: reducing / aligning filtersize 1 -> 1
>
> SwScaler: BICUBIC scaler, from Packed UYVY to BGRA using MMX2
> VO: [x11] 768x574 => 768x574 BGRA  [zoom]
> Selected video codec: [rawuyvy] vfm:raw (RAW UYVY)
> ==========================================================================
> Audio: no sound
> Starting playback...
> Selected font is fixed-width.
>
>
> Here I try to change the rendering from the menu to Overlay:
>
> ID_VIDEO_ID=0
> START
> ID_FILENAME=tv://
> ID_VIDEO_FORMAT=UYVY
> ID_VIDEO_BITRATE=0
> ID_VIDEO_WIDTH=768
> ID_VIDEO_HEIGHT=576
> ID_VIDEO_FPS=25.000
> ID_VIDEO_ASPECT=0.0000
> ID_LENGTH=0
> vo: X11 running at 1152x864 with depth 24 and 32 bpp (":0" => local
> display) Opening video filter: [crop w=768 h=574]
> Crop: 768 x 574, -1 ; -1
> ==========================================================================
> Opening video decoder: [raw] RAW Uncompressed Video
> VDec: vo config request - 768 x 576 (preferred csp: Packed UYVY)
> Could not find matching colorspace - retrying with -vf scale...
> Opening video filter: [scale]
> VDec: using Packed UYVY as output csp (no 0)
> Movie-Aspect is 1.33:1 - prescaling to correct movie aspect.
> SwScaler: reducing / aligning filtersize 1 -> 4
> SwScaler: reducing / aligning filtersize 1 -> 4
> SwScaler: reducing / aligning filtersize 1 -> 1
> SwScaler: reducing / aligning filtersize 1 -> 1
>
> SwScaler: BICUBIC scaler, from Packed UYVY to BGRA using MMX2
> VO: [x11] 768x574 => 768x574 BGRA  [zoom]
> Selected video codec: [rawuyvy] vfm:raw (RAW UYVY)
> ==========================================================================
> Audio: no sound
> Starting playback...
> Selected font is fixed-width.
> MPlayer 1.0pre7try2-3.4.4 (C) 2000-2005 MPlayer Team
> CPU: Advanced Micro Devices Athlon MP/XP Thoroughbred (Family: 6, Stepping:
> 1) Detected cache-line size is 64 bytes
> CPUflags:  MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 1 SSE: 1 SSE2: 0
> Compiled for x86 CPU with extensions: MMX MMX2 3DNow 3DNowEx SSE
>
>
> Failed to open /dev/rtc: Device busy (it should be readable by the user.)
> Playing tv://.
> TV detected! ;-)
> Selected driver: bsdbt848
>  name: Brooktree848 Support
>  author: Charles Henrich
>  comment: in development
> bktr open: Device busy
> dsp open: Device busy
> setfrag: Bad file descriptor
  ^^^^^^^ I dont know this one
> Error: No video input present!

Device busy happened/s often to me while messing with the code and testing. 
Usually after it had croaked, but there was an mplayer left hanging around or 
the driver was left in the cold (whatever that means ;) Waiting a few minutes 
actually helped most of the time (maybe even reboot). You can always run a 
manual mplayer -tv blahblah tv:// to see if bktr is back for business. 
Another thing I found out is that you can't unload bktr.ko. 

>
> Exiting... (End of file)
>
>
> and then to Direct
>
> kill: 71369: No such process

Yeah, if mplayer drops out, everything goes down. 

> MPlayer 1.0pre7try2-3.4.4 (C) 2000-2005 MPlayer Team
> CPU: Advanced Micro Devices Athlon MP/XP Thoroughbred (Family: 6, Stepping:
> 1) Detected cache-line size is 64 bytes
> CPUflags:  MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 1 SSE: 1 SSE2: 0
> Compiled for x86 CPU with extensions: MMX MMX2 3DNow 3DNowEx SSE
>
>
> Failed to open /dev/rtc: Device busy (it should be readable by the user.)
> Playing tv://.
> TV detected! ;-)
> Selected driver: bsdbt848
>  name: Brooktree848 Support
>  author: Charles Henrich
>  comment: in development
> bktr open: Device busy
> dsp open: Device busy
> setfrag: Bad file descriptor
> Error: No video input present!
>
>
> Exiting... (End of file)
>
>
> All this time I get the sound OK.
>
>
> If I remove .mplayer/config the needed params are reseted when I open

Could have written that earlier ;-)
Can you verify that if config is removed you don't get this (from above):

TV channel names detected.
Selected channel: E8 - A1 (freq: 196.250)

(just to be sure that it's not somewhere else as well).

> bktv. Irrespective if I set them via btcontrol or not, the frequency
> scanner doesn't find enything nor can I edit the channel list by hand
> (first 2 buttons are disabled, I have only 4 channels and can only
> delete them).
>
>
> Any hints ?

It may help if I explain a bit how it works: mplayer gets run like this (many 
parts omitted): mplayer -tv freq=0 tv:// After that btcontrol is used to 
change freqs (so that we don't need another mplayer) and other things. 
btaudio module handles audio, not mplayer. Only for changing rendering 
mplayer and with it the driver is restarted. 

If you run mplayer or fxtv as you normally do and then btcontrol set frequency 
196 does that display A1 as it should? If that is the case I might be able to 
get away with removing the freq=0 part and just let whatever config is there 
take place, because everything after the initial start is done by frequency 
through btcontrol. And what does btcontrol get signal say at that freq? And 
if you btcontrol set frequency 0 (provided that works)? Concerning scanning: 
it may help to lower threshold. The "signal" is a bit of a constructed 
parameter representing status rather than a real signal (not all bits may be 
significant and so representing it as a percentage for a threshold is a bit 
of a stretch).

The reason I use frequencies is because here in Holland almost everyone is on 
cable and the providers have their own frequency tables, and they are locally 
different. I've tried to use the channelset and it would produce channels 
alright but with many duplicates, that is more than one channel numbers with 
the same freq. So I am also not familiar with channelsets. This may be the 
same reason why the kmplayer author uses frequencies (but kmplayer restarts 
mplayer everytime you change frequency and bktr likes to freeze up if kicked 
to often too fast). Also, a (working) frequency scan should always get you 
your channels, though you have to name them yourself. 

Does the "hardware info" show the correct things? 

FWIW: with both my cards I didn't (have to) set any sysctls. The Miro I mostly 
use sets them all to -1, a wintv card I have sets tuner and card number, much 
like yours.

If needed I will create a test script that gives me any parameter that might 
be suspect. And rinse and repeat. Eventually the %^*& thing is going to work. 
Perhaps for my first PyKDE experiment (or C for that matter) I shouldn't have 
picked something involving hardware :)

Thanks


More information about the freebsd-multimedia mailing list