Blog entries tagged with "television"

My setup using RemotePi and a Harmony remote

Sunday, June 27th, 2021 at 11:19 am

Recently I wrote about how the RemotePi Board was the key to my desired setup for using a Raspberry Pi running Kodi as a media player. After the initial setup I needed to tweek some things related to my universal remote and while I don’t expect the RemotePi website to disappear, this post is my documentation on how I set it up (and how it works).

Raspberry Pi hardware

When I ordered the RemotePi I also ordered their open case as it has a hole for the power button and I didn’t want to hack up the existing case I was using. Based on the provided parts you shouldn’t need the instructions, it is pretty obvious how it all goes together.

Raspberry Pi software

It was interesting adding the scripts and config as I learned how it hooked into the LibreElec Startup & Shutdown process.

/storage/.config/autostart.sh

Runs at boot, in this case used to launch irswitch.sh in the background

#!/bin/bash
(/storage/.config/irswitch.sh)&

/storage/.config/irswitch.sh

Running in the background monitoring GPIO pin 14 for a signal from the RemotePi. This is how pressing the power button on the remote results in a graceful shutdown of the Pi.

#!/bin/bash
# this is the GPIO pin receiving the shut-down signal
GPIOpin1=14
echo "$GPIOpin1" > /sys/class/gpio/export
echo "in" > /sys/class/gpio/gpio$GPIOpin1/direction
while true; do
  sleep 1
  power=$(cat /sys/class/gpio/gpio$GPIOpin1/value)
  if [ $power != 0 ]; then
    echo "out" > /sys/class/gpio/gpio$GPIOpin1/direction
    echo "1" > /sys/class/gpio/gpio$GPIOpin1/value
    sleep 3
    poweroff
  fi
done

/storage/.config/shutdown.sh

Runs when the Pi is shutting down this tells the RemotePi via GPIO pin 15 to also shutdown and kill power to the Pi.

#!/bin/bash
if [ "$1" != "reboot" ]; then
  GPIOpin=15
  GPIOpin1=14
  echo "$GPIOpin" > /sys/class/gpio/export
  # execute shutdown sequence on pin
  echo "out" > /sys/class/gpio/gpio$GPIOpin/direction
  echo "1" > /sys/class/gpio/gpio$GPIOpin/value
  usleep 125000
  echo "0" > /sys/class/gpio/gpio$GPIOpin/value
  usleep 200000
  echo "1" > /sys/class/gpio/gpio$GPIOpin/value
  usleep 400000
  echo "0" > /sys/class/gpio/gpio$GPIOpin/value
  # set GPIO 14 high to feedback shutdown to RemotePi Board
  # because the irswitch.sh has already been terminated
  echo "$GPIOpin1" > /sys/class/gpio/export
  echo "out" > /sys/class/gpio/gpio$GPIOpin1/direction
  echo "1" > /sys/class/gpio/gpio$GPIOpin1/value
  usleep 4000000
fi

Remote control

MSL Digital have provided instructions for two remotes, a generic DVD player remote (that they can also provide) or how to configure a Logitech Harmony remote.

I wanted to keep using my old Harmony 650 remote so that is the path I choose. I was a bit surprised that once I dug up the MyHarmony software and remembered how to login that the config for my remote was still there. It was reasonable straightforward to add a “Media Center PC” device and configure a new “Kodi” activity.

The tricky part of the config was that I found it best to go into the settings for the device and change the power settings from “I press the same button for on and for off” to “I press two different buttons for on and for off”. The MCE device has PowerOn, PowerOff and PowerToggle commands. Not using PowerToggle is a cleaner solution, eg if the Pi was off but the Harmony thought it was still on, pressing the all off button would actually turn the Pi back on. Using discrete on and off will avoid that.

Once I had my remote sending MCE commands I trained the RemotePi to know about PowerOn and PowerOff:

  1. hold down button on RemotePi for 10 seconds, until the LED flashes red/green
  2. On the Harmony press PowerOn (be in devices and not activity to get the list of all commands)
  3. The LED will flash, then press PowerOff
  4. The LED will flash twice

Telling LibreELEC/Kodi about the remote and its buttons was amazingly easy and involved putting the SD card in a reader (so not on the Pi) and adding one line:

config.txt

dtoverlay=gpio-ir,rc-map-name=rc-rc6-mce

