These are my upgrade notes I promised from my last post about MythTV. Please read that first before going through these, as they have information you might need pertaining to my MythTV setup. These are just notes I made during my upgrade from Mythtbuntu 8.04 LTS to 10.04 LTS. The notes were just for me but I thought I would share them. This is not a how-to! It leaves out many steps so don't think it will help you get your new MythTV box setup. Enjoy!
# Upgrade MythTV from Mythbuntu 8.04 to Mythbuntu 10.04. MythTV 21-fixes to MythTV 24.1 fixes. # Call comcast after getting HDHR Prime and get cable card added then ask tier 2 to send a grandslam hit or a cold # hit also called a DAC Init "hit" to the device. Channel encryption will not work correctly if this is not done. # After or during install of 10.04 in Mythtbuntu Control Center use settings MySQL Enable daily Optimize/Repair Enable performance tweaks Plugins Turn on all plugins Enable mythweb passwor Proprietary Codecs Check libdvdcss2 support box Repositories Check active MythTV updates for 24.x box Themes and Artwork Enable all of them # Gettting HDHomerun prime 3rd tuner working # get mythtv db password cat /home/mythtv/.mythtv/mysql.txt mysql -umythtv -p use mythconverg; select * from capturecard; # Look at cardid and pick next number in the series and add the same videodevice number as the other HDHomerun prime tuners INSERT INTO `capturecard` (`cardid`, `videodevice`, `audiodevice`, `vbidevice`, `cardtype`, `defaultinput`, `audioratelimit`, `hostname`, `dvb_swfilter`, `dvb_sat_type`, `dvb_wait_for_seqstart`, `skipbtaudio`, `dvb_on_demand`, `dvb_diseqc_type`, `firewire_speed`, `firewire_model`, `firewire_connection`, `signal_timeout`, `channel_timeout`, `dvb_tuning_delay`, `contrast`, `brightness`, `colour`, `hue`, `diseqcid`, `dvb_eitscan`) VALUES (10,'13102526-2',NULL,NULL,'HDHOMERUN','MPEG2TS',NULL,'mythtv',0,0,1,0,0,NULL,0,NULL,0,1000,3000,0,0,0,0,0,NULL,1); # Back up old MythTV mysql DB. Then copy backup to new machine. mysqldump -u mythtv -pyourpass mythconverg -c > mythtv_backup.sql # Moving program data to a new database # Extract only the data that is relevant to the programs from a database dump file grep "INSERT INTO \`record\` " mythtv_backup.sql > restore.sql grep "INSERT INTO \`recorded\` " mythtv_backup.sql >> restore.sql grep "INSERT INTO \`oldrecorded\` " mythtv_backup.sql >> restore.sql grep "INSERT INTO \`recordedprogram\` " mythtv_backup.sql >> restore.sql grep "INSERT INTO \`recordedrating\` " mythtv_backup.sql >> restore.sql grep "INSERT INTO \`recordedmarkup\` " mythtv_backup.sql >> restore.sql grep "INSERT INTO \`recordedseek\` " mythtv_backup.sql >> restore.sql grep "INSERT INTO \`recordmatch\` " mythtv_backup.sql >> restore.sql # To get inserts of our old entries working in new MythTV db we need to do this. ALTER TABLE `record` ADD `tsdefault` INT NOT NULL AFTER `transcoder`; # Restore the information about your programs back into the (new) database: $ mysql -u mythtv -pyourpass mythconverg < restore.sql # Drop column after programs are inserted alter table record drop column tsdefault; # Keep xscreensaver from starting. Comment out its section in this file. /etc/xdg/xfce4/xinitrc # Turn on optical SPDIF out Applications->Multimedia->Mixer->Switches Tab. Check box IEC958. # Fix cracky audio on VLC Tools->Preferences->Show settings "All"->Input/Codec->Access Modules->File->Caching value in ms-> 500->Save # Get other disks mounted # Get uuid so we can mount disks with it instead of device path. Use other entries in /etc/fstab as examples for mount. blkid /dev/sdb1 blkid /dev/sdd1 # Put entries in /etc/fstab # make new shortcuts for apps in xfce4 # put file in /usr/share/applications # filename: firefoxnightly.desktop # Contents: [Desktop Entry] Version=1.0 Name=Firefox Nightly Web Browser Comment=Browse the World Wide Web GenericName=Web Browser Exec=/home/mcsorley/programs/firefox/firefox %u Terminal=false X-MultipleArgs=false Type=Application Icon=firefox Categories=Application;Internet;Network;WebBrowser; MimeType=text/html;text/xml;application/xhtml+xml;application/xml;application/vnd.mozilla.xul+xml;application/rss+xml;application/rdf+xml;image/gif;image/jpeg;image/png; StartupWMClass=Firefox StartupNotify=true # mythtv800x600.desktop [Desktop Entry] Name=MythTV Frontend Window Comment=A frontend for all content on a mythtv-backend in 800 x 600 window GenericName=MythTV Viewer Exec=mythfrontend -w --geometry 800x600 Type=Application Encoding=UTF-8 Icon=mythtv Categories=GNOME;Application;AudioVideo;Audio;Video X-AppInstall-Package=mythtv # Tried the following to fix vsync (video tearing) for ATI card. It was unsccessful. Applications->Settings->ATI Catalyst Control Center->3D->More Settings->Wait for Veritcal Refresh->Drag to "Always On" sudo rm /etc/X11/xorg.conf sudo aticonfig --initial sudo aticonfig --sync-video=on --vs=on sudo aticonfig --fsaa=on --fsaa-samples=4 reboot # I give up. ATI Vsync is still not cutting it. The vid tearing is awful. Put in Nvidia card. Rebooted. Ctrl-Alt-F1. # Install nvidia driver. sudo apt-get install nvidia-current reboot # From menu go to Applications->System->Nvidia Server settings and flipped on all vsync options. No more vid tearing. # When watching only 720p vid with the OSD on the screen and Video Texture Adaptor "Sync to Vblank" is on the video # and sound will stutter until OSD goes away. Will be trying new Nvida 520GT and Mythbuntu 12.04LTS to see if this fixes it. # Get newer VLC because 10.04's version does not play webm (need to be able to play .flv) sudo add-apt-repository ppa:lucid-bleed/ppa sudo apt-get update sudo apt-get install vlc # vlc menu text was so small it was unreadable after the new Nvidia vid card install fix with # Option DPI in /etc/X11/xorg.conf Section "Monitor" Option "DPI" "96 x 96" EndSection # Logout of desktop to restart X # mplayer mythtv Setup->Media Settings->Videos Settings->File Types->Extension .flv # change command to below so we can change the speed of the video and get pitch correction. mplayer -fs -af scaletempo # Install repo and get libreoffice for 10.04 LTS sudo add-apt-repository ppa:libreoffice/ppa sudo apt-get update sudo apt-get install libreoffice-writer libreoffice-calc libreoffice-filter-binfilter # Getting ssl working on mythweb # Symlink to the to turn on the ssl for apache2. ln -s /etc/apache2/mods-available/ssl.load /etc/apache2/mods-enabled/ssl.load mkdir -p /etc/apache2/ssl # Use OpenSSL generate a server key without a password: sudo openssl genrsa -out /etc/apache2/ssl/server.key 4096 sudo openssl req -new -key /etc/apache2/ssl/server.key -out /etc/apache2/ssl/server.csr # Now sign the certificate signing request. This example lasts 3650 days: sudo openssl x509 -req -days 3650 -in /etc/apache2/ssl/server.csr -signkey /etc/apache2/ssl/server.key -out /etc/apache2/ssl/server.crt # In /etc/apache2/sites-enabled/default-mythbuntu copy everything from line:to line including the lines themselves and paste a copy below it. Change the copies port 80 to port 443 and add the extra SSL info. Now we have 2 sections..... SSLEngine on SSLCertificateFile /etc/apache2/ssl/server.crt SSLCertificateKeyFile /etc/apache2/ssl/server.key SSLProtocol all SSLCipherSuite HIGH:MEDIUM # bump mem limit higher than 64m limit or we get "out of memory errors" php_value memory_limit 256M /etc/apache2/sites-enabled/mythweb.conf # In mythweb settings (key/wrench icon) -> Streaming. Uncheck "Force HTTP for streams:" # Fix overscan issues for tv so we can fit the whole picture on the screen. # Tv modeline for Sony KDS-60A3000 # Sony KDS-60A3000 FF H1 H2 H3 H4 V1 V2 V3 V4 # DotClock Hdisp HsyncStart HsyncEnd Htotal Vdisp Vstart Vend Vtotal # EDIE info from X server #ModeLine "1920x1080" 148.50 1920 2008 2052 2200 1080 1084 1089 1125 +hsync +vsync # Modified line that works with tv ModeLine "1920x1080" 148.50 1800 1952 1996 2200 1020 1072 1077 1125 +hsync +vsync # http://www.arachnoid.com/modelines/index.html # http://ubuntuforums.org/showthread.php?t=1003099&page=2
I have recently upgraded my Mythbuntu 8.04 install to Mythbuntu 10.04, I am successfully using the new HDHomeRun Prime digital network tuner to record all of my shows. But the road to this new clean install was long and hard. I wanted to reflect on the years of trying to use a DVR like MythTV with my local cable provider Comcast. I will post a second article after this one with my notes on the actual install and configuration.
When I first starting using MythTV (mid 2000's) I had 2 analog Hauppauge PVR-150 cards. They were hooked directly into the cable lines and the MythTV machine could easily change the channels and record TV shows. It was super simple setup thanks to Comcast just providing an analog feed that worked with any cable ready TV on the market. This worked flawlessly for a few years but with everything starting to move to digital it was time for a new tuner.
I did some research at the time and read many great reviews about a tuner you could use over an Ethernet network. It was called the Silicondust HDHomeRun. This little box had 2 tuners and could record the digital channels Comcast supported and on top of that it could record HDTV. I was sold. I bought the unit and hooked it up. It worked great! I could get almost all of the channels Comcast provided using a clear unencrypted (QAM-256) digital stream. Along with this I could keep my 2 analog tuners since the analog signals worked right alongside the digital signals. Life was good and then just a few years ago everything started to crumble.
Comcast decided that all of their analog stations were taking up way to much of their available bandwidth. You see 1 analog channel = ~20 SD digital channels or ~3-4 HD channels (using QAM-256). Obviously that is a huge bandwidth savings so Comcast decreed that all customers will now be required to use a cable box or cable card with all of their devices. They implemented their plan of shutting down most of the analog channels and reclaiming them for digital channels. Customers were offered 2 basic digital boxes for free and then you have to pay for the rest.
This move by Comcast did not sound so bad since most new digital TV's supported clear (unencrypted) QAM-256. My HDHomeRun was the same way. It was already recording all of the digital shows using QAM-256. This would mean that I would have to get rid of my 2 analog tuner cards and possibly just buy another HDHomeRun. That would eliminate the cards and cables going to my MythTV machine and put all my tuners on the network. I could live with that. Onward and upwards as they say. Comcast decided to not mention one major detail.
They were also going to encrypt all of their digital channels during this big switchover. That means a cable box will be required (for decryption) for all TV's regardless. That one small douche bag move (that was not even necessary to keep all the devices working) broke all of the TV's and cable devices like the HDHomeRun. They could have just moved the channels to digital and given out boxes to people with old analog TV's. The newer digital TV's and devices would have kept working fine and would not have needed a box. Now any device requires a box to get anything more than the local TV stations. The only reason they did not encrypt those as well was because the FCC mandated they were not allowed to do it. I'm sure they would have done it if the law permitted it.
I will take a quick moment here to say shame on you Comcast. You could have gone digital and saved your bandwidth like you needed to and left it at that. Now you stick it to your customers by requiring boxes. Yes, you give a few away for free but it is one more thing that is now required but not needed. But I just can't shame you. Verizon does the exact same thing (I checked). Comcast could have set themselves apart from Verizon (they did it first) and kept clear QAM for most of their digital channels but they took the low road. I was disappointed to say the least but I stayed the course. Now I will have to use their boxes and exploit the "Analog Hole".
As ridiculous as all of that seems, recording with MythTV would have to be done with the analog PVR-150 cards again. But not in the same way it was done before. Since cable boxes are required to decrypt the signals now the new setup would require 2 cable boxes, 2 analog cards, and a IR blaster to change the channel with a script. Luckily, MythTV was versatile enough to handle this setup (hooray MythTV!). This is the setup I had up until a few weeks ago. It was an ugly conglomeration of wires and not the most reliable setup. I have hated this setup for that past few years, but I had very few choices if I wanted to record most cable channels with MythTV.
My goal for the upgrade was to get rid of my cable boxes, IR blasters, PVR-150 analog cards and go to an all digital setup. The only way to get rid of this mess would be to use a device that would allow me to record all of my extended digital cable channels without using the ugly cable box. I had read that SiliconDust (the company that makes the HDHomeRun) had a new product coming to market in 2011. It was another network tuner like the HDHomeRun (that I love so much) but this one would use CableCARD. Using a CableCARD would allow it to tune in and decrypt all of the digital channels like the days of yore. Best of all it would have 3 tuners and be able to be accessed over the network. This new savior of a device is called the HDHomeRun Prime and it was just released at the end of July.
Now your thinking, Comcast offering a CableCARD that actually makes their customers lives easier? Haha, yea right! They would never do that without being forced to. Remember, who forced them to keep local channels unencrypted. That's right it was the FCC. Guess who required them make available CableCARDs? If you answered the FCC your right again. In the "Plug and Play" proceedings, the FCC required all cable companies to make available CableCARDs, which enables anyone to offer an alternative to set-top boxes. Read more about this here. This ability of anyone being able to make a cable box paved the way for the HDHomeRun Prime.
The HDHomeRun Prime is a device hooks into your network that allows you to view your cable channels from any device that has software client written for it. MythTV happens to be a client that can read and record the digital streams from the Prime. I purchased the HDHomeRun Prime about a month ago and hooked it up to my network. I got a CableCARD from Comcast and plugged it into the Prime. I called the number to activate it and got it activated successfully. But for some reason I could only see local channels.
Any time I tried tuning in any station other than a local station the channel showed that the CCI Protection flag was set to "Copy Once". CCI stands for Copy Control Information. It has flags set in it's digital stream that allows the content provider to tell the device what it is allowed to do with the content. This is where the FCC caved into Hollywood and allowed them put Digital Rights Management (DRM) "features" into the CableCARD. My channels were showing it was set to "Copy Once" (0x02). This means the content is allowed to be copied only to the device receiving the stream and it must be encrypted with a unique key so the recording device is the only one that can play the stream. Tivo and Windows Media Center can record these streams but most software can not. Unless you get a blessing from the maker of CableCARDs (CableLabs) then you will not be able to see this stream. Very few front-end applications have been approved for use with CableCARD tuners using the copy once flag and MythTV is not one of them.
From everything I read about Comcast and Verizon they set the copy freely flag in most areas of the country. Many people have even said it is a corporate policy of Comcast to set the copy freely flag. I was perplexed by why this flag was showing up. I hit the SiliconDust forums and found out the answer. After the cable card is activated you have to speak to tier 2 support to get them to send a "hit" to your cable card. A "hit" is like a major reset and clear of your cable card. Even though the card is activated it will not start working until this hit is done. Tier 1 support does not know about this. All they try to do is keep re-activating your cable card. After tier 2 sent the hit to my cable card I could see all of the channels I subscribe to. Checking the CCI flag after the fix it did not say "Copy Freely" as I expected, it said CCI Protection "unrestricted". That works for me. I did just say I could see all of my channels. I lied. I later found out I could not view all of them.
After getting that cleared up I noticed that my local HD PBS station and my local HD CBS affiliate would not tune in with the Prime. Upon further inspection of the logs I found a line that said "auth=unknown cci=none cgms=protected-rcd". Both channels said this when tuned it. All other local HD channels were fine. This new copy protection that is being sent is the Copy Generation Management System. It is copy protection for analog signals (there is digital version as well) and if this flag is set the Prime must obey it because it has to obey the CableCARD standard. The description of this issue is described best by SiliconDust employee Jason replying to a Verizon user on the forum with the same issues as me:
The network enables the redistribution control "broadcast flag" on some content. The CableCARD standards require that OCUR devices enforce copy protection when this flag is set and no CCI value is set by the card (CCI overrides all other forms of copy protection). Verizon doesn't set CCI on clear QAM channels, so that can result in it getting blocked. Yes, this is a pointless requirement since any tuner that doesn't support CableCARD will completely ignore the flag and do whatever you want with clear QAM channels, but the HDHomeRun PRIME and other OCUR tuners are nonetheless required to play by the rules. We plan to submit a request to CableLabs to have this requirement changed. One workaround might be to contact Verizon and see if they can start sending CCI data for that one channel just to override the broadcast flag.
So this issue is something Comcast is doing and I have not bothered with it further (UPDATE 11-19-2011: A firmware update for the Prime has cleared up this "redistribution control flag" issue. I can now see my local HD PBS channel.). Why you ask? Well, if you read what Jason said above clear QAM devices ignore this crappy flag as they do not have to abide by CableLabs certification. The 2 stations I'm having an issue with are sent by Comcast as clear QAM. My older HDHomeRun just reads the clear QAM and shows the station just fine. Now your thinking, why can't the Prime see the clear QAM station and just show it. The issue with that is when the CableCARD is in the Prime it has to obey CableLabs restrictions so if there is a copy protection flag it can not show the station. If the card is not in the Prime it would tune in the clear QAM signal just fine. But it is not allowed to tune in both at the same time. I might revisit this issue at a later time but for now I can live with it.
After getting all of that worked out I can now see all of the stations from my MythTV machine. It is happily recording all of the shows on my schedule. I'm using version 24.1 + fixes and it is fantastic. I could not be happier with it.
After going through all of these issues I will say that I hate copy protection (DRM) even more than I did before. It does nothing but hassle the people that actually pay for content and hinders their ability to use it in the way they seem fit. One of my favorite people that write about these things is Corey Doctorow. Check out this lecture he gave in 2004. It really sums up why DRM does not work and why it is bad business. The honest user is the one who pays the price by being put through long phone calls to support, annoying workarounds, and limited use just to use the product they legitimately purchased. Fred von Lohmann had a quote that I have remembered to this day when Apple was using DRM on their music "No one wakes up and says, 'Hey, I want to do less with my music today," he said. "And that's what DRM does - allows you to do less and less with content.". That brilliant quote just about sums it up. DRM lets us do less and less with the content we buy. Apple figured out that DRM does not work. I wish other corporations would figure it out as well. And they wonder why people turn to "pirating" content...
I have the MythTV and love it. Tivo is sitting on the floor unplugged. Luckly I never upgraded to a series 2 Tivo. Tivo is dying anyways. With myth I can watch my shows 2 times (2x) the speed (time stretch) and it edits out the commericals.I can finish a 1 hr show in 15mins. It can also convert shows to almost any video format so you can watch it on any computer or you can burn them to DVD. My last favorite feature is the web interface. You can schedule shows, see recorded shows, browse and search listings, and stream video. It destroys Tivo and best of all it's free software.
I wanted an easy way of taking a screen grab with MythTV but could not find any easy way that anyone had come up with. MythTV runs on linux so I have all the software on the machine at my disposal. I figured I'd use the same player MythTV uses to play DVD's to take the screen shots. The recordings are done in an MPEG 2 format called NuppelVideo. Mplayer can play this format. Mplayer also has a video output driver for JPEG, PNG, gif89a, and TGA. So here's the command that gets you the screen grabs.
mplayer /video/videoname.nuv -vo jpeg:quality=90,optimize=100 -ss 6 -frames 90
The above command uses mplayer to play the video file and uses mplayer's video output driver for JPEG. It starts on the 6th second of the video and grabs 90 frames (3 seconds of video). Just adjust the seconds (-ss) for where you want to start the capture and for frames multiply 30 x # of seconds of video you want from that start point. Adjust the quality and optimization to your liking. See the mplayer man page for options of the other formats PNG, gif89a, and TGA. Actually, you can do screen grabs of any file mplayer can play so this works regardless of MythTV files.
Also, when streaming video to mplayer from MythTV over the internet I like to save the video and start it ahead of time so I can skip commercials while it's going. Also it gives me the ability to pause it if I feel the need. Here is the command I use to play and dump the stream from MythTV to disk.
mplayer http://mythtvmachine.net:8001 -dumpstream -dumpfile /tmp/filename.mpg
Once you start the dump just wait as long as you want and just play the file like you would any other mpg.
The settings I like to use over a 384Kbps upload connection for MythStream are the following:
Video Codec: div3 Video Speed: 256 Audio Speed: 48 Video Size: 50% Video FPS: 25 Stream Protocol: http