Saturday, 4 November 2023

Fixing the BBC's removal of HLS streams in MinimServer

The BBC has decided to remove the streams I was using via MinimServer to play R3 through my impressive stereo. This was fixed by

  • Switching to a different URL in the Playlist 

#EXTINF:-1,[+R3;aac,48000] BBC Radio 3
http://as-hls-ww-live.akamaized.net/pool_904/live/ww/bbc_radio_three/bbc_radio_three.isml/bbc_radio_three-audio%3d320000.norewind.m3u8

  • Restarting everything
Hurrah. At least until the next idiotic BBC action.

Saturday, 20 June 2020

Rune has stopped playing playlists via upmpdcli :-9

I don't know when this happened, but with the various OpenHome clients I have (Lumin, Kazoo, UpPlay), but it appears that both my Rune-based renders are no longer working properly. When presented with a playlist via a UPnP client, they play the first track and then stop. Subsequent tracks can be played by direct selection, but they don't then roll to the next one. Bummer.

I've had a look with Wireshark, but the UPnP protocol is pretty impenetrable from scratch. Yes, I can see things happening, and kind of decode them, but it's not simple. I am using upmpdcli which comes standard with Rune to interface mpd to OpenHome/DLNA/UPnP. The Rune player works from the web interface, with the entirely different playlist mechanism working fine. So - I think there's something afoot with the UPnPClient-upmpdcli interface.

Research on the upmpdcli website reveals that the code is currently at version 1.4.12 - my version of Rune (which is hardly supported at all!) is at something mad like 0.13 !!

I have choices:
  • Go for another version of Rune - there is a much more recent version, with newer versions of everything, that has a truly horrible UI; frankly, I'd rather not have a UI, other than a means of simplifying restarts if things are hung up
  • Try to install a newer version of upmpdcli, which means 
    • Learning about ArchLinux pacman and so on
    • Possibly recompiling upmpdcli for ARM (!)
    • ... And thereby breaking the Rune I have
  • Switch to another product
    • Volumio - meh. 
    • Moode ?
    • picoreplayer - Logitech, not UPnP
Urgh. I happen to have a RPi with Volumio already installed, let's check that out first. Volumio has an OTA update facility, so I'll crank that up and see what happens.

OK, did that. It does now provide the continuous album play, but... the Tidal interface appears to be broken! I have to check back on my previous efforts in that respect.

Update - The Following Day!

In order to try things out independently , I installed upmpdcli on my Linux box, and pointed it at the Volumio MPD. It worked fine as a native OH renderer, showing up in all the right places, and controlling the Volumio MPD. Result, at least in terms of understanding the way things work, and providing further options (none of which seemed very useful!). The latest upmpdcli supports Tidal, BUT doesn't have a valid current API key/token, so although the Linn Kazzo CP shows it supports Tidal, you can't login.

