VE301 is a tiny program acting as an internet radio. It provides an MPD client and an SDL window to choose the radio stations among other things. The display mimics the scale disk of a vintage radio like the ve301. It runs on a raspberry pi as well as on a normal desktop (though for the latter there are better mpd clients). The project was inspired by https://amrhein.eu/Radio2.
In addition to being an mpd client it can also display the current weather condition and reacts to the bluetooth daemon for devices that connect as audio source.
It is still a work in progress and needs a lot of clean up. I also guess there are still memory leaks and I am not sure whether the way I use SDL is correct or optimal. On a Raspberry PI 3B (with SDL in framebuffer) it is reasonably fast. The performance heavily depends on the config, e.g. bump mapping slows down the most.
Building: Go into the apropriate build folder (PC for desktop, Raspberry for Raspberry PI) and type make. This will probably fail as there are some dependencies to be installed. For convenience, if you are running a debian system, you can try "make debian-dependencies-install". This will install the dependencies
- libsdl2-dev
- libsdl2-image-dev
- libsdl2-ttf-dev
- libsdl2-gfx-dev
- libcurl4-openssl-dev
- dbus-1-dev
- mpd-client-dev
For Raspberry PI you need a running docker instead. Within the Raspberry folder type
sudo make armhf-docker
To clean
sudo make armhf-docker-clean
First run will take some time as it create the apropriate docker image.
CMake: Desktop builds can also be done with CMake:
cmake --preset desktop
cmake --build --preset desktop
For a Raspberry cross-build with CMake on Ubuntu, install the host build tools first:
sudo apt install cmake ninja-build pkg-config wget git build-essential
Then enable ARM64 packages and install the same cross-build toolchain and target libraries that the Docker image uses:
sudo dpkg --add-architecture arm64
sudo apt update
sudo apt install crossbuild-essential-arm64
sudo apt install \
libdbus-1-dev:arm64 \
libsdl2-dev:arm64 \
libsdl2-ttf-dev:arm64 \
libsdl2-gfx-dev:arm64 \
libsdl2-image-dev:arm64 \
libmpdclient-dev:arm64 \
libcurl4-gnutls-dev:arm64 \
libcjson-dev:arm64 \
libwebsockets-dev:arm64 \
libmnl-dev:arm64
WiringPi is required for Raspberry builds.
If you use the existing Docker-based Raspberry build, nothing extra is needed for WiringPi. Raspberry/Dockerfile already installs the ARM64 WiringPi package.
If you build outside Docker, install the same ARM64 WiringPi package manually:
wget https://github.com/WiringPi/WiringPi/releases/download/3.16/wiringpi_3.16_arm64.deb
sudo apt install ./wiringpi_3.16_arm64.deb
sudo ln -sf /usr/lib/libwiringPi.so.3.16 /usr/lib/libwiringPi.so
sudo ln -sf /usr/lib/libwiringPiDev.so.3.16 /usr/lib/libwiringPiDev.so
Then export the cross pkg-config environment:
export PKG_CONFIG_ALLOW_CROSS=1
export PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig
Now configure and build:
cmake --preset raspberry
cmake --build --preset raspberry
Usage: Create a directory ~/.ve301 Copy the sample sample.config to ~/.ve301/config Make sure that MPD is running on the machine indicated as mpd_host in the config (default is localhost). The MPD server should have a playlist called [Radio Streams].m3u. Its content is shown in the Radio submenu. The name is chosen because with the old MPD client MPDroid you can add Stations via you mobile.
On the desktop, use the mouse wheel to scroll through a menu, left click to activate an item / open a sub menu, right click to go back. Arrow keys Up and Down are used to increase/decrease volume. On the raspberry pi, the first button (Button A) replaces the mouse and the second (Button B) changes the volume.
If you want the current weather conditions displayed you need to get a (free) api key from http://api.openweathermap.org/data/2.5/weather and provide it in the config file together with the location and the units.