tag:blogger.com,1999:blog-8353180219790669522024-03-13T17:16:58.588+00:00Too lazy to hackMalcolm Parsonshttp://www.blogger.com/profile/05126957385276806613noreply@blogger.comBlogger12125tag:blogger.com,1999:blog-835318021979066952.post-9789707964273658002009-09-14T11:11:00.003+01:002009-09-14T11:20:38.806+01:00More lucky frogs<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjAzeszeX7mFPZ18EwTGu60IuPS_Es3TTfEzNwmw5UD8EbZzHodhyphenhyphenA7j8WaP8xSqMqCXYnSVevxOhHPqE58vvcQsEPhzK9f-Bxy0dWWbGtTLOs4_A7ti-DtdJfDn1k0LzidFLkJY6mw3_Q/s1600-h/dscf2058.jpg"><img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 400px; height: 331px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjAzeszeX7mFPZ18EwTGu60IuPS_Es3TTfEzNwmw5UD8EbZzHodhyphenhyphenA7j8WaP8xSqMqCXYnSVevxOhHPqE58vvcQsEPhzK9f-Bxy0dWWbGtTLOs4_A7ti-DtdJfDn1k0LzidFLkJY6mw3_Q/s400/dscf2058.jpg" alt="" id="BLOGGER_PHOTO_ID_5381264813674491186" border="0" /></a><br /><br />Last year I found a <a href="http://malcolmparsons.blogspot.com/2008/09/lucky-frog.html">Lucky Frog</a> in the grass cuttings.<br /><br />In August I spotted this frog on the lawn before mowing over it.<br /><br />This weekend I found a larger frog in our green bin, we hadn't been doing any mowing.Malcolm Parsonshttp://www.blogger.com/profile/05126957385276806613noreply@blogger.com0tag:blogger.com,1999:blog-835318021979066952.post-34150184157800662792009-01-31T21:00:00.008+00:002009-04-12T15:14:18.906+01:00Installing MythbuntuThe K45 doesn't have a slot for a CD drive, so I decided to install from a USB drive (my MP3 player).<br /><br />I downloaded the <a href="http://www.mythbuntu.org/">Mythbuntu</a> 8.10 x86 ISO, and tried to use <a href="http://en.wikipedia.org/wiki/Ubuntu_Live_USB_creator">usb-creator</a> to write it to the MP3 player. Nothing happened. The program just hung.<br />I gave up on usb-creator and used <a href="http://unetbootin.sourceforge.net/">UNetbootin</a> instead. This worked first time and didn't delete my MP3s.<br /><br />The K45 booted from the MP3 player and X11 appeared on the TV.<br />The resolution was the TV's native 1360x768 with a 60Hz refresh rate, but the display was shifted to the right so I can't see the clock. The controls on the TV are unable to correct this.<br />The picture is also slightly wobbly. These problems disappear when the resolution is changed to 1024x768.<br /><br />I ran the installer, it partitioned the hard drive with a small ext3 / partition and the rest as an xfs /var.<br /><br />The installer asked for mysql and mythweb passwords, but these were ignored.<br /><br />Mythbuntu automatically logs in as the user that was created during install and mythfrontend is started. No keyboard or mouse are required.<br /><br />I used NetworkManager to connect to my wireless network. It asked for a password to secure the<br />keyring with. In normal Ubuntu, you should use the same password as your user account, so that the keyring can be unlocked automatically when logging in. As Mythbuntu logs in automatically without a password, it doesn't know the password to use to unlock the keyring. So when setting the password for the keyring you need to use an empty password.<br /><br />A PC uses more power than a set-top box, so it's a good idea to turn it off when not using it. But the PC needs to be on to record a scheduled programme, so an alarm has to be set to turn the computer back on a few minutes before the recording. The alarm is set by writing the required time to /sys/class/rtc/rtc0/wakealarm. Mythbackend can be configured to automatically set the alarm and turn the computer off when it is idle and there are no clients connected. There is a problem here - mythfrontend is started every boot, so there will always be a client connected, and the computer will not be turned off. The solution is to start mythwelcome instead of mythfrontend. Mythwelcome can start mythfrontend when requested using a remote control. To start mythwelcome at boot edit /etc/mythtv/session-settings and set MYTHWELCOME=true.<br /><br />Now that the PC isn't on all the time, cron processes do not run, so the weekly database backup doesn't happen. To fix this, just install the anacron package.<br /><br />The driver for the remote control I use converts the IR signals into key presses.<br />The keyboard controls for MythTV can be configured.<br />So you'd think that it should be possible to configure MythTV to use the key presses from the remote, without having to go through LIRC. It isn't, I'm not sure if this is a bug in MythTV or in the QT library it uses.<br /><br />When using the arrow keys on my remote, I noticed that the key presses were being duplicated.<br />It turned out that the IR sensors on both DVB tuners were receiving and understanding the signals.<br /><br />In Mythbuntu 8.10, HAL automatically configures the X11 server with all connected keyboards.<br />This includes the remote controls, so LIRC is unable to get exclusive access to the remote control. This bug has been fixed by creating a HAL configuration file to tell it to ignore<br />some keyboards that are known to be remote controls. This also allows me to ignore the IR sensor on one of the tuners.<br /><br />When Mythbuntu installs LIRC, it automatically creates the LIRC configuration files for MythTV, Mplayer, Vlc and Xine that are tailored for the remote control you're using. These are a useful starting point, but I've had to tweak them.Malcolm Parsonshttp://www.blogger.com/profile/05126957385276806613noreply@blogger.com0tag:blogger.com,1999:blog-835318021979066952.post-33228831338832659642009-01-31T20:00:00.000+00:002009-03-30T20:18:57.185+01:00MythTV hardware setup<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifmI54BWUqpU1XBTScsPVpbMf_U2gUbNwNi9whvyRW7G31QT8tDE5Qi-odjXVI1Ig1DyDey84fcnWTM3g4bJE2tiIQocKjFUomjGHT5doHhkROsPLq8BojwgOBuaEriulyHEjzzjKUGFU/s1600-h/DSCF1703.JPG"><img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 400px; height: 337px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifmI54BWUqpU1XBTScsPVpbMf_U2gUbNwNi9whvyRW7G31QT8tDE5Qi-odjXVI1Ig1DyDey84fcnWTM3g4bJE2tiIQocKjFUomjGHT5doHhkROsPLq8BojwgOBuaEriulyHEjzzjKUGFU/s400/DSCF1703.JPG" alt="" id="BLOGGER_PHOTO_ID_5318701329288464610" border="0" /></a><br />The <a href="http://www.shuttle.com/">Shuttle</a> K45 assembly instructions were usable. They say to apply thermal paste to the heatsink, but <a href="http://www.intel.com/">Intel</a> supply the heatsink with thermal paste already applied.<br /><br />It was a bit of a fiddle to get my DVB tuner card in the case, as the aerial socket near the top got in the way.<br /><br />The Celeron comes with a CPU fan with a 3 pin connector, but the K45 motherboard has 4 pins.<br />The 4th pin is used to control the fan speed. A 3 pin fan can be connected to a 4 pin motherboard, but the fan runs at full speed all the time.<br /><br />At full speed, this fan is very noisy, so I had to replace the heatsink and fan,<br />There isn't much room in the K45, so most heatsinks designed for low noise don't fit.<br />I selected an "<a href="http://www.arctic-cooling.com/">Arctic Cooling</a> Freezer 7 Low Profile", which has reduced the noise to bearable levels.<br />The heatsink is bigger than the supplied Intel heatsink, so the mount holes on the motherboard are too close, and small plastic extensions have to be fitted.<br />The motherboard has some SMD components near the mount holes, so the extensions do not fit flat, but they do still work.<br /><br />I think the power supply fan is currently the loudest noise source, but I don't feel like replacing it at the moment.<br /><br />The K45 has a clear face plate so that you can customise the case with your own images. I've used the MythTV logo for mine.Malcolm Parsonshttp://www.blogger.com/profile/05126957385276806613noreply@blogger.com2tag:blogger.com,1999:blog-835318021979066952.post-52951385680225170212009-01-25T20:00:00.000+00:002009-03-30T20:17:45.908+01:00Choosing MythTV HardwareContinued from previous post.<br /><br /><a href="http://www.dell.com/">Dell</a> sells a <a href="http://www1.euro.dell.com/content/products/productdetails.aspx/desktop-studio-hybrid?c=uk&cs=ukdhs1&l=en&ref=dthp&s=dhs">Studio Hybrid</a> computer which is very small and power efficient, but is too small for a PCI TV tuner card, and too expensive for what I want.<br /><br /><span id="_ctl1_lblDescription">The <a href="http://www.eclipsecomputers.com/product.aspx?code=CA-SONATA&af=50">Sonata Desktop mATX Media Center Style Case</a></span>, <a href="http://www.novatech.co.uk/novatech/specpage.html?sil-lc02b">Silverstone LC02 Media Center Case</a> and<span style="font-size:100%;"> <a href="http://www.ebuyer.com/product/123960?page=1&sortfilter=ascend&limit=50">Hiper Black Media Center Case</a></span>, etc are all too big.<br /><br /><a href="http://www.shuttle.com/">Shuttle</a> make a <a href="http://eu.shuttle.com/it/DesktopDefault.aspx/tabid-72/170_read-14663/">K45</a> barebones computer which is small, power efficient, cheap and has space for a PCI tuner card.<br />It doesn't have TV output, but as we now have a <a href="http://www.samsung.com/">Samsung</a> LCD TV with <a href="http://en.wikipedia.org/wiki/Vga">VGA</a> input, this isn't a problem.<br />It would be nice if it had <a href="http://en.wikipedia.org/wiki/SPDIF">S/PDIF</a> output for connecting to a surround sound system, but it's not required for current UK DVB-T broadcasts.<br /><br />I chose the K45. I hope it's quiet.<br /><br />That's the case, PSU, motherboard, GFX and audio sorted, and I already have 2 DVB-T tuners, which leaves CPU, RAM and HDD to choose.<br /><br />The motherboard has an Intel LGA775 slot, so it could be fitted with a Pentium Dual-core, a Celeron, a Core 2 Duo, etc. The Celeron is much cheaper than the others and has more than enough processing power for playback of DVB video. It also has a 35W <a href="http://en.wikipedia.org/wiki/Thermal_Design_Power">TDP</a>, so it shouldn't need lots of cooling.<br /><br />1GB of RAM should be enough.<br /><br />A 250GB hard drive would be plenty, but 500GB is only a few pounds more, so you'd be silly not to.<br /><br />Prices:<br /><table style="border-collapse: collapse;" border="1"><tbody><tr><th>Item</th><th>Price</th></tr><tr><td>Shuttle KPC K45</td><td>£75.81</td></tr><tr><td>Corsaid 1GB DDR2 RAM</td><td>£16.67</td></tr><tr><td>Seagate 500GB SATA HDD</td><td>£48.95</td></tr><tr><td>Intel Celeron 430</td><td>£23.74</td></tr><tr><th>Total</th><td>£165.17</td></tr></tbody></table><br /><br />To be continued.Malcolm Parsonshttp://www.blogger.com/profile/05126957385276806613noreply@blogger.com0tag:blogger.com,1999:blog-835318021979066952.post-60277996653844070592009-01-20T20:00:00.001+00:002009-03-30T20:18:20.339+01:00Why I'm switching back to MythTVI used to run <a href="http://www.mythtv.org/">MythTV</a> on my desktop computer. I had a dual head <a href="http://www.nvidia.com/">Nvidia</a> graphics card with TV output connected to a widescreen CRT TV. It recorded <a href="http://www.freeview.co.uk/">Freeview</a> using a <a href="http://www.hauppauge.com/">Hauppauge</a> <a href="http://en.wikipedia.com/wiki/DVB-T">DVB-T</a> tuner card.<br />The computer was in the lounge and was on all the time. The computer's fans were rather noisy.<br /><br />When we moved into our current house in 2007, the computer was moved into the study. The study doesn't have a television aerial, so we stopped using MythTV.<br /><br />We purchased a <a href="http://www.amazon.co.uk/Thomson-Top-Up-TV-Freeview/dp/B000TVHZLC">Thomson Top Up TV Freeview recorder</a> from <a href="http://www.tesco.com/">Tesco</a>.<br />This has two tuners, so it can record two channels at once. It's not silent, but is much quieter than my computer was. It doesn't require a subscription, but it can record Top Up TV if you do have a subscription.<br />It has a 14 day programme guide.<br /><br />We've been using this recorder for over a year, and have decided that it's time to switch back to MythTV.<br /><br />Why?<br /><br />Because the software sucks.<br /><br />It has a series link function, but the planned recordings page doesn't show all the episodes it will record, just the next one. This means that you can't see programme conflicts. When that episode has been recorded it finds the next one and schedules it. If the next episode isn't in the 14 day programme guide, because the show is missing a week, then it forgets the series link.<br /><br />It has a global setting to record the 5 minutes before and after a programme. You have to fast forward through these 5 minutes when starting to watch the programme. The scheduler isn't aware of this setting, and doesn't flag conflicts between programmes that start and end at the same time. The setting is remembered per planned recording, but you can't see or change it on existing planned recordings.<br /><br />It has 2 tuners, but the series link scheduler sends a conflict message when both tuners will be used.<br />The conflict message often displays garbage for the name of the program it conflicts with.<br />If you use the record 5 minutes before and after setting, then you get the conflict message 6 times.<br />Messages cannot be deleted until they have been read.<br /><br />The series link scheduler won't record a programme in a different time slot or from a different channel if there are conflicts with other recordings. The user has to resolve conflicts manually.<br /><br />If you watch a programme and don't finish it, it remembers where you got to, but when you start watching the programme again, you have to remember to press a different button.<br /><br />When fast forwarding through a recording, it sometimes forgets where it is and jumps back to the start of the recording.<br /><br />When deleting a recording, it sometimes hangs and reboots itself.<br /><br />If it reboots during a recording, it doesn't keep the part of the show it had been recording.<br /><br />If you are watching live interactive TV from a channel with a recording planned, then the recording is of the interactive stream, not the programme you wanted to record.<br /><br />The software was changed recently so that the recording of some Top Up TV content cannot be disabled.<br /><br />Even my wife is annoyed with it enough to want to replace it.<br /><br />So our requirements for a new MythTV box are:<br /><ul><li>Small (must fit underneath TV)</li><li>Quiet (the lounge is for relaxing)<br /></li><li>No keyboard/mouse (wife doesn't want a "computer" in the lounge).</li><li>Low power (Electricity isn't getting cheaper).</li><li>Cheap (or we'd just try a different set top box)<br /></li><li>2 tuners (we regularly record a BBC and ITV programme at the same time)<br /></li></ul>To be continued...Malcolm Parsonshttp://www.blogger.com/profile/05126957385276806613noreply@blogger.com0tag:blogger.com,1999:blog-835318021979066952.post-31411554797570038652008-09-25T13:02:00.003+01:002009-03-19T15:27:53.235+00:00Debugging child processesProblem:<br />Program A executes program B.<br />You want to debug program B.<br />B exits before you can attach your debugger.<br /><br />Solution:<br />Insert an infinite loop in main() in program B:<br /><br /><code>while(1) {}</code><br /><br />Run program A.<br />Attach debugger to program B.<br />Set the program counter to the next line:<br /><br />In <span style="font-family:courier new;">gdb</span>, use the "jump" command.<br />In Visual Studio, use the "Set next statement" command on the context menu.Malcolm Parsonshttp://www.blogger.com/profile/05126957385276806613noreply@blogger.com2tag:blogger.com,1999:blog-835318021979066952.post-83268364954374502822008-09-17T20:48:00.003+01:002009-03-19T15:27:35.982+00:00My First YouTube video<object height="350" width="425"> <param name="movie" value="http://www.youtube.com/v/jdMWXkJy2BQ"> <embed src="http://www.youtube.com/v/jdMWXkJy2BQ" type="application/x-shockwave-flash" height="350" width="425"></embed> </object><br /><br />I used <a href="http://www.kinodv.org/">kino</a> to edit the video and speed up the middle bit. The audio was a bit noisy after the speedup, but after exporting to FLV the audio had disappeared anyway.Malcolm Parsonshttp://www.blogger.com/profile/05126957385276806613noreply@blogger.com2tag:blogger.com,1999:blog-835318021979066952.post-42101640304098144162008-09-15T10:04:00.004+01:002009-03-19T15:27:07.409+00:00Energy Saving Mobile Phone Charger<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEizVFwDo4_O2H4i0kBUJx6Em5CNrRy7zFpWuubsvTJXJ9OClHFBMJKOy0QbegAsA1hCYDS_Z8fSu-Ms_arDZj_uk2Fb-TPEwk52486Dc2t9g3JlIDlBr9uiYnphXn8_SwFXoKNwF72BV7c/s1600-h/Screenshot-RealPlayer+-+BBC-1.png"><img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEizVFwDo4_O2H4i0kBUJx6Em5CNrRy7zFpWuubsvTJXJ9OClHFBMJKOy0QbegAsA1hCYDS_Z8fSu-Ms_arDZj_uk2Fb-TPEwk52486Dc2t9g3JlIDlBr9uiYnphXn8_SwFXoKNwF72BV7c/s400/Screenshot-RealPlayer+-+BBC-1.png" alt="" id="BLOGGER_PHOTO_ID_5246221910318324178" border="0" /></a><br />On the <a href="http://www.bbc.co.uk/click">BBC Click</a> programme on <a href="http://www.bbc.co.uk/mediaselector/check/player/nol/newsid_7500000/newsid_7506900?redirect=7506974.stm&news=1&nbram=1&nbwm=1&bbram=1&bbwm=1">20080711</a> they mentioned an "Energy saving charger" for mobile phones.<br /><br />It's a plug in phone charger that only uses power when there is a phone connected to it.<br />It works by having a switch that is activated by the weight of the phone - no phone = no power.<br /><br />Sounds like a great idea, but is it?<br /><br />In computing there is a saying "We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil."<br /><br />Which basically means, measure the problem and attack the worst bit, as it may not be the bit you thought it was.<br /><br />I've measured the power usage of a mobile phone charger with no phone attached, using a power meter between the device and the mains.<br />It was 0W.<br /><br />The <a href="http://www.inference.phy.cam.ac.uk/sustainable/charger/">Phone chargers - the truth</a> website found the same -<br /><blockquote>My measurements indicate that my phone chargers consume less than 0.5W when left plugged in. The total power consumption of the average Brit is 5000W. (Including car driving, home heating, and so forth, not just electricity.) So obeying the BBC's advice, always unplug the phone charger, could potentially reduce British energy consumption by one hundredth of one percent (if only people would do it).</blockquote>Mobile phone chargers are not a major contributor to energy waste.<br /><br />Don't waste your money on an "Energy Saving Charger".Malcolm Parsonshttp://www.blogger.com/profile/05126957385276806613noreply@blogger.com0tag:blogger.com,1999:blog-835318021979066952.post-11762832189796969192008-09-14T17:31:00.001+01:002008-09-14T17:35:29.096+01:00Lucky FrogI mowed the lawn today, and when I was putting the grass cuttings in our green bin I spotted a small frog.<br /><br />It had somehow survived being mown over and was sucked up with the grass.<br /><br />Clair decided to call it "Lucky".<br /><br />We've put it in the pond.Malcolm Parsonshttp://www.blogger.com/profile/05126957385276806613noreply@blogger.com0tag:blogger.com,1999:blog-835318021979066952.post-58673374353585611532008-09-13T12:15:00.001+01:002009-03-19T15:28:14.512+00:00Asymmetrical BodiesWhen I buy spectacles, they make each lens to correct the eyesight in the eye it will be in front of.<br /><br />Why do we have to buy a pair of shoes?<br />Wouldn't it be better to buy 2 shoes in the same style, each perfectly sized for the respective foot?<br /><br />Why aren't bras sold as left cups and right cups, with a clip front and back?Malcolm Parsonshttp://www.blogger.com/profile/05126957385276806613noreply@blogger.com0tag:blogger.com,1999:blog-835318021979066952.post-91491552038403026702008-09-13T11:31:00.000+01:002008-09-13T13:30:23.994+01:00Google ChromeMy first experience of a web browser was on the Amiga - IBrowse, AWeb and Voyager.<br />Computers in those days were so slow that you could watch the images on the page decompress line by line.<br />I didn't actually have internet access at the time, so I was viewing web sites that came on a CDROM with a computer magazine.<br /><br />Eventually we got dial-up internet access, at 33kbps.<br />Although the PC could now decompress the images quickly, they didn't arrive quickly from the internet.<br />I'd open several web pages in separate windows, so that I could read one page while the others were downloading.<br /><br />Tabbed browsing made this a much nicer, as it was much quicker to open a tab than a window.<br /><br />Now that we have broadband, the pages don't take long to download, but I still use lots of tabs with gmail and bloglines open most of the time.<br /><br />Browser memory usage has become an issue, as the web browser is no longer an application that is opened, used and then closed. It's now open all day. When an application is using lots of memory, it doesn't all fit in RAM at the same time, so the operating system has to swap some of it to disk and read it back later. The disk is much slower than RAM, so this slows the whole computer down.<br /><br />Firefox 3 has made some great improvements in memory usage, but as it's written in C++, it is unable to use a compacting garbage collector that moves objects around, so the memory gets fragmented.<br /><br />Google Chrome is avoiding this problem by having a process per tab. Freeing all the memory used by a process is very simple, just terminate the process.<br />I hope that this hasn't resulted in it being slow to open a tab.<br /><br />I can't wait to try Google Chrome when it is released for Linux.Malcolm Parsonshttp://www.blogger.com/profile/05126957385276806613noreply@blogger.com0tag:blogger.com,1999:blog-835318021979066952.post-26514061163579683182008-09-13T11:24:00.000+01:002008-09-13T11:29:01.774+01:00Time for a new blogIt looks like <a href="http://www.dslinux.org/">dslinux.org</a> has died, so I'm starting a new blog here.<br /><br />I haven't done any DSLinux development for ages, so don't expect to see DSLinux related posts here.Malcolm Parsonshttp://www.blogger.com/profile/05126957385276806613noreply@blogger.com4