The documentation does say that CEC has to be disabled for an IR remote to work, I wonder if there was some automatic detection going on as I found that CEC stopped working as soon as the RemotePi was installed, in the end it didn’t matter as I knew I would be disabling CEC anyway by going to:

  • System > Settings > System > Input Devices > Peripherals > CEC

Update: Force resolution

After working fine for many weeks, LibreELEC/Kodi started only running at 640×480, I tested with another Pi and something seems to have changed with my television and it wasn’t detecting the resolutions correctly, to get around this I force the Pi to boot up with 1920×1080 by adding the following:

config.txt

hdmi_group=1
hdmi_mode=16

Tagged with: ,

Musing again on a media player

Monday, June 21st, 2021 at 10:11 pm

A long time ago I wrote a couple of times about different methods of playing media on my television, it looks like I never posted about the solution, which ended up being to use PS3 Media Server (now known as Universal Media Server) with all transcoding turned off, not via writing a custom FUSE filesystem to alter file extensions, but by finding the right configuration option.

As well as working nicely for my television I also picked up a cheap Android tablet and used a UPnP/DNLA app and VLC to be able to play the media on that as well. That tablet started to show its age so I picked up a newer one, at which point I found the UPnP/DNLA app didn’t exist anymore, but fortunately the ability to browse is now built directly in to VLC for Android.

It also turned out that I don’t often watch things on my television, instead playing them on my second monitor in my study, so I wasn’t that concerned when I noticed that media using newer codecs wouldn’t play on my television. This is now an eleven year old television that hasn’t had a firmware update in a long time, so I started looking in to media players again, and not just for me, but also for my parents.

Chromecast

About two years ago I picked up a basic Chromecast to try. It was quite easy to set up and worked exactly as described. However after some hands on experience I found that it wasn’t suitable. If you want to stream from somewhere else it is great, but the lack of control while playing (my deal breaker for a WDTV Live) and that you can’t just use it to find something to start playing is a problem.

It did come in handy for the first few months of lockdown last year when a couple of podcasts livestreamed episodes each week. The player is browser based but supports casting so I could get it started from my PC and then go relax on the couch.

I did try using my phone to control the Chromecast, but I wanted to use a traditional remote control and look at the television screen, not at the touchscreen in my hand.

Kodi on a Raspberry Pi

