Talk:HOWTO Setup MythTV
From Gentoo Linux Wiki
[edit] Split into multiple guides?
This is a useful guide, but it could use a makeover. I think the biggest problem is that it is too long and un-focused. Would it make sense to split this into multiple guides, and let the user go through them one at a time? For example:
- Make decisions: Single backend-frontend or separate? Maybe X-less backend or diskless frontend (needs wiki page)
- Install Gentoo (link to docs, but also mention the USE flags you're going to need based on the previous decisions)
- Get X Windows running (docs)
- Install Windowmanager (some advise on what to use and links to specific guides such as KDE)
- ALSA (docs)
- Analog Capture Cards/IVTV (needs wiki page)
- Digital Capture Cards (needs wiki page)
- Checking your setup so far
- Emerging MythTV (largely the guide is it is now)
- Autostarting MythTV
- Guide info (already has a wiki page - in fact, there are 2)
- LIRC
- MythWeb
- MythTV Extensions (may need separate page for each extension)
- Using MythTV
- Additional usability tweaks
- Troubleshooting
This is just an example, I'm just curious if this format would make more sense and be easier to read.
- I strongly agree that it should be split into multiple guides. I don't think it's much of an issue for the users. I used this guide myself as a user and it was fine. But as an editor of articles, I find editing one massive article a nightmare. I prefer to have shorter articles focused on a few simple things. That being said, let's make sure that when and if there is a split, we make sure that the sub articles are specific to MythTV, so that all the entire set of articles is MythTV specific. ie. let's not hand off all the ALSA work to the ALSA article, but have a MythTV/ALSA article and a MythTV/lirc article. Dgrant 20:20, 15 November 2005 (GMT)
- Thats the question really... Is it better to split myth specific sections like LIRC into new pages under a 'mythtv' banner even though many people are interested in setting it up for non-pvr reasons? The same goes for most of this how-to. What we have here should be an overview on how to stitch the many components to myth together. To avoid duplication of effort and to keep information on things like ALSA relevant to the majority of users I think the sections should refer people to other existing howtos on the site where appropriate and include info here on what configs need to be altered or added to make myth work. I think this is a large howto but setting up myth is a big project that touches on many large areas of setting up a linux box in general. Segmenting it would probably lead to drift, keeping it all together will ensure that problems in the complete walkthrough can be addressed more easily. We have one of the best tutorials out there right now, I'm hesitant to do anything that would change that. Most importantly if anyone does attempt to do that they should be prepared to spend the next few months watching, tweaking and maintaining the article. Comments? --Ghettodev 12:14, 16 November 2005 (GMT)
- If it were up to me, I'd split the guide and make the main page (this page) a skeleton on which to build the rest. As an example, I've been redoing the ALSA myth page, but the more we think about it, the less you actually need that page. The ALSA documentation is very good already, and it seems there are no real Myth-specific issues left. However, we do want to tell the user to get his ALSA right, so a link from the MythTV skeleton is appropriate. Therefore, I changed the layout of the skeleton a bit in this thread (above), and when we are happy with the new layout, we could rebuild the guide. Besides, it isn't that good anymore anyway. Myth 0.19 is an excellent opportunity to revise.
[edit] Error tuning channels
I'm getting stuck on step 6.5, the pcHDTV card setup. The pcHDTV forums are down ATM and gentoo forums don't have anything that I can see. Here's what I get:
# atscscan /usr/share/dvb/atsc/us-NTSC-center-frequencies-8VSB scanning /usr/share/dvb/atsc/us-NTSC-center-frequencies-8VSB using '/dev/dvb/adapter0/frontend0' and '/dev/dvb/adapter0/demux0' >>> tune to: 57000000:8VSB WARNING: >>> tuning failed!!! >>> tune to: 57000000:8VSB (tuning failed) WARNING: >>> tuning failed!!! >>> tune to: 63000000:8VSB WARNING: >>> tuning failed!!! >>> tune to: 63000000:8VSB (tuning failed)
I have a poor understanding of what exactly my pcHDTV 3000 should be doing. I bought it as insurance against the broadcast flag, back when that mattered. I'm not trying to recieve HDTV, just basic cable. It does that, right? --Duozmo 00:39, 16 December 2005 (GMT)
pcHDTV 3000 can do both cable/over-the-air QAM (for HD signals) as well as NTSC signals, for standard definition reception. Typically you will set up your pcHDTV3000 as a DVB card for high-def capture, and as a regular video4linux device for NTSC capture.
[edit] Moved from HOWTO Setup MythTV.
Yesterday I was finally successful in obtaining video from the TV Out on the PVR-350 on Gentoo running the AMD 64-bit kernel, and I thought I would post some details on how I was able to perform this since during this process I found very little informational resources out on the web regarding this specific configuration.
The core problem was that the binary X Server drivers are built for a 386 Intel, which is not usable by X as built for the 64-bit AMD. Therefore, it was necessary to complie the driver from source. However, Gentoo does not make this exactly easy.
Forgive me if my references are not exact; I am doing this from memory as I am at work right now, and the box is at home.
First off, compiling the driver sources requires that you have available the source for the X server. Since this is Gentoo, I was able to find the relevent source in /usr/portage/distfiles. I started off by creating a work directory and copying the 5 source files (X11R6.8.0rc5-src?.tar.gz) to my work directory, then using tar -xzvf X11R6.8.0rc5-src?.tar.gz to extract the source.
After this was extracted, I made a modification to the host.def file found in ../xc/config/cf/ by adding the line "#define XF86ExtraCardDrivers ivtv", though to be honest I am not entirely certain this is necessary.
Next, I copied into the work directory the ivtv-0.2.0-rc3h.tgz file from the http://ivtv.no-ip.info/ website and extracted this as well. I entered the drivers directory and entered 'make; make install". then I entered ../utils and entered 'make'.
In the utils directory is the file XFree86-4.3-incr-DMA-08.tgz. I untarred this as well. This will create a whole series of subdirectories and six small files. I merged these into the X source directory strucure setup previously using 'mkdir ../xc/programs/Xserver/hw/xfree86/drivers/ivtv' and then 'cp Xfree86-4.3-incr-DMA-08/xc/programs/Xserver/hw/xfree86/drivers/ivtv/* ../xc/programs/Xserver/hw/xfree86/drivers/ivtv/'
From here, the next step is to first begin compiling the X source by entering ../xc and running "make World", but terminating it (Ctrl-C) after a few minutes. I observed that this process starts by entering the various directories and building makefiles or something to that effect. However, it's not actually necessary to rebuild the entire package. The only goal here is to get all the necessary variables and so forth set and written to their various files that will be used during the actual compiling of the driver source. Thus, it is safe to terminate this process once it actually starts compiling X.
Having all the variables and such in place, I could move into the ../xc/programs/Xserver/hw/xfree86/drivers/ivtv directory. Running 'xmkmf ../xc' used the Imakefile that is present in this directory to create a proper makefile that will be used to build the actual driver.
I then ran 'make depend'. Now, heres where things got a little annoying. Regrettibly the source as obtained by portage doesn't *exactly* have all the files where make depend expects them to be. There were 10 header files that needed to be coppied to alternative locations in order for make depend to finish without errors. In each case, make depend would tell you all the different places it looked for the file, and failed to find it. All I did was to find the real location of the file, and copy it into one of the locations it expected to see it in. After I had moved these 10 files, make depend ran successfully.
The only thing left then was to run 'make'. This produced an error, but I noticed that it still created the ivtvdev_drv.o file, so I ignored it and just copied the file into /usr/X11R6/lib/modules/drivers.
The only thing left was to modify the /etc/X11/xorg.conf file, adding the relevent monitor, device, and screen sections.
All done, I ran "modprobe ivtv_fb' and started up X. Since I had already had the nVidia GeForce FX 5200 working, this got me a second display using the TV out on the PVR-350. Yay!
One caviat: At this point, if i shut down x, start it up, then shut it down, then start it up (this is the third time, for those keeping track) the video output from the PVR-350 goes kooky. In particular, the screen will be blank *except for the 30 or so lines around anything that changes. That is to say, when you move your mouse, you can see the the lines the mouse happens to be on, and a little above and below, but that's it. Worse, this video will dissappear almost immediately. At least it doesn't crash.
My only fix at this point is to restart the system. Perhaps if somebody could enlighten me how to un-modprobe a device, that might be something I'd like to try.
Also worth mentioning is that at present I am not able to get Mplayer to play anything on this device. I just noticed this this morning, so haven't had time to see if its a problem, or just operator error.
My appologies for a only half useful document. The above was used in conjunction with the HOWTO at HOWTO Setup MythTV.
If anybody find's this useful, or believes further refining this email into a real HOWTO, let me know, and I'll see what I can work up. Either way, theres nothing like a success to remodivate.
[edit] Specific Problems
[edit] Adding user to groups
adding the mythuser to groups is mentioned, but when and how to create it?
- If the user you are running myth under is called mythuser:
- When you are creating the user:
- #useradd -m -G users,wheel,audio,video,cdrom,mysql,mysqladmin -s /bin/bash mythuser
- If mythuser already exists
- #gpasswd -a mythuser audio,video,mysql,etc
[edit] mythtv-setup sql failures
With mysql 4.1.14-r1 and mythtv 0.18.1-r1 mythtv-setup can "fail" (appear to work but writes errors to stderr). The first error is:
- Query was: CREATE TABLE IF NOT EXISTS jumppoints ( destination varchar(128) NOT NULL default , description varchar(255) default NULL, keylist varchar(32) default NULL, hostname varchar(255) NOT NULL default , PRIMARY KEY (destination,hostname));
- Error was: Driver error was [2/1071]:
- QMYSQL3: Unable to execute query
- Database error was:
- Specified key was too long; max key length is 1000 bytes
This is "caused" by mysql defaulting to utf8 character set. Each utf8 character apparently takes three bytes, blowing the mysql 1000 byte key limit. (See mysql bug.)
A (unnecessarily drastic?) workaround is to stop mysql, delete mysql data directory, replace "utf8" with "latin1" in /etc/mysql/my.cnf, re-do mysql post-install (mysql_install_db etc), restart mysql, re-do mythtv mc.sql. Better would be to adjust mythtv-setup to allow charset to be specified for database or specific columns, or perhaps to reduce some key column sizes?
- Better create the table as latin1 in mysql-commandline-client:
CREATE DATABASE myth CHARACTER SET latin1;
- --87.78.165.213 19:32, 29 June 2008 (UTC)
[edit] opening a terminal
user <ctrl> + <alt> + <return> opens a terminal
Inresposnse tosome comments made on the article itself (they have been rolled back) - Thrasher 15:12, 2 Aug 2005 (GMT)
- God damn evilwm sucks... openbox or fluxbox should be the recommended wm for this article. Or flubox, which is even more n00bie friendly because it comes with a taskbar. Dgrant 20:16, 15 November 2005 (GMT)
- I think that tutorials about specific window managers to be configged specifically for mythtv should be moved into thier own pages and linked to. The information is valuable but we can end up with a 50 page howto if everyone picked thier favorite wm, and it has little to do with how to get mythtv running. Might as well add sections on the best bios tweaks for every mobo... I'm thinking of removing them and turning them into sep pages. Anyone agree or disagree? Comments? --Ghettodev 02:32, 25 December 2005 (GMT)
[edit] Notes about initial installation of Gentoo
It may be helpful to note that when you're initially installing Gentoo that you should have the USE flag "ssl" set. Things like wget need SSL for the zap2it stuff to work right.
Also, I added the USE flag "mysql". When I tried to emerge from scratch, MythTV wouldn't compile because it complained about QT not being compiled with the mysql flag. If that's not correct, feel free to get rid of it, but it was necessary for my install.
[edit] simpler alternative to xdm/kdm/gdm with autologin
Hi
Wanted to have a minimalistic setup, so look for an alternative for login managers to start X/Mythtv at boot. Found a simple (but very effective) setup on the Gentoo forums that allows for automatic login, and start of X
http://forums.gentoo.org/viewtopic.php?t=268192
[edit] Very simple autologin / X start
A really simple approach is to add the following to /etc/conf.d/local.start:
killall X /bin/su - mythtv -c startx >& /dev/null &
where "mythtv" is a user you've setup to run mythtv. Add to /etc/conf.d/local.stop:
killall mythfrontend X
Then be sure that you have "local" starting at the default runlevel: "rc-update add local default". You'll also need an .xinitrc file for the user mythtv. I use the following in /home/mythtv/.xinitrc:
# Start irexec so buttons on the remote can run other programs (useful!) irexec --daemon # re-load the overscan/flicker settings for my geforce card: nvidia-settings -l .nvidia-settings-rc # Actually run Myth: mythfrontend & # Run a window manager for good measure: exec evilwm
Running a window manager is optional (to avoid it, change the "mythfrontend &" to "exec mythfrontend"), but can help with some video playback issues. Also, evilwm is a very minimal manager, so it doesn't cost much to run it. Pressing ctrl+alt+enter will open an xterm, which you may find useful for debugging.
The advantage of this setup is that myth and X can be easily restarted by restarting local. Also, since the frontend may crash from time-to-time, the following are useful:
- Bind a button on your remote to a script that restarts the front end. This needs irexec, but comes in handy. Symlink /home/mythtv/.myth/lircrc to ~mythtv/.lircrc and add something like the following:
begin prog = irexec button = Power repeat = 1 config = killall mythfrontend; mythfrontend & end
Note, "Power" will have to be changed to the name of a button in /etc/lircd.conf that isn't bound in myth.
- Run mythfrontend in a while loop in your .xinitrc file. Note, you'll have to start the window manager before the while loop, and don't start it with "exec", or you'll never make it to the loop!
[edit] Even simpler setup for autostart of mythfrontend
Change this line in /etc/inittab c6:2345:respawn:/sbin/agetty 38400 tty6 linux
to this:
c6:2345:respawn:/usr/bin/openvt -fwc 2 -- /bin/su - mythtv -c /usr/bin/startx > /dev/null
(this assumes that mythfrontend runs under user mythtv)
Then set /home/mythtv/.xinitrc to start mythfrontend:
exec /usr/bin/mythfrontend >> /var/log/mythtv/mythfrontend.log
This has the advantage of automatically restarting mythfrontend if it crashes.
Here is an even simpler way
[edit] mingetty for autologin
I've been doing the same since setting up MythTv on an xbox (The list of requirements just to get an x login manager running is huge).
One possibility is to use mingetty's autologin feature. I've customised run level 4 to include a mingetty that logs in as mythuser and start everything up - obviously I've changed the default runlevel to 4 as well. This idea came from the Freevo site (http://freevo.sourceforge.net/cgi-bin/doc/BootFreevo). It's well worth a mention as a light weight way of getting myth auto started, the only thing you need that might not be there is mingettty and that's tiny (<1min to install on the xbox).
Hope it helps people out there...
JonBoy
[edit] even simpler startup
I have this first script run at boot up time:
#!/bin/bash cd /root HOME='/root' export HOME xinit /root/xinitmyth -- :0 &
and the startup file /root/xinitmyth
xsetroot -solid gray & mythfrontend
Potential bug with this setup: when running the 'mythvideo' plugin, mplayer doesn't seem to pickup everything it needs and it causes none of the key bindings to work. As yet I haven't discovered a fix, I will post it here if I find one. Update Seems X without a window manager doesn't know how to focus windows, so the mplayer instance doesn't receive focus to get keystrokes. Easy answer of course is to run a window manager -- I tried blackbox (failed, strange graphical error), then tried icewm, which worked fine (though I had to change the prefs to disable the taskbar). In the above script I simply added "icewm &" before the 'mythfrontend' line. Works beautifully with very little additional memory. Of course if I was doing it again, I'd likely make my OS (gentoo) start icewm the 'gentoo way'
[edit] Modifying this wiki
Although I applaud your help with this wiki cardoe, it has been a joint effort of a great many contributors for over a year. For it to continue to be as valuable as it has been it must be a collaborative effort which is what wiki's are all about. Posting a notice that you have claimed control of it can only hurt the effort. Please consider removing or modifying your notice. I'm not sure that 'official' documentation belongs on gentoo-wiki, as you are a developer I believe you have access to the gentoo.org documentation project.
- I agree. I say we remove the notice and begin an editing free-for-all as this article needs lots of work.
- cardoe hasnt edited this wiki in close to 2 months. I'm removing his modification notice from the main page and returning control of the wiki back to the users. The only way a single user can benefit the article more than the entire community is if they maintain and update it almost daily. The notice at this point can only serve to disuade people from working on it. Please contact me if you feel this is a mistake or leave your comments here.
I've been using this wiki and up until today it had everything I needed. For some reason all of the atscscan info, pchdtv info and kernel stuff has been removed. It was a one stop wiki for pchdtv and mythtv installation. Please back out those changes.
- I've been seperating the guide into easier-to-read sections, as discussed above. The pchdtv info is under HOWTO Setup TV Input for MythTV and the kernel stuff is in HOWTO Setup Kernel/System for MythTV. These are both linked from the MythTV template on the top-right of the guide.
--Blarson 18:53, 14 January 2006 (GMT)
[edit] DVB-S scan
Hi, I want to do a full scan on Astra 19.2E, and it bugs my for a frequency and symolrate. So what to put there?
Regards --Giuly 16:44, 16 November 2005 (GMT)
Put in the details of one of your channels (from channels.conf)
[edit] UTF8
MythTV doesn't work properly with UTF-8. Perhaps it would be useful to include a warning about this in the guide? --Roguelazer
[edit] Shared Channels
I'm not sure whether this affects any other country, but in the UK we have a couple of channels that are operating on a time-shared basis. Cbeebies and BBC3 use the same channel, as do ITN News and ITV4. Both Cbeebies and ITN News broadcast during the day time, and BBC3 and ITV4 take over for the evening. MythTV isn't so keen on this, and it took me a while to figure out why I couldn't get recordings to work off BBC3 on the box I've produced for work (a college). After finding out about the channels were shared I had to come back in to work in the evening and get the box to re-scan the channels. A test build on a box at home resulted in the same thing, I needed to scan the channels once in the daytime and once in the evening, otherwise myth was unreliable when it came to these channels.
[edit] the modules
For the drivers, can those all be put into the kernel, rather then being compiled as modules? I know for some things like the iPod things need to be compiled in as modules so I'm curious.
[edit] Removed mouse symlink info
I removed a snippet a user put in regarding setting a symlink to get the mouse to work. It would seem that the preferred solution, rather than creating a symlink, would be to edit /etc/X11/xorg.conf and set Option "Device" in Section "InputDevice" to point to the proper place.
- Dlim 21:55, 13 January 2006 (GMT)
[edit] install only Backend?
Hello! Is there a way to install only the backend? --81.14.131.125 18:30, 24 January 2006 (GMT)
This question is very important for me, too. As I want no X on my server.
- There seems to be a new "backendonly" USE flag in the latest mythtv ebuild. Good luck! 66.25.137.217 14:22, 2 April 2006 (GMT)
[edit] Removed from "Setting everything up" section
- WRONG... You never specify USE flags on the command line like that... because subsequent emerges will not have the USE flag... the correct place is in /etc/portage/package.use... Please read the Gentoo Handbook...
It's debatable whether USE flags should ever/never be used on the command line or whether it's appropriate in this case. If they really shouldn't be used, see the mythweb section of this article for an alternative.
If something is wrong, JUST FIX IT. If necessary, or if you're not sure how to fix it, discuss it on the discussion page, but don't discuss it in the article.
Dlim 14:25, 17 June 2006 (UTC)
[edit] xmltv
Is the note about international xmltv still required? There are newer xmltvs in portage with the internationalisation options
[edit] QT 3 VS QT 4
I had originally followed these instructions when I installed my Myth system - but it recently all broke when I was doing some upgrades. Turns out QT got upgraded to version 4, and as the install says, that won't work. Instead of using this command to install QT
emerge -1 =x11-libs/qt-3*
Why don't we just mask QT4 and let it all happen automagically? This is what I did, followed by re-emerging QT, and it solved my problems. I suppose it might cause problems if something else needs QT4, but my box is dedicated to MythTV.
echo ">=x11-libs/qt-4" >> /etc/portage/package.mask
[edit] Libexpat problems
If you are having problems with libexpat, you need to run revdep-rebuild. Creating symlinks is not a solution to this problem - even if it does get things running again ;-) For more information, reference http://forums.gentoo.org/viewtopic-t-575655.html. I'm going to remove the information posted about libexpat from the article.
Blarson 03:19, 26 September 2007 (UTC)
