24th April 2022
This page describes
Version 2 of the Sharpfin streaming media server for Reciva
radios which has several improvements over Version 1.
The improvements are:
The processing power on
the Reciva based radios is very limited so not everything is
possible. For example only lower bitrate streams (128kps and
below) are successful over https connections without buffering
delays. There are many compromises
used internally to get the most from the hardware within the
constraint of working as a media server rather than a
replacement of the main radio software.
As with version 1 of the media server this builds on the Sharpfin project which gives access to the internal software of the radios. The media server runs on the radio itself to retain the self-contained radio format. Your favorite stations can be entered via a webpage on the radio and then selected from the radio front panel almost like normal, but going via the Media Player.
You can also find a guide to working with Reciva radios here: Patching the Tangent Quattro Reciva radio
File integrity checks (sha256sum):
For upgrade to Version
2 just start at step 4 of the installation instructions. There
is no need to manually remove the original version.
If you have created
your own station lists these will be preserved through the
upgrade as long as they don't use the same name as any of the
example station lists included with the media server. To avoid
any risk of losing them you should download them from the radio
web interface before doing the upgrade.
Use of the media server is unchanged from Version 1. The example station lists show examples of HTTPS and HLS/AAC format streams (see within the UK-> BBC National folder via the radio Manage Stations page).
The internal media server is based on existing open source software adapted for use on the radio.
The Version 2 media
server is significantly more complex than Version 1. The
original media server simply routed MP3 streams to the media
player but despite may different attempts it was not possible to
remove buffering issues as real time incoming data just could
not match the expectations of the Reciva media player (it was
designed to play stored media, not a stream arriving in real
time). The solution to this was to use FFmpeg to transcode
incoming data to an uncompressed format (Sun Microsystems AU
audio format, some models of radio may also identify the stream
as a WAV format), thereby generating lots more data to keep the
Reciva media player happy. This transcode process then opened up
the possibility to convert AAC format streams in a similar way,
and also to access https streams.
A downside of the
transcoding process is that a high bitrate incoming stream can
generate (i) a higher CPU load than the radio can handle in real
time playback, and (ii) so much data it's just not possible for
the media player to handle it. Very high rate incoming streams
are therefore downsampled to avoid this saturation problem. It
will lead to some loss of potential audio quality - but
hopefully not too much of an issue. The bitrates displayed while
stations are playing are the AU format data rate flowing to the
media player, not the real radio stream rates. Any attempt to
switch format fails (e.g. directly forward incoming mp3 data at
high bitrates, but use the decoding to AU format at low
bitrates). The media player cannot handle a change of stream
format after the stream has started to play, and it must be
informed via a MIME header of the data format ahead of the
the Arm processor followed the same route as for version 1. The
resulting file was found to be too large to fit on the radio,
but could be compressed using the UPX executable packer (https://upx.github.io/).
This can compress executable files which are then transparently
decompressed using gzip (already on the radio) at run time. UPX
cannot compress library files, so compilation was changed to
create a static uShare binary integrating all the required parts
of the other libraries so as much could be compressed by UPX as
Even with compression
the resulting media server is about 612kB - absolutely tiny, but
quite large by Reciva radio storage standards! This is therefore
located in the /opt/ folder of the filesystem which is on the
/dev/mtdblock/4 partition and usually has around 780 to 800kB
space available. A link is made so that uShare appears in the
normal /usr/bin folder. This allows the media server and large
lists of stations to be stored on the radio without reaching its
The installation and
running of the version 2 media server has been tested and works
on the following radios and service packs:
As with any Sharpfin
modifications to the radio the media server comes with no
warranty and you proceed at your own risk.