Since I want Tidal (I'm paying for it!), and I don't want to give additional money Volumio for their Tidal interface to work when I'm fine with Kazoo, Lumin as CPs, and BubbleUPnPServer as a serverside streaming interface, I need to get things working as they were i.e.

                Linn Kazoo/Lumin CP
                         | | |
    ---------------------  | ------------------
    |                      |                  |
minimserver MS ------------|----------  Rune MPD+UPnP renderers
                 -----------                  |
                 |  |--------------------------       
    BubbleUPnPServer OH+Tidal

Much more investigation followed, into BubbleUPnPServer especially, trying to get consistent naming etc. so I could track what was seeing what and so on. However, couldn't seem to get BubbleUPnPServer (BUS) to "see" the new render instances i.e Volumio and the standalone upmpdcli instance. I spent ages tail-ing the log file, doing various restarts, with no luck...

Until, at one point, all the flipping upmpdcli instances became visible!! I was then able to add some test OpenHome renderer proxies in BUS, and they worked well, including Tidal. Then, just for the hell of it, I tried multiple tracks in a playlist for the renderers that previously hadn't worked, and they did. Damn. Anyway, after many hours, I'm back were I started, except that things work, and I know a lot more about how this setup actually works than I did! I might write something more about all this at some point.

I also loaded BubbleUPnP onto my Amazon Fire aka Android tablet, and it seems pretty handy. Other than a restriction on playlist length (16 max in the free version) and a certain tendency to overwrite the queue, it works ok, and of course it's easier to read on the bigger screen. I might even persuade my wife to use it!

Wednesday, 1 January 2020

Rune, bubbleUPnPServer, Linn, Names and Rooms

It's been a while since I've posted anything in this blog, largely because my RPi audio has just been working. However, a week or two (maybe more, grr) I thought it would be interesting to check out if Rune has moved on, and see if there were any interesting new features available.

I cautiously downloaded a fork of Rune, with a revised UI, and tried that, on a new SD card - yeah, that's a handy way to test things without changing the original.

Yuck. Hated the UI, and none of the features were interesting. I then tried a later version of the original Rune - didn't seem to work consistently with the Linn Kazoo OpenHome CP programs I have (iOS app and MacOs). Drat. I upgraded, or at least, re-installed the bubbleupnpserver I have installed on a separate RPi running the media server using minimserver, in an attempt to make it work better. Nope.

Back in went the original SD card. Things seemed to work... except they didn't. Songs would cut out and then recover, or not, completely randomly. Now, I had used an Apple AirPort to provide a wired-seeming interface to the RPi, rather than rely on the RPi built-in wireless. So I ran a cable from room A to room B, and ditched the Airport. That seemed to fix the outages... but still the Tidal streaming service, from the Bubble UPnP Server, wouldn't work, and the Linn Kazoo instances couldn't always find the renderers... Argh. Very Boring Indeed, especially as there didn't seem to be a rhyme or reason to this.

Looking at logs, it seemed that the Bubble Server and RPi Rune instance would get out of step, and the Linn Kazoos would be asking for the wrong IP address. Weird, as the IP address of the RPi Rune renderer is a dynamically advertised property, using DNLA/OpenHome protocols. I tried snooping packets using tcpdump and wireshark, but that wasn't much help, largely because I couldn't see the server <> Rune <> Kazoo packets because I wasn't running wireshark on the right box.

A bit of googling, and looking at the configuration file for upmpdcli, the program that provides the DNLA/UPnP interface for Rune, and I realised a number of things:

  • The mysterious "Main Room" device that Kazoo could see is actually the native upmpdcli, which provides an OpenHome interface itself, offering a Room where the Product is located i.e. a potential grouping of multiple OH devices e.g. preamp, renderer,  whose name is configured in the config file using ohproductroom
  • Bubble UPnP Server allows configuration of the Product and the Room, as separate fields. I had always used the same value for these - why not? Didn't seem to make any difference - but clearly there was confusion about the devices/rooms I was using
  • upmpdcli also offeres a Tidal interface!! Handy to know...
  • Kazoo detects the Room name, not the Product name!! Weird, but I suppose it makes sense if your devices/products have to be grouped together for control of a single audio stream
So - I

  • reinstalled Bubble UPnP Server, just because...
  • renamed the upmpdcli DNLA service on my Rune instance, so it would be redetected, and also altered the Room name, just in case
  • redetected the Rune DNLA service in BUPnPS, and used different names for the OH Product and Room fields
Now things appear to work. For the time being anyway. Let's see how long they work for...

Incidentally, I tried using the two different OH interfaces available, from MacOs Kazoo:

  • Bubble UPnP Server OH wrapper for upmpdcli DNLA
  • upmpdcli native OH interface
They both work, but only the Bubble currently supports Tidal - I think there's more configuration required for upmpdcli. However, if I start a track from the media server in one, then switch to the other, it all gets a bit confused, and I'm not really surprised. I think I'll stick to the Bubble one for now, at least until I've worked out how to configure upmpdcli properly!

Update

It appears that the Rune version that I'm running has a very old upmpdcli, which does not include the Tidal interface. A little investigation reveals that because Rune is based on ArchLinux, rather than Raspbian (as Volumio is), the Debian apt-get mechanism for upgrading it doesn't work - ArchLinux uses PacMan, which an entirely different mechanism. Bugger. Almost makes one consider using a raw Raspbian, with an installation of MPD and umpmdcli to build one's won headless version. After all, I never really use the web interface for selecting music, although I do check it to see what's working sometimes!

Wednesday, 25 October 2017

RPi for in-car video player - tasks remaining

Things are going ok with this project.

A reminder of requirements:
  1. Play on composite video screens using 4 wire connection (from RPi)
  2. Play DVDs from DVDs, using USB DVD player
  3. Web interface for controlling the gizmo
  4. Play stuff from Airplay or equivalent
  5. Provide an in-car wireless hub so it's easy to get into from phones etc.
What remains to be done?
  1. Attach DVD drive, check that DVDs play
    1. This might require purchasing an MPEG-2 key from RPi - £2.50 :-p
  2. Connect composite video screen, see how that works
  3. Fiddle with Airplay, but I suspect this is going to hard with Apple's proprietary protocol
  4. Do some power supply testing - I'm getting a lightning flash symbol on the upper right of the screen, which is an indication that the power supply is occasionally inadequate!
    1. This should include in-car testing from a USB supply thingy
Then package it all up somehow. Marv.

RPi for in-car video player Part Deux

Saved the previous SD card image, switched to LibreElec. Boots straight into Kodi, had to add lcd_rotate=2 to config.txt on the SD card itself (not inside Linux) to get it to be the right way up for the stupid Pi Official LCD Stand, which has the LCD the wrong way up. Bah.

Is this better? It's exactly the same... but let's check out the networking!

It appears to use connman, whatever that is... No sign of /etc/network/interfaces!

Checked connman man entry etc. Interesting. It appears to be possible to remove an interface from connman management, which presumably means one could then do something else with it.

Update: Wow!! There's a wireless AP option on the System/Networks page. Enabled it, can see AP on my iPhone and MBP, but it won't accept the passphrase!! Grrr...

Update: lots of looking for this and that - turned on logging, looked in journalctl, found a suspicious error, which I Googled... no joy. Then I switched on connman logging (touch /storage/.config/debug_connman) and rebooted. Now it works!! Coolio.

Monday, 23 October 2017

RPi for in-car video player




The g-kids have some DVD players in the car, so I thought it might be interesting to try building an RPi-based video streamer that would have some more flexibility in control and outputs.

Requirements:
  1. Play on composite video screens using 4 wire connection (from RPi)
  2. Play DVDs from DVDs, using USB DVD player
  3. Web interface for controlling the gizmo
  4. Play stuff from Airplay or equivalent
  5. Provide an in-car wireless hub so it's easy to get into from phones etc.
Checked out the Kodi options, and they are:
  1. Packaged distro - I'm concerned they won't meet requirement 5, because I won't be able to fiddle with the distro enough
    1. LibreElec
    2. OpenElec
    3. OSMC
  2. Raspbian with Kodi installed - maximum flexibility, so let's go with that.
Experimenting with my LCD-equipped RPi stack, including Digi+ ripoff digital interface...

Installed NOOBS on a 8GB SD card, opted for latest Raspbian install

Did 
  • sudo apt-get update
  • sudo apt-get install kodi - Version 17.4 Krypton apparently
  • waited for a bit...
  • plugged in USB keyboard
  • now trying to get some media installed somehow!
  • Tried adding Minimserver uPnP server, but entire system crashed!! Or at least, screen blanked and nothing happened...
  • Added USB_Storage from file server, as Pictures, and can now show a folder in a rotating slideshow - hurray!
  • Tried adding Server as music storage - crashed again!
    • Turns out it's not crashing - the display is blanking when running Kodi over the desktop, so did the following:
    • sudo vi /etc/lightdm/lightdm.conf
    • [Seat:*] uncommented and edited linexserver-command=X -s 0 dpms
    • This appears to have done the trick!
Requirement 3 - Web Interface: Enabled web interface Kodi options, connected to raspberrypi.local/8080 and bingo! UI here... It allows for playing stuff, but not a system-level interface, for that you need to go directly to the server. I'm really struggling with this... it's not intuitive at all! For example, I've added my USB memory stick to the library (I think) in Kodi, but I can't see my movies in the WebUI.

OK, added my Server/Music folder as a library and I can see it on the WebUI now. Hurray. Still can't see the content of the USB stick - it claims "no content" when it tries to index it! Strange.

Requirement X - Play stuff: Currently still trying to add some media files - trying a USB stick which I'll mount. Takes a long time to copy many GB! Works fine - added two movies, currently playing one - see above for indexing/access.

Requirement 2 - Play DVDs: Configuration menu provides for DVD playing, so all I need is an appropriate USB-connected DVD/Blueray drive! Ordered one off eBay for £8, should arrive Friday.

Requirement 1 - Connect using composite video 4 wires: I don't have a cable, but I do have an elderly in-car DVD player inherited off the guys with composite video in. I'll get a cable and try it out - the only problem is likely to be getting the connections right, so I might need 3.5 jack to 4 RCA and v.v. to enable easy switching around. Bought 3.5mm -> RCA Female, RCA Male -> 3.5mm on eBay, so can easily connect anything to anything.

Requirement 4 - Airplay: Just tried that out from MacBook Pro running iTunes and Mad Men DVD rip from HD. Oops. MBP said it was trying to play on Kodi, but Kodi froze, then stiffed - it's now restarted (?) and looking for me to tell it what to do. But the WebUI did declare it was playing airplay.m4v, which is pretty interesting.

Requirement 5 - Wifi hub: Using this helpful note I did
  • sudo apt-get install hostapd udhcpd
And then did a couple of other things, but noticed that the /etc/networks/interfaces file was nothing like the example, and after some delving in the /etc/dhcpcd.conf file, decided I needed a better documented approach that matched my RPi config!! Bugger.

This looks like a better approach... I note that this also assumes there are useful lines in the interfaces config file, unlike mine! Hey ho...
  • The usual
    • sudo apt-get update
    • sudo apt-get dist-upgrade
  • As previously with some extras
    • sudo apt-get install dnsmasq hostapd
  • Stop the new services...
    • sudo systemctl stop dnsmasq
    • sudo systemctl stop hostapd
  • Disable current wlan0 handling
    • sudo nano /etc/dhcpcd.conf
    • Add deny interfaces wlan0 somewhere...
    • Saved as /etc/dhcpcd.conf.new
  • Time to try editing the interfaces file!
  • Nope, that really isn't working. The dhcpcd demon quits declaring that it's not going to get involved because someone has configured a static IP address in interfaces - guilty as charged! Another post explains exactly why - apparently the latest Raspbian version (Stretch) has radically changed how the networking is organised, and none of the old stuff works. I can concur.
So - what to do? Frankly, Linux networking is a nightmare. It is almost impossible to untangle, and not explained anywhere sensible, with so many levels of indirection and files it's really not obvious what does what. Hmm... I wonder if one of the Kodi-specific builds is simpler? They are only Linux after all.



Wednesday, 2 August 2017

RPi 7" Touch Screen - it's alive!

I've been living with the rather lashed up setup of the RPi and IQAudio DAC, albeit in a nice shiny black box, in conjunction with the Linkwitz LXMinis and accompanying miniDSP 2x4 for maybe six months now. The main drawbacks, if there are any, are

  • Wife finds it impossible to use, because she hasn't really got a handle on using a browser or the Kazoo app to select music to play, and really she'd like to have the facility for putting on a CD, as we once could :-o
  • Turning off the music at source without having the phone or laptop to hand whilst walking through the stereo listening room is a pain - yeah, bit of a 1st world problem, but Lumin, Kazoo etc are relatively slow to get their act together
  • Whilst connecting the CD player (which has an analogue output only, and 5 pin DIN at that, bloody Naim with their silly ideas about hifi) is possible, it currently involves unplugging the RPi from the miniDSP and plugging the CD player into it instead. Boring.
It would be nice (as well as interesting :-) ) to have a handy interface with the renderer. So why not a nice RPi Official © RPi Inc 7" Touch Screen Display? Coming right up, sir...

Bought from thepihut.com, along with a nifty black plexiglass stand, for about £65 (ouch, but hey...), arrived in a couple of days. 

The screen is chunky, heavy, black bezel. It has a PCB with the serial-parallel electronics bolted on the back. You have to attach the RPi to it with the usual threaded standoffs, and then there's the option of powering it all by
  1. Connecting USB supply to the screen, and linking power to the RPi with a short USB-USB Micro cable
  2. Connecting USB supply to the RPi, and using the supplied patch-type cables to connect RPi GPIO 5.5v/Gnd to screen 5.5v/Gnd inputs
Looks like using a hat DAC prevents option 2, because the DAC uses the GPIO pins...

Screen standing with stand :-) - cool!
The screen and stand are easily assembled, once you take the attached PCB off the screen! The stand is multi-layer plexiglass, and one layer is a bit tricky to get the right way round, but there's only two ways to put it so...

I struggled a bit with the flat ribbon cable to connect the RPi display connector to the screen connector, but I find that with all these flat cable connectors - it's hard to see which side of the connecter the cable goes in!

Rear of screen and stand - note re-attached PCB
I removed the SPDIF interface board from my sample RPi3 and attached it, using the GPIO pin power connections. A quick power up - screen on, RPi on, BUT... the screen was just showing varicoloured vertical lines. Yuck. Power off, retry connection to RPi, power up, and hooray! This time the screen worked, and ended up showing a terminal prompt. Lovely...

Rear view showing attached/connected RPi
I then used a browser on my laptop to point to the Rune instance on the RPi (which was running a previously set up image...) and configured "Start a browser on HDMI/TFT" in the Settings. Restart... and...

Screen showing Rune browser interface!

Result!!

A quick test of the touch capabilities - all the screen touch points and selections work fine, as defined by the browser page. The lower ones are a tiny bit tricky to hit, but it's easy to adjust one's touch point :-). Fantastic, and ridiculously easy. Maybe I should have tried something harder, like integrating a cheap display...