Overview of 2021

This year brought us many challenges and events. Fortunately, December 31st is just around the corner! I really want to believe that 2022 will not be able to outperform 2021 and will treat us gentler…

2021

AIMP5

This year we released AIMP5. This was a major update of the player’s Windows version. It was extremely well-received by our users. Even several news publications covered our release. Of course, we also scored some negative “accomplishments”.

  • The day we launched public beta testing, the ESET antivirus vendor noticed AIMP and added it to the list of unwanted software.
    The reason for this turned out to be the Yandex ad offer that shows up in the installer for the Russian-speaking audience.

    Note that the offer had been there out in the open for over 10 years. We never hid it in the installer behind checkboxes or anything like that. Hundreds of free programs have been using this monetization scheme, but we were the only ones that got blocked.

    An attempt to work things out with ESET’s support made everything worse. They additionally flagged all our releases starting with v4.0 and blacklisted our email addresses. Fortunately, few AIMP users use ESET solutions.

    So AIMP now has its own signature: Win32/AIMP.X PUA. And what have you achieved this year?!
  • On the day of the release, we encountered a problem with the Last.fm service. As part of the new AIMP Scrobbler plugin, we’d expanded the integration with this service. Requests with our API key produced an error message that reported exceeding the maximum number of requests.

    As we found out later, the request number limit is calculated per key instead of per user (as is customary in most other services). We are currently working with Last.fm on bringing the plugin back to life. So pay attention to details when reading documentation!

AIMP for Android

We went through hell to release version 3.20! Our users refused to accept our new file access policy and accused us of intentionally limiting their rights.

Two months have passed since the release. During this time we lost 35% of our audience and our rating fell below 4 stars. Unfortunately, we do not expect the situation to improve any time soon – our rating keeps falling, although not as drastically as in the first month. There is a possibility that in 2022 there will be no one to rate the new release.

However, the situation still has its advantages:

  • Now we will tie the release not to the day when new Android requirements are issued, but to the day when the new Android version is released. This way, we hope people will see clearly where such decisions are coming from.
  • The player’s PC version again became more popular than its mobile version. This means we’ll focus more on the PC version when working on the next update.

AIMP Audio Cutter as Proving Grounds

On August 8th, on AIMP’s 15th birthday, we released a small utility for the Android OS – AIMP Audio Cutter. For us, this utility became proving grounds where we tested several technical solutions simultaneously:

The plugin as a standalone application

Android does not have a specific system of plugins and add-ons – each developer invents something new. Moreover, developers of Android announced that, starting with the Android 12 release, they would disable the ability for applications to load plugins’ code directly from external storages because of security reasons. So using this approach was out of the question – and we needed to find some other option. If we ship our plugin as a standalone APK, users would see its icon. And it’s safe to say they would probably want to interact with it. This gave us the new idea: what if the plugin won’t just be able to integrate into the player, but will also be able to function as a standalone application?

Standard Approaches and Standard Libraries Only

The application uses only those approaches and libraries that Google recommends. Our goal was to explore all the approaches that Google recommends in action, and to determine their pros and cons. This way, we could estimate whether we could use them in the player.

The first thing we tested was how to work with files through the safe file access method. Audio Cutter was the utility where we figured out how to interact with the new API before employing this mechanism in the mobile player.

The second – and the most important thing – was the music library. As the source of music and ringtones, Audio Cutter uses the music library that is built into the OS. While we developed and tested the feature, we found several serious problems:

  1. The music library contains only the files that the system sees as music files: aac, mp3, m4a, wav, ogg, flac, and wma. You can forget about all other formats – there is no access to them whatsoever.
  2. If you have an audio file’s ID from the music library, there is still no way to find where the file is on the disk. This means the utility will not be automatically picking up CUE, lyrics and album covers that are stored as separate files.
  3. The index update interval is unstable. The music library can be updated right after new music have been added, or after the data transfer from the PC has been disconnected, or only after rebooting the system.

The result is all the same: the standard music library is no good. We concluded that if we were to create a music library for the player – we would need to write our own engine.

A Few Words Instead of a Conclusion

This year threw many challenges at us that required a lot of effort. The released versions are still fairly fresh and keep bringing us much feedback – so it’s too early to make plans for the next release.

