Date: Sun, 13 Mar 2005 01:50:04 +0100 (CET) From: Danny Pansters <danny@ricin.com> To: FreeBSD-gnats-submit@FreeBSD.org Cc: lioux@FreeBSD.org Subject: ports/78760: [PATCH] multimedia/kmplayer: Make TV viewing a bit more pleasant (and doc) Message-ID: <200503130050.j2D0o4IX058647@workstation.homenet> Resent-Message-ID: <200503130100.j2D10BVI081381@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 78760 >Category: ports >Synopsis: [PATCH] multimedia/kmplayer: Make TV viewing a bit more pleasant (and doc) >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Sun Mar 13 01:00:10 GMT 2005 >Closed-Date: >Last-Modified: >Originator: Danny Pansters <danny@ricin.com> >Release: FreeBSD 5.3-STABLE i386 >Organization: >Environment: System: FreeBSD workstation.homenet 5.3-STABLE FreeBSD 5.3-STABLE #4: Fri Mar 11 00:02:30 CET 2005 >Description: Change TV source to default to our /dev/tuner and /dev/mixer. Offers the first GUI entry to set up TV in kmplayer. Still requires some manual setup to be able to enter channels through the GUI. If you'd want to script this you'd need to have a means to determine which input is the TV tuner, 0, 1, or perhaps higher. So I just added a general doc file with my setup as example. I have been looking into bypassing kmplayer from starting a new mplayer process whenever the frequency to tune to gets changed to just change only the frequency through ioctl but didn't get it to work easily. Also talked to author. It would require implementing (in the context of kmplayer) a new player (plugin). But with the latest mplayer I don't get freezing/lockups very often anymore, which was the primary reason for this, and so for now I think it's better to leave this untouched. It's more of an mplayer/bktr issue anyway. It seems to work well now as-is with mplayer-0.99.6. I use it a lot for TV now. If the part in kmplayerprocess.cpp that uses v4lctl needs to be changed for FreeBSD (ignored so far), either use ioctl inline or I have a simple patch for the bsdbkrt_tvtune port that adds a -f option to set frequency so that this can be used as v4lctl is now. That (either method) was also what I used while messing with kmplayerprocess.cpp in order to not kill the mplayer but just tune frequency (see above). If maintainer has better ideas to get a working default so that the user can easily get the TV thing working in kmplayer, I'll be happy to test/comment. Not so many people have a TV card so it would be best to use the few feedback we might get optimally. BTW: This port needs a little cleaning up with docs (intl) files that get installed regardless of NOPORTDOCS ATM. Porttools complains a lot. Changes to or extra docs about (k)mplayer & TV viewing are welcome. Added file(s): - files/patch-src::kmplayertvsource.cpp - files/tv_viewing.txt Port maintainer (lioux@FreeBSD.org) is cc'd. Generated with FreeBSD Port Tools 0.63 >How-To-Repeat: >Fix: --- kmplayer-0.8.4.a_1,1.patch begins here --- diff -ruN --exclude=CVS /usr/ports/multimedia/kmplayer/Makefile /usr/ports/multimedia/kmplayer.new/Makefile --- /usr/ports/multimedia/kmplayer/Makefile Fri Mar 4 01:16:59 2005 +++ /usr/ports/multimedia/kmplayer.new/Makefile Sun Mar 13 01:08:46 2005 @@ -7,6 +7,7 @@ PORTNAME= kmplayer DISTVERSION= 0.8.4a +PORTREVISION= 1 PORTEPOCH= 1 CATEGORIES= multimedia audio kde MASTER_SITES= http://www.xs4all.nl/%7Ejjvrieze/ @@ -32,6 +33,9 @@ WANT_GSTREAMER= yes +USE_LIBTOOL_VER= 15 +INSTALLS_SHLIB= yes + ### ## Lib Detection ### @@ -79,6 +83,16 @@ # GCC < 3.1 .if ${OSVERSION} < 500035 EXTRA_PATCHES+= ${FILESDIR}/extra-patch-src::kmplayerplaylist.cpp +.endif + +post-install: +.if !defined(NOPORTDOCS) + @${MKDIR} ${DOCSDIR}/${PORTNAME} + @${INSTALL_DATA} ${FILESDIR}/tv_viewing.txt ${DOCSDIR}/${PORTNAME} + @${ECHO} + @${ECHO} "If you have a video capture/tuner card and you want to watch" + @${ECHO} "TV with kmplayer, see ${DOCSDIR}/${PORTNAME}/tv_viewing.txt" + @${ECHO} .endif .include <bsd.port.post.mk> diff -ruN --exclude=CVS /usr/ports/multimedia/kmplayer/files/patch-src::kmplayertvsource.cpp /usr/ports/multimedia/kmplayer.new/files/patch-src::kmplayertvsource.cpp --- /usr/ports/multimedia/kmplayer/files/patch-src::kmplayertvsource.cpp Thu Jan 1 01:00:00 1970 +++ /usr/ports/multimedia/kmplayer.new/files/patch-src::kmplayertvsource.cpp Thu Mar 10 21:27:59 2005 @@ -0,0 +1,21 @@ +--- src/kmplayertvsource.cpp.orig Wed Feb 23 19:37:42 2005 ++++ src/kmplayertvsource.cpp Wed Feb 23 20:25:43 2005 +@@ -407,15 +407,15 @@ + KDE_NO_EXPORT void KMPlayerTVSource::read (KConfig * m_config) { + setURL ("tv://"); + m_config->setGroup(strTV); +- tvdriver = m_config->readEntry (strTVDriver, "v4l"); ++ tvdriver = m_config->readEntry (strTVDriver, "bsdbt848"); + QStrList devlist; + int deviceentries = m_config->readListEntry (strTVDevices, devlist, ';'); + for (int i = 0; i < deviceentries; i++) { + m_config->setGroup (devlist.at (i)); + TVDevice * device = new TVDevice (m_document, devlist.at (i), + m_config->readSizeEntry (strTVSize)); +- device->pretty_name = m_config->readEntry (strTVDeviceName, "/dev/video"); +- device->audiodevice = m_config->readEntry (strTVAudioDevice, ""); ++ device->pretty_name = m_config->readEntry (strTVDeviceName, "/dev/tuner"); ++ device->audiodevice = m_config->readEntry (strTVAudioDevice, "/dev/mixer"); + device->minsize = m_config->readSizeEntry (strTVMinSize); + device->maxsize = m_config->readSizeEntry (strTVMaxSize); + device->noplayback = m_config->readBoolEntry (strTVNoPlayback, false); diff -ruN --exclude=CVS /usr/ports/multimedia/kmplayer/files/tv_viewing.txt /usr/ports/multimedia/kmplayer.new/files/tv_viewing.txt --- /usr/ports/multimedia/kmplayer/files/tv_viewing.txt Thu Jan 1 01:00:00 1970 +++ /usr/ports/multimedia/kmplayer.new/files/tv_viewing.txt Sun Mar 13 01:12:37 2005 @@ -0,0 +1,104 @@ +*** HOW TO USE KMPLAYER AS YOUR TV VIEWER *** + + +0. First you should have the following: + +- A Brooktree based TV card or capture card (if you only want to see composite + or S-video for example the signal from a VRC, satellite receiver, DVD player) + that is installed and recognised by the kernel. Simply load the bktr module. + +- Mplayer and KMplayer installed and working. + +- Regarding sound: like most people I simply connect AUDIO-OUT from the + TV card to a LINE-IN on my soundcard. I recommend this setup. + +- User RW rights to the bktr and tuner devices. It depends on your setup and + your taste, but with FreeBSD5 I use this: + + perm bktr0 0660 + perm tuner0 0660 + + in my /etc/devfs.conf, and my user ID is a member of the wheel group. + + +1. If you have troubles with your TV card, here are some ideas: + +- If it doesn't show up in dmesg you're not loading the module or you don't + have supported hardware. Supported cards are everything with a Brooktree + 848/878/8X8 capture chip and various tuners (Temic, Philips, ..). They + include Miro TV, Hauppauge WinTV, Osprey, and many others. See bktr(4). + +- Setting PAL/NTSC/SECAM can be done with kernel option if needed. Card can + be set with sysctl if needed. + +- In /usr/share/misc/pci_vendors you can find a list of vendors. Also + the pciconf command can give you information about which card you have: + + bktr0@pci2:14:0: class=0x040000 card=0x00000000 chip=0x0350109e rev=0x12hdr=0x00 + vendor = 'Brooktree Corporation' + device = 'Bt848 Mediastream Controller' + class = multimedia + subclass = video + +- Sysctls are (settings are in my case of course): + + dev.bktr.0.%desc: BrookTree 848A + dev.bktr.0.%driver: bktr + dev.bktr.0.%location: slot=14 function=0 + dev.bktr.0.%pnpinfo: vendor=0x109e device=0x0350 subvendor=0x0000 + subdevice=0x0000 class=0x040000 + dev.bktr.0.%parent: pci2 + + hw.bt848.card: -1 + hw.bt848.tuner: -1 + hw.bt848.reverse_mute: -1 + hw.bt848.format: -1 + hw.bt848.slow_msp_audio: -1 + + (NOTE: none of these hw.bt848 are set) + + +2. Using KMPlayer with TV input: + +- Your KMPlayer menu or TV Source in the Preferences dialog should already + have the right device and driver set. Or put this in your kmplayerrc: + + [TV] + Devices=/dev/tuner + Driver=bsdbt848 + +- For the "Scan" button in this dialog to work you must have at least a + TV frequency (channel) set up already. Here is what I have: + + [/dev/tuner] + Audio Device=/dev/mixer + Inputs=0:Composite1;1:Television;2:S-Video;3:Composite3 + Maximum Size=-1,-1 + Minimum Size=-1,-1 + Name=Pinnacle/Miro TV + No Playback=false + Norm=PAL + Size=-1,-1 + Television=Ned1:184;Ned2:192;Ned3:200;RTL4:744;RTL5:720;SBS6:632;Yorin:648; + Veronica:792;Net5:504;Discovery:848;Animal Planet:776;Nat. Geographic:832; + Preview:232;Een:208;Canvas:216;BBC1:664;BBC2:696;BBC World:856;Eurosport:840; + Euronews:544;CNN:760;MTV:784;TMF:752;The Box:712;ARD:528;ZDF:568;WRD:624; + TV5:736;BrabantTV:488;Lokaal:480;Royaal:512;Info:224;Nickelodeon:728;TRT:824 + + Most of this was written by kmplayer itself. You do need the [/dev/tuner] + marker and the Inputs line. Most of the time input 0 will be the TV. You + also need to set at least one (even if bogus) frequency like above, e.g. + Name_you_gave_tuner_input=Name_of_channel:Frequency_of_channel_in_MHz. + +- If you then run kmplayer you should get a second tab in the Preferences + dialog under Source -> TV. You can give your device a name and enter + name/frequency pairs for the tuner through the GUI. It will end up looking + much like the above with a whole list of channels. + +- The channels you set up should be browsable with the playlist and with the + << and >> buttons in kmplayer. + +3. Contact: + + For KMPlayer/TV viewing related issues, apart from the port's maintainer and + the software's author, you're also welcome to contact me: danny@ricin.com. diff -ruN --exclude=CVS /usr/ports/multimedia/kmplayer/pkg-plist /usr/ports/multimedia/kmplayer.new/pkg-plist --- /usr/ports/multimedia/kmplayer/pkg-plist Thu Mar 3 03:58:12 2005 +++ /usr/ports/multimedia/kmplayer.new/pkg-plist Sun Mar 13 01:06:46 2005 @@ -8,6 +8,7 @@ lib/libkdeinit_kmplayer.so lib/libkmplayercommon.la lib/libkmplayercommon.so +%%PORTDOCS%%%%DOCSDIR%%/%%PORTNAME%%/tv_viewing.txt share/applications/kde/kmplayer.desktop share/apps/kmplayer/bookmarks.xml share/apps/kmplayer/kmplayerpartui.rc @@ -154,3 +155,4 @@ @unexec rmdir %D/share/applications/kde 2>/dev/null || true @unexec rmdir %D/share/applications 2>/dev/null || true @unexec rmdir %D/lib/kde3 2>/dev/null || true +%%PORTDOCS%%@dirrm %%DOCSDIR%%/%%PORTNAME%% --- kmplayer-0.8.4.a_1,1.patch ends here --- >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200503130050.j2D0o4IX058647>