• WANTED: Happy members who like to discuss audio and other topics related to our interest. Desire to learn and share knowledge of science required. There are many reviews of audio hardware and expert members to help answer your questions. Click here to have your audio equipment measured for free!

Turning an Amazon Fire TV Stick (2nd gen) into a media player with DSP

dominikz

Addicted to Fun and Learning
Forum Donor
Joined
Oct 10, 2020
Messages
811
Likes
2,655
So after looking into some depth at room correction SW, I wanted to see how to implement DSP into my system. Initially I looked at various of-the-shelf solutions, but in the end decided to see if I can work something out myself - ultimately audio DSP is just a bit of computing power combined with the right SW, right? :)

First a bit of introduction - my living room system is based around the Denon RCD-N9 (Ceol) mini stereo system powering a pair of Revel M16s. The Denon is fed by a couple of external sources: Samsung TV (via optical in), Chromecast audio (via second optical in) and a turntable (via analog in).
Obviously there was no easy way to introduce EQ for all external sources, and not way at all to do it for internal sources too (streaming, media player, CD, FM, internet radio...), so I decided to focus on what could be done easily - add a streamer device to the TV via HDMI.

Fortunately I had an unused Amazon Fire TV Stick (2nd gen) laying around that seemed to fit the bill nicely:
  • Small form factor
  • HDMI output, meaning digital audio out which will be carried through TVs digital optical out onward to the Denon stereo
  • FireOS is Android based (in this case Android 5.1)
  • Should have enough computing power to run simple DSP
  • Has a remote control and simple UI
  • Runs on USB power
The issue with FireOS is of course a limited number of available apps, and in general Android often requires root access to do more advanced systemwide audio FX - but I hoped there was a way around that :)

Next I needed to see what apps are available to run DSP with precise enough EQ to do room correction. The choice is not very large, unfortunately, so fairly quickly I decided to pursue Viper4Android as the target - being one of the very few offering systemwide convolution.

NOTE: The procedure I did here voids any warranty, and could have permanently damaged my device. If you decide to pursue something similar, please be aware of the risk and don't attempt this unless you're OK with potentially destroying the device. I can take no liability for any damage resulting from trying to replicate these results.

After quite a lot of reading and investigation, I went for it - this is the overall procedure I followed:
  1. First step was to install TWRP custom recovery on the stick, as described here. This requires disassembling the stick and physically shorting *very* small contact on an SMD resistor to ground and may not be for the fainthearted.
    20210129_195259.jpg
    Initially I was scratching my head a bit how to do this at all, but then found this video suggesting to use a piece of soldering wire, clip it to the HDMI shell for ground and use a piece of tape to secure it. This worked like a charm:
    20210129_223644.jpg
  2. After TWRP is installed, one can do a backup of the stock Amazon ROM, and use TWRP to install a custom ROM. I decided to use the lightweight LineageOS 12.1 custom ROM and installed it according to instructions available here.
  3. Once LineageOS was installed, I used TWRP to install other add-ons like OpenGApps (tvstock for for Android 5.1 - LineageOS image comes with basically nothing - no web browser, appstore...) and Magisk (for root access required to use Viper4Android).
    Here I also sideloaded Viper4Android v2.5 - I had to use the old version since v2.6 couldn't gain root access and install the audio driver, and v2.7 requires Android 6 :()
  4. Next step was to boot the stick (I had some issues with pairing the remote but just followed the XDA forum instructions above to fix it), and open Magisk Manager to install the Audio Modification Library - required for Viper4Android audio driver installation later
  5. Lastly, I installed Viper4Android from the sideloaded apk. At this point it is useful to pair a BT mouse with the stick, as it is much easier to navigate what follows with a cursor. Opening Viper4Android for the first time, I had to install its audio driver. This raises a prompt asking you to confirm if the app should be given root access. This I missed originally as I couldn't confirm it with the remote - this is where the mouse comes in handy :D Anyway, you can change the permissions in Magisk even if you missed the prompt, which is what I did.
  6. This basically was it. Here I installed various apps - like Deezer for Android TV, VLC player etc so I can give the thing a test run. I loaded impulse response on the stick using SFTTV app, loaded them into Viper4Android (Viper4Android GUI definitely required use of a mouse!) and was very happy to see it working :D
Next I wanted to see how well the DSP works (i.e. what is the bit-depth of processing, does it introduce any artefacts, does it have limited filter taps....) so I used REW offline measurement capability to record sweeps running through the DSP, via the optical out of the TV and into the optical in of my RME Babyface silver edition soundcard. These are the results:
Amazon Fire TV Stick (2nd) gen with LineageOS and Viper4Android - FR.png

As you can see filters look exactly the same as the original ones - so looks like there is no limitation regarding filter tap count of Viper4Android convolution engine!

Next I wanted to see distortion and dynamic range with 32-bit float source sweep file and 32-bit float impulse response used in convolution. Note that this is end-to-end digital domain (no DA conversion) - with a 32bit file the noise floor should be vanishingly low. Here are the results:
Amazon Fire TV Stick (2nd) gen with LineageOS and Viper4Android - THD.png

Noise floor rises to about -100dB (so a little better than 16bits) - perhaps the DSP engine dithers to ~16 bit? For reference this is how the noise floor of the source sweep file looks:
Sweep file baseline noise floor.png

As you can see the noise is down ~144dB - so 24bit dynamic range (although the file is encoded as 32bit float).

Anyway, 100dB range is in my use more than enough - my amp doesn't come close to that anyway. So the whole thing seems to work as expected!

Here are a few comments on usability:
  • LineageOS seems to work faster and smoother than the FireOS
  • Voice commands do not work, nor do title screen recommendations. I don't use either so don't mind.
  • The OS freezes occasionally and requires the stick to be restarted. :confused: This doesn't happen very often so I can tolerate it
  • Viper4Android starts with the OS automatically - which is nice
  • Most of the time DSP works really well, but there were some issues:
    • It happens that the DSP sometimes causes a track to stutter when starting :confused:, but never in playback
    • I had a few occasions when DSP stopped working spontaneously, and convolution had to be disabled/enabled to start working again
    • It can happen that DSP processing drops out for a second when switching tracks
Overall I'm quite happy with the results. :) It is nice to make good use of an unused piece of tech - especially if you can learn a thing or two along the way!
 
Top Bottom