How many lossless tracks are there in Yandex Music, really?

I love poking around in code, writing code, flashing everything I can, building infrastructure on Linux, assembling robots, data science, neural networks, LLMs, and a lot more of that, you get the idea.

Besides all this, I really love good sound.
I can’t really call myself an audiophile, because I’ve never warmed up wires and never installed an amplifier on pyramids.
But I still love good sound:

  • I listen to lossless music at home on floor-standing speakers and through a good amplifier (the neighbors sometimes come over)

  • I listen to good old vinyl at home through the same amplifier and speakers (if only you knew how Yuri Antonov sounds on vinyl)

  • I carry an android phone with a USB DAC as a second one, so I can listen to what I downloaded through it, like in the good old days (it’s really inconvenient)

And when yesterday Yandex, rather quietly, rolled out lossless music, I got really interested.

Of course, I immediately updated the apps, set the best music quality, and listened – it sounded great!
No, really. I tried Tidal through headphones, and Yandex.Music was inferior to it in terms of sound quality.
Now I can hear MUCH more detail, and this is even through an iPhone via Bluetooth, with its AAC codec, which is throttled to a bitrate of 320 kilobits (and in reality my headphones can only do 256).
With an Android phone, the difference between what was and what has become has gone into space – thanks to the LDAC codec from Sony, which can handle 990 kilobits and is positioned as a codec without compression, but in reality “almost without compression, but with compression.”

In short, it got a lot better, I was glad that I no longer had to carry a huge DAC with me and store 100+ Gb of all sorts of discographies on a flash drive, but could listen directly from streaming and over the air – it's really convenient, because Yandex's recommendations are simply the best, and variety matters.

But one question kept bothering me – what is the real quality of the tracks, and how many of them there are.

In their announcement, the guys wrote that they added “flac, and other high-quality formats” – these “and others” are what I wanted to count.

The Yandex.Music application itself does not write the bitrate, sampling frequency, codec, or even just “quality”.

Well, since he doesn't write, we'll try to find out ourselves…

First, you need to set the maximum quality in the Yandex.Music app and download the entire playlist with likes – for me it's a little over 1.5k tracks.

Next, to know the quality, we must remember that each application stores some of its data locally.
And if the phone has superuser rights, this data can be viewed.

Fortunately, on my custom Android phone firmware, superuser rights were already built into the kernel, and all that was left was to install a manager to manage these rights.

No sooner said than done, I've had a drink KernelSUchecked in Termux that everything works.

Next, we need to dig into the data stored by Yandex.Music and find some kind of database there that contains a table with the tracks I downloaded and information about them.

You can poke around with your hands, but it's not very convenient – let's take an app MyAndroidTools. Although it hasn't been updated for 5 years, it still works great.
Why it was originally created is a separate story, but we are interested in the part that allows viewing application databases, and we will use it.

Open MyAndroidTools, find Yandex Music (the one that is an Android application, not a site displayed via webview), go into it, and look at the databases.

We giggle from the chunk_norris base, let's move on)))

To be honest, I just poked around and found what I needed – information about my tracks lives in the UserDb_999999999, in the tracks_cache table (I replaced the user ID, you will have your own).

Next, we need to drag this base to the desktop to play with it there.
We go into Termux directly on the phone, log in as a superuser via sudo su, and copy the database from the Yandex.Music application folder to the user space, for example, to the internal storage:
cp /data/data/ru.yandex.music/databases/userDb_999999999 /storage/XXY9-A77B/
(The drive ID is also random, see yours yourself).

Then, we copy this file to the computer. You can just use a wire, but I did it via adb over wifi:
adb pull /storage/XXY9-A77B/userDb_999999999 /Users/windoozatnick/Desktop/

Now it's time to open this database and start writing SQL queries to it.

Install DBeaver if you don't have it yet, create a new connection, select SQLite, select the required file – everything is ready, you are great.

We see the database, we see the tables, we try to execute SELECT * FROM tracks_cache – it works.

Well, it's time to write requests.

We are interested in the following columns:

  • realQuality is a column in which Yandex writes how they define quality for themselves, as I understand it

  • codec – the codec in which the track is encoded

  • bitrate – track bitrate

But there is a funny thing with the bitrate column – for flac tracks there is a zero bitrate. Why it is done this way, I don't know, but let's fix it and decide this way – if the bitrate is 0, then we will consider it to be 1000 (the average bitrate for flac files).

We check with the first request that only flac files have 0 bitrate – yes, that's true.

Next, we take a first look from above and see how many tracks there are in each of the realQuality

If you convert realQuality into percentages, it will look like this:
Lossless – 62%
High – 35%
Normal – 3%

Okay, we understand the breakdown by Yandex labels, now let's see what's by codecs

According to codecs it is like this:
aac – 71%
flac – 27%
mp3 – 2%

Well, now the most interesting part – let's look at the bitrates

The breakdown in bitrates is as follows:
256 – 68%
1000 – 27%
320 – 2%
128 – 1.6%
192 – 1.4%

We see that more than half of the tracks have a bitrate of 256 – it seems like it doesn't sound very good.
Let's check the codec + bitrate combinations, and then I'll tell you why

We see the following:
aac + 256 – 68%
flac + 1000 – 27%
mp3 + 320 – 2%
aac + 128 – 1.6%
aac + 192 – 1.4%

We see that most of the tracks are posted in AAC + 256, and this is good, let me tell you why.

AAC is positioned as a “psychoacoustic codec”, that is, like any lossy codec, it discards part of the musical stream, but discards precisely what is either not captured by the human ear, or is poorly captured.

In short, AAC will throw out what was already difficult to hear.

Some codec comparisons claim that AAC at 256 bitrate sounds no worse than, for example, flac via aptxHD at 512 bitrate (how cleverly I compared a file codec with a Bluetooth codec, huh!).

But let the “real audiophiles” come here and write why all codecs are bad, and why you need to listen through a heated wire through a tube amplifier.

Next, let's look at another combination of realQuality and bitrate

And a combination of all three columns

I'm too lazy to convert it into percentages, sorry))
If you want to translate it yourself, then 100% it's 1631

Conclusion

Yandex are great guys.
Just by ear, it sounds MUCH better, especially through LDAC.
The numbers tell us that the bitrates are not the highest, but the codec was chosen well, and everything sounds good.
I officially declare that I will put the USB DAC in the nightstand and will listen to Yandex Music in quality.

If you want me to do this with other streaming services, write to me.
I think it’s possible to do the same with SberZvuk, they also claim to have hi-fi.
In theory, you can do it with Tidal, but it’s less interesting with them – they already have written what bitrate/codec each track has (and they don’t have my music, but Yandex does).

Guys from Yandex Music – love you, thank you!
I hope you're not too offended that I poked around in my local data))

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *