Git Product home page Git Product logo

tvbirr's Introduction

TVBIRR

TV Box Internet Radio Recorder (TVBIRR) is an Ansible playbook to configure a X96 Air or X96 Max(+) TV box to function as an internet radio streaming and recording device that you can operate entirely with the infrared remote included with the TV box. It includes a playlist of over 21000 free-to-play internet radio stations and text-to-speech support to tell you over the speakers what you're listening to.

X96 Max Plus pic

TVBIRR uses music on console (moc) to stream channels and playlists, keybinder to convert the infrared remote keypresses into commands, JACK for audio playback, streams are recorded to MP3 files using jack_capture and espeak is used to speak the names of titles (tracks or shows) and stations.

You can see when jack_capture is recording the currently playing station because CARD is displayed on the TV box LED display. You can easily customise it to play playlists of locally stored music. TVBIRR runs in the background leaving your TV box free to serve other tasks.

Requirements

You need two things to run TVBIRR:

A X96 Air, X96 Max Plus or X96 Max TV box. At present TVBIRR only fully supports those TV boxes because they all use the same openvfd LED display configuration. You should still be able to run TVBIRR with all of its features, with a little tweaking of its scripts, on any on the TV boxes that have a LED display thats compatible with one of the armbian-led preset files. I'd be willing to accept patches to add support for other TV boxes to TVBIRR.

You also need a Linux-compatible USB to audio jack adapter, USB soundcard or USB speaker. Most USB audio devices will work. There are two reasons for this requirement. The onboard audio on the X96 Max Plus only works under Android, not Armbian Linux and its pretty poor quality anyway. Also, A cheap £2 USB headphone jack adapter (I bought 2 for £3) will provide much better audio quality than the onboard audio jack of most budget TV boxes.

Installation

Before you can install or use TVBIRR you must first install Armbian for Amlogic TV Boxes aka s9xxx Armbian. You should be able to install TVBIRR under a Ubuntu or Debian-based build of s9xxx Armbian. If you have a X96 Air or an X96 Max Plus then you want to download a S905X3 build of Armbian, S905X3 being the model of the System On a Chip (SoC) used in the X96 Air and the X96 Max+.

TIP: nmtui is useful for easily configuring your wifi from the Armbian console, if you are using wifi.

When you've got Armbian running on your TV box, you can install TVBIRR by running the following commands as root:

apt update && apt upgrade
apt install ansible
git clone https://github.com/danboid/TVBIRR.git
cd TVBIRR
ansible-playbook TVBIRR.yaml

Using TVBIRR

After the Ansible playbook has been run and its installed and configured the various components of TVBIRR, reboot your TV box with a USB audio device attached and you can start using TVBIRR with the remote, without having to have a HDMI display attached to your TV box. You can push the play button to start playing the default playlist as soon as the LED clock lights up.

TVBIRR remote controls

Note that if you are using the default playlist of over 21000 stations, there is a 10-15 second+ delay before the first station will start to play because moc, the music player, is quite slow at loading large playlists so be patient! The maintainer of moc has been made aware of this issue and is working on a fix. You may be able to reduce this initial startup time by reducing the size of the default playlist, /root/playlists/TVBIRR-All-Stations.m3u. Once the playlist has loaded, skipping stations is almost instantaneous.

If you are using the default station playlist, it might make sense to leave it running and turn the volume down to silent instead of using the stop button because TVBIRR/moc reloads the full playlist each time you push the play button on the remote.

By default, TVBIRR will record its MP3s to the same disk that you are running Armbian on, under /root/mp3s. Be warned that if you fill your OS disk with MP3s your TV box will stop running and likely won't boot so if you do use the record feature it is recommended to adjust the path used by the jack_capture recording command in /etc/keybinder.conf to save your recordings to a different MicroSD card or an external USB disk.

Using TVBIRR as a Bluetooth speaker

You can configure your TVBIRR setup to simultaneously function as a wireless speaker/amplifier for Bluetooth devices like phones and tablets with some extra configuration.

Customising /etc/keybinder.conf

If you want to change the action of the IR remote buttons you need to find out what values to use with keybinder for each button. Run the following command then push buttons on your remote to print their codes. You can assign commands to these keycodes in /etc/keybinder.conf:

evtest /dev/input/by-path/platform-ff808000.ir-event

Note that the default IR button actions are hardcoded into the kernel so you have to edit the relevant bit of the meson-ir kernel source and rebuild the kernel to disable the power button, for example.

Generating the default playlist

TVBIRR includes a default playlist of over 21000 stations but if you wanted to generate the playlist yourself, run:

curl -L http://de1.api.radio-browser.info/json/stations > radiobrowser.json
jq '.[].url_resolved' radiobrowser.json > TVBIRR-All-Stations.m3u
sed -i '/^"https/d;s/"//g;/^$/d' TVBIRR-All-Stations.m3u

tvbirr's People

Contributors

danboid avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

s-n-g dinhchinh82

tvbirr's Issues

No more armbian-led ?

Hi,

Nice project!
I just got a X96max+ and wanted to give it a try, this would be a perfect fit for me.
I'm using the latest install from armbian-amlogic.

At install however, ansible complains:

TASK [Add x96maxplus-sd.conf to armbian-led] **************************************************************************************************************************************************************************************************
fatal: [localhost]: FAILED! => {"changed": false, "msg": "Destination /usr/sbin/armbian-led does not exist !", "rc": 257}

Indeed, there is none, the location of the docs changed, and there is no more mention of armbian-led on the current repo.

Is this fixable ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.