Features

Linamp is a stand alone music player that aims to be easy to use, have great sound quality and look good.

Currently, Linamp has the following features:


Inspiration

Winamp was one of my first exposures to music on computers. (the first one was probably the Mac OS 7 CD Audio Player, which had a similar look and feel).

Since then, I've always liked the default skin that came with Winamp, and loved the bar spectrum analyzer.

One day I was checking my email and got to the hackaday newsletter and saw the AIRAMP MP3 project, which inspired me to do my own take on how Winamp would look if it was part of a hi-fi mini system.

Specifically this image from the post stood out:

This render looks kind of similar to a mini system my dad used to own (and now I own), a circa 1983-1984 AIWA mini system:

(That AIWA Stereo today. Both the amplifier and the radio works, we used to have the cassette player but unfortunately it broke and got discarded in the early 2000s. I removed the side handles sometime in the 2010s because they were a little corroded. The Sony DVD player is being used as a CD player for this stereo)

(That AIWA Stereo in my teenage room in 2005, picture taken with a Palm Zire 72)

(Myself and the AIWA stereo, circa 1991, it still had the tape player)

The Youtuber Techmoan reviewed a similar system here:  

As you can see I have a long story with that stereo and always liked how it looks, so that gave me enough inspiration to do my own rendition of a retro hi-fi gear + retro audio software.


Design

I wanted to learn how to design sheet metal parts, so I tore down the AIWA radio and took pictures and measurements of the sheet metal case. I used that as inspiration for my own design and as reference dimensions.

(AIWA Stereo Tuner R22 top cover)

I used Onshape to design the sheet metal case and the front cover.

For manufacturing, I researched several providers including SendCutSend and Ponoko, but because some of those options didn't ship to my country or were too expensive, I ended up going with PCBWay.

I also ordered a version of the front cover 3D printed in Nylon from PCBWay, as I didn't have a good 3D printer at that time and wanted to experiment with different 3D printing technologies.

(The design as created in Onshape)

(The MJF 3D printed Nylon front covers from PCBWay. On the final build I ended up using a multi color 3D print I did on my Bambulab P1S instead.)

(Test fit of the sheet metal parts and front case, back side)

(Test fit of the sheet metal parts and front case, front side)

The sheet metal parts are made of 1mm thick anodized aluminum. Originally I wanted it to be sandblasted so it would have a similar look to the AIWA case, but a PCBWay support engineer told me that they didn't recommend it for 1mm thick aluminum because it could deform the metal, so I went with just anodized aluminum.

For the user interface, I originally planned on using physical buttons, by creating a custom PCB for the buttons, connecting it to the Raspberry Pi GPIO, and 3D printing the buttons. However, I also wanted to have the bar spectrum analyzer and the scrolling song information display to work and look as close as possible to the original Winamp app.

I searched for small, extra wide screens, but couldn't find one small enough to span the whole width of the player (so it could display both the spectrum analyzer and the track info widgets), that still left enough space for the physical buttons without making them comically large, so at the end, I decided on making all the whole interface a touch-based interface, using a small 7.9'' extra wide touch screen I found on Amazon.

I also designed a front cover that would cover the borders of the screen and made it look like the Winamp window.

For the screws, I used 6-32 UNC screws, (the ones used for computer cases), that I had laying around, left overs from old computer builds.


Inner workings

Inside Linamp, you will find the following hardware:

The idea was to expose any useful connections to the back panel of the player via extension cables. the sheet metal case was designed with a square hole so I could 3D print a custom back panel to host all the connections.

(The insides of Linamp, you can also see some 3D printed holders for the screen so it doesn't sink when pressing it, in this picture we have an early PLA back panel, the final one is a black PETG one with design tweaks and better looks)

(Final back panel, 3D printed in PETG using a Bambulab P1S)


Software

This is what took most of the time for this project, the bulk of the software development was done while I waited for the PCBWay parts to arrive, but I have kept making small improvements from time to time.

I'm a software engineer by trade, so I could have taken the easy path using the same web technologies that I use in my day job to quickly get something working. However I wanted a challenge and to learn new things, this was an important point on the criteria I used to choose the technologies I used.

I wanted the software to be fast, and to feel like a real product, a piece of hardware that would do one thing and do it well, and also, because the theme was "retro", it would be ideal to use something more "classical", not the newest and flashiest technology.

I also wanted to better understand how audio processing works from a programming perspective, so ideally having low level access to the audio pipeline would be a plus.

I choose Qt and Qt Widgets in C++, in part because I already had some experience with that technology, and because it comes with libraries for handling multimedia.

I used the Qt Multimedia libraries to start, basing my code on an example by Qt. This turned out to be both a blessing and a curse...

It was a blessing because I was able to have a basic interface that looked close to what I wanted and that was able to actually play music in no time (a couple of nights if I remember correctly), however, when I tried to implement the spectrum analyzer, things started to get complicated.

Originally, I wanted to implement the spectrum analyzer by using one functionality of the QMediaPlayer API which let you take a look at the raw audio data before it was sent to the OS for playback, however, it turns out that this functionality was removed in Qt6, so the only solution was to go down one abstraction level and re-implement a good part of the QMediaPlayer myself. This implies getting deep into buffer management, sample rates, data formats, etc, that was a lot of work, but I also learned a lot.

Once I had that, the next step was getting into FFTs, remembering my university days, and looking into open source projects' code for examples. One that was specially useful was Audacious code, an open source media player that already had the same kind of spectrum analyzer as it originally was made to be compatible with Winamp skins.

After having the FFT code, connecting it with my raw audio output from my media player code, I had the values needed to render the bars in the spectrum analyzer, the UI was implemented in pure native QtWidgets code, rendering the bars frame by frame at 30fps and calculating the decay of the small gray squares at the top of the bars following on what the Audacious folks did in their code.

Other things I implemented were the playlist handling, by extending what the Qt Multimedia example did and implementing a touch-friendly file browser, drag and drop for playlist editing, shuffle and repeat support, etc.

For controlling volume and balance, I'm using the ALSA C libraries to directly control it on a system-wide level, this was also very interesting to look into.

I could go on with more geeky details on the software, for now I'll leave it here and will write other posts about other functionalities and the interesting challenges I faced there. Other functionalities include CD support, Bluetooth and Spotify interfacing, some of those are still work in progress and imply doing more interesting stuff like:

If you want to hear more about this, please comment so I know what should I cover first!

(Early development, I tried to make the dimensions and aspect ratio as close as possible to the original Winamp)