And while we have not settled upon a specific roadmap for 2022, we invite you to participate in a small survey about what you would like to see in the mobile and
PC versions in the future.

AIMP for Android - File Access Policy

AIMP v3.20 for OS Android is recently completed the beta testing stage and users started to complain of difficulties that occurred with sd-card file access. In this article, we’ll try to answer all questions. 

We summarized the majority of your feedback to the following questions: 

  • App has all permissions, but no one folder in the list!
  • Why can’t I add the Downloads folder? 
  • Why should I add each folder separately? 
  • Why can’t I specify the sd-card’s root as a path to a file? 
  • Why is the new approach not optional? 
  • The new version slows down. The previous versions were much better! 

Excursus in history 

Starting with Android 10, Google decided to attend to privacy. The company did all its bests to prevent user data from illegal access from third-party applications. 

That’s how the Scoped Storage mechanism has appeared. How does it work? The main feature is what third-party applications do not have full access to the file system anymore (even in reading mode). These applications can access only those files and folders to which a user is granted access (yes, you can grant access to individual files).  

However, the use of the Scoped Storage mechanism had recommended, but optional character in Android 10. Developers could choose between the Scoped Storage and classic access mechanism. 

Android 11 release changed everything. Now Scoped Storage is the only mechanism that third-party applications can use. The exception applies only to certain program categories such as file managers, antiviruses, and other built-in applications. 

Now, when you are filled in how Android evolution affects our work, we can answer your questions. 

FAQ 

Why can’t I add the Downloads folder? 

The Downloads folder stores everything you download. It means that this folder can also contain confidential files. That’s why Google allows you to grant permission only to individual files instead of the entire folder. 

Why should I add each folder separately? Why can’t I specify the sd-card’s root as a path to a file? 

The same situation as with the previous question. When you give access to the sd-card’s root, you also grant access to all its internal folders that can store confidential files. It’s unsafe, so Google blocks this action. 

How do old applications work on Android 11? 

Such applications work in backward compatibility mode with that Android version for which they were developed. Therefore, the mechanism’s requirements do not apply to them. 

Why did you adapt AIMP for Andriod 11? It would be better if you released AIMP updates for the previous OS version. 

Google envisaged this: you have to update your OS to the previous (as a minimum) Android version until the 1st of November. For instance, since this year developers were obliged to migrate to Android 11 or Android 12. Otherwise, Google will forbid them to release application updates. 

The new version slows down. 

It’s one of the main disadvantages of the Scoped Storage mechanism. We have been tried to do all our best for a bit over three months to maintain the same performance as in the previous version. Unfortunately, we have not been able to achieve this goal. 

App has all permissions, but no one folder in the list!

Additionally to usual permissions that grant to app at first starting, you need to grant an access to each folders. If you miss hints from the app, do following steps to do that:

1. Open playlist screen via main menu or swipe gesture:

2. Click the “+” button and select “Add Files…” to invoke built-in file manager dialog:

3. To grant an access to specified folder click the “banner”:

4. In opened system dialog*, select the folder that contains your music and click the “Use this folder” button:

* If app display error message instead of invoke system dialog, make sure that you have installed and enabled system app called “Files” or “Documents”. Additionally, try to install official Google Files app.

AIMP for Android: Audio Cutter

For the 15th birthday of the AIMP project, we have prepared small “gift” for our users: the Audio Cutter app. It is a new tool that extends features of mobile version of AIMP. The tool is designed to create and manage ringtones.

Main window contains few tabs with content:

My Music

This tab contains all user’s music files that indexed by system audio library.

Following commands are available for music files:

  • Crop
  • Open with external app
  • Share the music file using external app or bluetooth
  • Set as default ringtone for call, alarm or notification
  • Set as ringtone for specified contact
  • Remove from the device

My Ringtones

This tab contains custom and system ringtones.

Following commands are available for ringtones:

  • Crop
  • Open with external app
  • Share the ringtone using external app or bluetooth
  • Set as default ringtone for call, alarm or notification
  • Set as ringtone for specified contact
  • Remove custom ringtone from the device

Note that some external app may not process system ringtones because of access restrictions to system files.

My Contacts

This tab contains your contacts and ringtones that set to it.

Following commands are available for contacts:

  • Open ringtone with external app
  • Select ringtone for the contact
  • Reset contact’s ringtone to default ringtone

Creating the ringtone

Its so easy to create the ringtone. First, you need to find the file or ringtone that will be used to create new ringtone. Next, select the “Crop..” command in its context menu. The app will invoke simple audio editor:

Here you need to select range to cut, use the sliders or time edit boxes to do that. Next, click the “save” button. The app will export selected range of source audio file to new file using MP3 encoder in background. You will see new entry in “My Ringtones” when export will done.

Integration with AIMP

The Audio Cutter feature has been implemented as separate application, but it integrates with the AIMP player app. Now, when you invoke the “set as ringtone” command in AIMP, the player will invoke the Audio Cutter app to process the command.

Thanks to the tool, now AIMP can set as ringtone all file formats, including files split by CUE. If file format is not supported by OS natively, the Audio Cutter will convert it to MP3.

Summary

Key features:

  • An ability to set audio file as default ringtone for alarm / call / notification
  • An ability to set audio file as ringtone for specified contact
  • An ability to convert unsupported by OS file formats to MP3
  • An ability to crop audio file or existing ringtone
  • An ability to extract audio part to external MP3 file
  • An ability to preview / share audio file
  • Integration with the AIMP player
  • Supports for night mode

Join to beta-testing program now!

https://play.google.com/store/apps/details?id=com.aimp.cutter

AIMP5: Skin Engine

Performance

I looked through all modern skins from our add-ons catalog and picked several scenarios that had a negative impact on AIMP performance and UI response. I did my best to resolve them at the skin engine level.

Blurring

I found that in most skins, blurring was the main source of interface lags. In 80% of cases blurring was applied to font shadows and in 15% – when an album cover was used as a background for some elements. Only 5% fell on the BlurredGlass feature for dynamic content.

I researched the most common scenarios. Aiming to resolve the most frequently encountered lags, I implemented several enhancements that then appeared in AIMP5:

  • Instead of the Gaus blur algorithm, skins now use the stack-based blur algorithm.  While it offers inferior quality at high blurring settings, it works two times faster.
  • Small raster images now use the stack-based algorithm’s single-threaded version. The blurring effect is applied quicker, because there is no need for additional threads to be initialized.
  • At the CoverArtDisplay control level, we introduced the BlurLevel property. It allows the engine to prepare an album cover’s blurred version beforehand. This is faster than the former mechanics – blurring the cover every time it renders like how it happens with BlurredGlass.

Masks

The algorithm for applying the mask to the layer now uses a table of pre-calculated values. This change slightly increased the amount of memory used (64 KB), but gave a 2-fold boost in performance.

Animations

We implemented shared access to temporary buffers and supported their caching. This sped up transition animation by up to five times.

Visualizations

We also redesigned the API used to transfer visualization data between the sound engine and the skin engine. For AIMP5 this meant a decrease in data conversion procedures and a 3.5-time productivity increase. 

“Tile” Fill Mode

Fill speed grew significantly in scenarios when fill mode is set to “tile” and over 10 copies or the original texture are displayed.

Album Covers

Our skin statistics showed an interesting trend: album covers are usually displayed in four particular sizes. In previous versions, the data provider of the current track stored the original cover art and scaled it to the target size on rendering. In AIMP5, the provider has a small cache that stores the cover art’s last 4 sizes.

If the cache can accommodate all cover sizes a skin needs, AIMP renders covers 12 times faster than before. However, the rendering speed may drop down to 1 in skins that display more cover sizes.

High DPI Emulation

AIMP supports High DPI emulation mode. The skin engine uses anti-aliasing and stretches images and windows to fit the desired size. In AIMP5, we sped up this process by 1.5 times.

ACS5

ACS5 is a new container for skin resources that outperforms its predecessors. It optimizes resource storage and helps the skin engine load resources:

  • Instead of solid compression, the container compresses each resource individually. Although this change increased the skin size by 40%, it sped up loading time for large skins. This became possible after we eliminated the temporary buffer that was necessary for the solid container to unpack.

    For example:
    the Nagra SNST 4K skin took up 94 MB in the ASC4 container, and 102 MB in ACS5. However, when being loaded, its peak memory use was 1.8 GB, while with ACS5 it’s only 270 MB!
  • Scripts and expressions in binding links are compiled before they are exported into ACS5. This leads to a 3-fold increase in script loading speed. Expressions are also calculated a few times faster, because they do not need to be parsed before each use anymore!
    _
  • Changes in storage mechanics affected textures as well. If a texture has a solid single-color fill, it is replaced with a simple color. This has a positive effect on storage use and rendering speed.

Since ACS5 implements file-by-file compression, the texture is unpacked only when AIMP accesses the texture for the first time. The skin engine also learned how to track which textures AIMP uses, and which ones it uses no more. The unused textures are archived and offloaded from memory. With this mechanism we significantly decreased the amount of memory that skins with high dpi support use – the engine simply does not unpack textures for unused scales.

When using old skin formats, the skin engine now projects the file into memory instead of loading it into memory directly. According to our data, the skins now load 20% slower, but consume half as much memory.

Note that for you to get all the benefits of the new format, old format skins will be repacked into the new format the first time you use them. Thus, the first time you use an old format skin in AIMP5 will be slower than even in AIMP4.

New Features

Compatibility Settings

The skin information dialog now includes compatibility settings. They allow you to specify the skin engine for which the skin was developed. The information about skin engine differences is available in the new skin editor’s help documentation.

Context Menu

To draw menu items, you can now combine simple colors with textures or use simple colors alone.

ТThe context menu now supports scrollbars:

To replace buttons with a scrollbar, set scrollbar textures in the appropriate properties.

You can keep context menu icons in the resource repository that also stores other textures of that skin. This will allow you to add different icons for the skin’s different themes.

You can also apply automatic icon themes to you icons, so that they match the current font color of the menu item:

The setting is useful for modern single-color icons.

The OnClick event became available for user menu items. The event accepts handler scripts.

Resource Repository

You can use the resource repository to set resources for other UI elements – the tray icon, context menu icons, tooltip colors.

Fonts
You can now use a color resource from the repository as a font color.

Colors
You now have a capability to change the transparency of the inherited color – similar to how it was implemented in AIMP for Android v3.0.

You can now use scripts to open font and color settings dialogs.

TASEPlaylist

Playlist entries can now have a background texture in addition to or instead of a color.

TASERating

We introduced the SkinLayout property that defines a texture’s storyboard:

  • States – a texture contains types of a “star” for different states. The control will draw five of such “stars”, and their state will be determined by the current rating value.
  • StatesAndValues – a texture contains final types for different rating values and rating states. The control will use the texture frames “as is”.

TASETextDisplay

The CopyToClipboard method is available from the scripts. It copies the current displayed value to the clipboard.

TASETextDisplayEx

The CopyToClipboard method is available from the scripts for TASETextDisplayEx as well.

We introduced a new event – OnHyperlinkClick. It allows you to override a default action for hyperlinks.

Marque display mode that appealed so much to our users is now available for the Windows version. Marque mode allows the player to automatically scroll the displayed text back and forth if it does not fit inside the control that displays it.

TASEStateDisplay

This is a new control that is a simplified version of TASEAnimator. It displays frames that are switched manually and are programmed by means of a binding or a script. Frames are not switched by a timer.

TASESeekBar

This new control is a special variant of TASESlider, with the waveform visualization isolated. TASESeekBar also learned to visualize a repeat area in AB-repeat mode, for which we introduced additional color and texture properties:

TASEPageSelector

This page selector is a simple control that came from mobile UI. The control shows how many pages there are and the user’s current location:

The element is bound to a “Tab Control” type access point and the element’s width is calculated automatically depending on the number of available tabs.

TASELayoutDockSite

At the level of the docksite element we introduced a property that allows you to specify which windows it accepts as embedded. Thus, each docksite element can now contain different windows.

Data Providers

prvEqualizer

Auto and Enabled access points were added.

prvQueue

This new provider reports the user playback queue status.

prvPlaybackQueue

A data provider for the playback queue.

prvPlaylistFileInfo

This new data provider allows access to information about a playlist’s selected file.

pmNewPlaylist

A top-level context menu that lists all options for creating a new playlist.

prvScrobbler

A new data provider that allows access to the scrobbler’s state and advanced information about the currently played track. The provider only works when the “Scrobbler” plugin is connected and properly configured.

* * *

You can find a detailed list of changes in the skin editor’s help documentation.