I find it interesting that as much as things change they also stay the same as ten years ago one thing I was considering was XBMC, well these days it is called Kodi and late last year I loaded that (using LibreELEC onto an old Raspberry Pi. This worked astonishingly well with it getting commands from the television over HDMI-CEC and importantly it being able to play the newer codecs.

Unfortunately there was a glaring issue, the Model B+ that I was using was not powerful enough to smoothly play those newer codecs. As I had proven the concept I ordered a Pi 3 B+ (at the time the only place I could find with reasonable postage didn’t have stock of Pi 4 models) which resolved that issue.

After a few months of using it every so often I was finding it ok for my purposes as a UPnP/DNLA browser and player, but I was unhappy with:

  • The odd way that Kodi would browse the UPnP share, it would display them all with a year of 1969 (aka zero in unix epoch) and put everything in alphabetical order, not folders at the top like is typical.
  • No way to power off the Pi, you can shut it down but it can’t wake up, to do that you need to power cycle it. Not what I wanted for something I might use a couple of times a month where I wanted the convenience of everything through my existing universal remote control.
  • It took me a while to work out what the controls were, which wasn’t helped by being limited to the set of commands my television would send over HDMI-CEC, and it seemed a bit laggy.

Chromecast with Google TV

While the Pi with Kodi was working fine for my occasional needs, a bit over a month ago I cam across something talking about the newer Chromecast, not the one that I already had, but the “Chromecast with Google TV” which looked like quite a nice Android device for a very good price, so I picked one up.

Like my previous Chromecast (which I still have in the cupboard) it was quite easy to set this one up, the remote control was nice and responsive and it didn’t take me long to install VLC and browse my media. As I used it I started to dislike it more and more…

  • You can’t get rid of the ads. Even though I uninstalled the included apps and switched to the app only mode, the minimal I could get the home screen down to was three ads and the icon to start VLC
  • You can’t configure overscan. I understand that on newer televisions you can turn off overscan on HDMI inputs, but not on mine and the Chromecast doesn’t have any configuration (like there is with Kodi) so I was stuck with missing edges. Not that noticeable when watching a movie, but when the menus are chopped off…
  • Google Assistant. I’m not comfortable with a microphone under the control of Google, it should only activate when you press the button and I was pleased to find that app only mode should disable it, but I was still uneasy
  • Remote control. While the bluetooth remote is nice and responsive, it isn’t that comfortable to hold and I couldn’t get it to reliably turn off my television by HDMI-CEC or IR. Being bluetooth I couldn’t use my existing universal remote, and I don’t fancy spending $$$ on replacing that with a hub type remote.
  • Signed in to Google. Unfortunately this is expected these days, but you have to be signed in for it to work, it can’t operate as a standalone media player
  • Wifi. While the wifi is convenient, I have wired ethernet at my television, so it would be good to be able to use that. Yes I know you can buy an official wired adapter or go the USB-C dongle route…
  • VLC for Android needs more work. I understand that this version of VLC is still new, but it was too glitchy (eg would jump when scrolling through a list of files, or jump to an odd place when returning from playing a video) for me to use as an (almost) out of the box solution

Returning to Kodi on the Pi

The more I was using it the more I realised that I preferred running Kodi on the Pi as I didn’t need to be signed in, I could just plug it into the wired ethernet at my television. So made sure to return the Chromecast within 30 days for a change of mind refund. The one feature that I will not have with Kodi is the ability to cast a livestream, but I do still have the older Chromecast…

Once I had Kodi running again I started to look into the issues I had with browsing over UPnP. I quickly learned that the recommendation is to simply not use UPnP, to instead share over the network using HTTP, NFS or SMB… Ah, why was I fixated on UPnP? I am constantly accessing the storage on my Linux box from Windows via SMB, how did I not think of using that? And yes it is the right option, the ordering is what you expect, I get file sizes, it even gives preview thumbnails and video resolution/codec information.

So now my remaining issue was the convenience of powering the Pi on and off, there are lots of open source projects based around a Pi, surely someone has designed something I could build? I was also aware that I could add an IR receiver directly to the Pi, that might be better than relying on HDMI-CEC for control.

I was kicking myself again as it didn’t take me long to find the RemotePi Board, an infrared remote controlled power switch for the Raspberry Pi that will work with LibreELEC/Kodi and also give me an IR receiver to control Kodi.

At half the price of the Pi itself there are people I know that would consider this too expensive, but for a ready made solution it is perfect for me so I placed an order. As the pricing was in EUR I assumed it was coming from in Europe, instead they are based in Thailand (it does say this on the ordering/shipping page) and it took three weeks to get here, yay for inconsistencies of international shipping!

The good news is that the RemotePi arrived today and I wasted no time in installing it on the Pi, following the instructions to add the startup/shutdown scripts, telling it to enable the IR receiver for an MCE remote control and then reconfiguring my universal remote control to know about a MCE device.

It is already so much more convenient. I can pick up the remote and select the “Kodi” activity which will turn on the television and the Pi, It takes about 20 seconds to fully boot and I can then browse to a video to watch. Once I am done I can then hit the off button and the remote will turn off the television and tell the Pi to shutdown. Very nice!

but what about…

It would be remiss of me if I did not mention that during all of this there are other media players that I looked up. There are a bunch of cheap Android TV based devices, there are the Amazon Fire ones, there is the Nvidia Shield, there is the Apple TV, etc… Some of these are quite expensive, some are reported to be of poor quality and some are biased towards particular services. For me there is something that feels right about opting for an open source solution, not just that it does what I want for the least money…

My final note is that earlier I mentioned my parents who have a (newer than mine) Samsung TV with apps for ABC iView, SBS on Demand and some others. These apps have been painful in getting updates in the past, so I can imagine at some point I will recommend they they get the Chromecast with Google TV as that does seem to fit their use case quite well.

Tagged with: , ,

An ad hoc 3D television comparison

Sunday, December 11th, 2011 at 7:55 pm

A few months ago I conducted an ad hoc comparison of two 3D televisions.

The equipment involved included:

  • my 40″ Samsung 200Hz television
  • Hamish’s 40″ Sony 100Hz television
  • my Sony Bluray player
  • Hamish’s Playstation 3

This resulted in three test setups:

  • Sony television and Playstation 3
  • Samsung television and Playstation 3
  • Samsung television and Sony Blu-ray player.

For each setup we compared:

  • a car racing game in 3D
  • a scene from an animated 3D movie

The car racing game was observed to be less jerky on my television than it was on Hamish’s. The output from the Playstation was 720 at 60Hz. In this situation the higher refresh rate of my television is what gave the better result. We don’t know exactly how fast the 3D runs, does a 60Hz signal result in a 120Hz output once it alternates between eyes? If so then it is clear why 100Hz was not as smooth.

Watching the animated movie was different as we didn’t notice any real difference between the televisions. In this case the output was 1080 at 24Hz. If it was really outputting 48Hz, that is well within the 100Hz of the Sony.

What was quite surprising to us was that we noticed an improvement when the same scene was played through the Sony Blu-ray player instead of the Playstation 3. Is the Blu-ray player handling the playback better in hardware than the Playstation was handling in software?

Of course none of this really matters as I have not yet and I don’t have any plan to actually watch a movie in 3D. It has also been a long time since I have played games, but even then that would be on the computer, not on a console.

Tagged with: ,

Has it really been one year?

Wednesday, December 7th, 2011 at 10:38 pm

One year ago today was settlement day, the day that I picked up some keys and took possession of my place. Within two weeks from then I had moved in, but in the almost year since then I have been working through a todo list. A list that is seemingly endless as items are added at around the same rate that they are completed.

The completed things (mostly in order of east to west through the property) include:

  • new television
  • mounting said television on the wall
  • new shelves to fit in the alcoves on either side of the television
  • additional antenna socket in the study
  • network cabling between the television and the study
  • a two seater couch and two armchairs
  • a number of my photos mounted on the walls in 16×20″ frames
  • all sorts of kitchen utensils, cutlery, crockey and appliances
  • swing out rubbish bin under the kitchen sink
  • two stools for the kitchen bench
  • new deadlocks and entrance sets, including the garage
  • remote opener for the garage door
  • additional towel rail in the bathroom
  • shelves within the cupboard in the study
  • cutting down trees and removing stumps from the front garden
  • digging over front garden beds
  • removing bamboo along driveway
  • taking down unused curtain rail hooks

The larger items currently on the todo list include:

  • put up venetian blind (currently on order) in kitchen
  • get quotes for new screen doors
  • finalise new line for edge of the garden beds and put in concrete mower strip
  • rug in the lounge and a new coffee table

Here’s to another year…

Tagged with: , ,

Streaming over the network

Sunday, May 15th, 2011 at 2:15 pm

For a while I have been occasionally trying out UPNP media servers so I can play videos from my Linux server directly on my television. This is to avoid the WDTV Live that annoyingly doesn’t allow you to skip/jump forward/backward.

I haven’t actually tried that many, but today I think I have found one I like: PS3 Media Server.

This is a UPNP media server written in Java, originally for the PS3, but since then extended to work as a generic UPNP media server. It works quite well with my television, crucially allowing me to skip forward and backward through the video. I can even hold down the button to skip at larger increments. Yay!

But that was the good news.

As with everything there is a downside. While the player worked fine streaming .avi files, at first I couldn’t play an .mkv as it wanted to transcode it before streaming it over the network. At first I thought I had surpassed that issue by installing the mencoder package, until I discovered that the act of transcoding the video messed up the ability to skip forward or backward. It would skip, but it would take over a minute to resume playback. Not good.

Because I knew the television could play .mkv files from USB storage, on a hunch I renamed one of them to .avi to see if that would trick PS3 Media Server into not transcoding and if the television would play it. Success.

However, I am not prepared to permanently rename all .mkv files to .avi. I wonder, is there anything that can mount a filesystem, but let me translate filenames on the fly… there are FUSE modules for perl…

Tagged with: , ,

Anyone selling a first generation iPad?

Thursday, April 21st, 2011 at 12:12 am

Right now I am only a fraction away from buying an iPad. However, not an iPad 2, but a first generation iPad for a much more reasonable price.

Why? Let me back up a bit…

After moving into my place I did briefly consider putting a television in the kitchen. This would be in addition to the one in the lounge and in addition to my computer. But I decided to be reasonable and I resisted the tempation. The logical place to put a tv would have required an extra power point, plus it would be another place to run a network cable to. So there is no television in the kitchen.

However something that became annoying was that I would be at my computer working on something with video playing in the corner of the screen when I needed to go cook dinner. So I would pause the video, go to the kitchen for 20/30 minutes and then resume the video.

This got me thinking. What if I had a tablet that I could take to the kitchen with me that continued to play the video. My first thought was something that I could redirect the video stream to, but then I started to think about mounting the tablet next to my monitor (freeing up some screen real estate) and playing the video on it all of the time.

This tablet didn’t need to be very fancy. It needed wireless ethernet for connectivity and in addition to playing video a web browser would be handy while watching the television in the lounge.

My first thought was the iPad, but I initially dismissed it because of its price and limited video format support. My second thought was an Android tablet which has better support for formats and playing directly off the network, but they are not as refined as the iPad, yet still as expensive.

Then the iPad 2 came out, so I could consider a first generation iPad to be within my price range and a little investigation found at least two options for streaming video from a server that transcoded it.

Using an iPad borrowed from work I first gave VLC streamer a try, but it was quite fiddly to use and the server component didn’t give feedback and control over how many videos were being transcoded. It was also annoying that it left transcoded chunks behind on disk.

I gave the iPad another try tonight, this time with Air Video which has proven to be a success over the past four hours with a variety of formats including a 1080 mkv. I quite like how it can detect a supported format, can perform live conversion, or can convert in the background. The full version of the app (which lets you see more than a couple of videos per folder) would be worth the couple of dollar purchase price.

So now I am on the hunt for an iPad. Either from someone I know who is upgrading to an iPad 2, or I will turn to eBay…

Tagged with: ,

The TV on the wall

Saturday, April 16th, 2011 at 9:55 pm

Shortly after musing about a media player, and before I moved, I picked up a WD TV Live. My reasoning being that it was cheap enough that replacing it later wouldn’t be much of a sunk cost and I knew it would serve my immediate needs once I moved.

And it did, albeit on an old CRT TV. So, thanks to the boxing day sales, I bought a new TV, a 40″ Samsung Series 7. I had decided on 40″ as that was a suitable size for the space and I ended up with the Samsung as it was both thin and the sockets on the back did not come straight out. This model supports 3D which I didn’t really care about, but the price difference with the next model down (only 2D) wasn’t much and the 3D model has a redemption of a second TV, some 3D glasses and some 3D movies. As I don’t need a second TV, my plan is to sell it and also some of the 3D glasses (I don’t need six pairs) which makes the price even better.

I am fortunate that the previous owners had removed a gas heater and converted the space into an alove with a pipe running through to the wall where, after buying a nice thin mount, I have mounted the television. Inside the alcove are powerpoints and the aerial socket, the only thing mising is a network connection.

So what is in the alcove? Two devices, the WDTV Live and a Sony BluRay player. While the WDTV Live will get the most use in playing media from the network, I wanted something that could play DVDs and since I have a 3D TV I decided to splurge a bit on an inexpensive player that supported 3D movies. My choice came down to the Sony and a Samsung player for the same price, but I decided on the Sony as when I was fiddling with the Samsung player on a Samsung TV in the store, I couldn’t tell if I was in the menu for the player or the TV as they looked the same.

With the addition of an ethernet switch and a cable running around the walls (eventually I will run it under the floor) all three devices are on the network and I am satisfied with the setup. More so after picking up a universal remote to control it all

But there is an issue. An issue with the WDTV Live that is could turn into a deal breaker.

For some reason the WDTV Live does not let you skip forward or backward when playing a video. It does let you fast forward or rewind, but skipping back 30 seconds is much easier than rewinding the same amount. It is also an issue skipping forward to a point where you want to resume playback.

An alternative is to watch videos directly on the TV – it does support an impressive array of formats – but it cannot read off network shares and connecting via USB storage isn’t as convenient. The TV can play from a UPNP server, but so far I am not impressed with the couple of Linux based ones I have tried so far.

Investigations will continue…

Tagged with: ,

Musings on a media player

Saturday, November 20th, 2010 at 10:53 pm

Settlement for my place is coming up soon, in two and a bit weeks. My current plan is to move the big items (bed, drawers, corner desk) in on the following Saturday, three weeks from today. Although not high on the list of priorities, I have been spending a fair amount of time researching my options for a media centre. While the television I will have initially is a CRT hand-me-down, I expect to have something more modern with HDMI inputs.

At a high level I have been considering three option types: small dedicated device, XBMC running on a low power PC, or Windows Media Center on a PC.

All three of these options will allow me to play media from the network on the television, while the third option allows addition of a TV tuner so that broadcast TV can be recorded directly on the media centre. Also the PC based options can include a DVD (maybe Blueray?) drive for playback from discs.

The small dedicated device that it at the top of my list is the WD TV Live. I know at least three people with it (they are happy with it) and it could be a nice simple cheap solution. It may be possible to use third party firmware and a USB DVD drive to add on DVD playback.

The low power PC running XBMC would be based on something like the ASRock ION 330HT. This specific unit has the nice advantage of coming with a media centre remote that is fully supported, however the much larger disadvantage is the significantly higher price tag. XMBC does have additional functionality over the WD TV Live in regard to having a library of media instead of just being file based, but I cannot see myself using that enough to justify the extra cost.

The PC running Windows Media Centre would be based on common desktop PC hardware, from what I can tell the cost might be comparable to a ready-made low power PC. With a TV tuner I could directly record broadcast TV, and as it is on top of Windows 7, I could also switch out to a web browser or any other installed application.

Until today I was going to head down the Windows Media Centre path, but I am now considering the WD TV Live again. It will work out of the box and it is very cheap, so cheap that I would have no problem replacing it later with a Windows Media Centre box. It also has a composite video out so I could use it with the hand-me-down CRT television.

After bookmarking it a few weeks ago, today I got around to having a look at DV Scheduler. This is one of many alternatives I found for recording TV in the background of a Windows box. I had begun researching that as my new ‘server’ will be Windows based, so why not have the computer that is on all the time anyway handle the recording?

I know I could have been doing that for a while now under Linux with MythTV, but I am lazy and I wanted something that would install and just work. I had looked at other Windows based recording (eg the TV engine from MediaPortal) but I hadn’t been able to get them working properly. DV Scheduler on the other hand just worked once I installed it. Another option would be to record in the same way I currently record TV, using the software that came with the tuner card, but that doesn’t have a web interface or the ability to schedule recordings based on a search of an electronic program guide.

In the next few weeks I may change my mind again, but a followup post can be expected…

Tagged with: , ,

Lose some, win some

Monday, December 18th, 2006 at 7:29 pm

The Twentieth Anniversary Macintosh that I spotted on eBay last week finished today. I was the winning bidder for a few seconds and it ended up going for over AU$1000, a few hundred more than I was willing to pay.

On the bright side my order of television DVDs arrived today after a long wait:

This adds up to over a hundred hours of viewing. I hope I get through them by March.

I also bought myself a new SD card for my camera. As well as doubling the capacity the 2GB SanDisk Ultra II Plus card that I got has a built in USB connector. This means that I can easily copy photos off (or other files onto) the card on any computer with a USB port.

Tagged with: , , , ,

What do washing machines have to do with rolling a car?

Thursday, October 19th, 2006 at 9:45 pm

Many years ago I remember watching a show on tv titled The Secret Life of Machines. Yesterday, Dan of Dan’s Data fame pointed out that this series is essential viewing AND its creator,Tim Hunkin, is offering them as a free download via torrents. (Tim’s site has them but Dan’s post has better links)

So what do washing machines have to do with rolling a car?

In the washing machine episode in the first season they demonstrate the power of a solenoid valve that enables a car to be rolled over by firing a piece of wood out of the bottom via compressed air. This is just one example of the tangents they go down in order to explain how aspects of the machine work.

Tagged with:

Ham I Am

Sunday, December 25th, 2005 at 10:55 pm

Every christmas since I saw the Ham I Am episode of Good Eats a few years ago I lobbied to try out the city ham recipe. This year I was successful and it looks likely that I will be asked to do it every year…

On a side note I found the episode transcript significantly more useful than the recipe as the commentary contains crucial information.

Tagged with: ,

Thunderbirds are GO

Thursday, September 9th, 2004 at 2:48 pm

Last week I placed, on a whim, a bid for all thirty-two episodes of Thunderbirds on DVD. I ended up having the winning bid and I picked them up from the post office this morning. Now to find time to watch them all…

Tagged with: