-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
R128_*_GAIN tags are rounded or truncated #4169
Comments
Do you think you could provide a little more context about what you're looking at here? It's hard to see exactly what output is the relevant stuff. This might be a good place for answering a "what did you expect to see, and what was the actual behavior?" type of question. |
Sorry, I was so caught up in testing I didn't think to highlight relevant parts of the log. See for example these bits for the first track of the album:
As you can see here, the computed gain for this track is -5.4 LU, but it stores -5 LU into the database. Inspecting the tags with ffprobe, R128_TRACK_GAIN is set to -1280 which is -5 in Q7.8 representation (-5 * 256). The expected value of the tag is -1382 (-5.4 * 256), and the database should either store a float or the actual value of the tag. |
Got it; thank you!! This definitely looks like a problem. It seems like the solution might be to use For anyone interested in tackling this, it would be useful to do some |
As far as I understand from digging around, it seems beets originally stored the raw Q7.8 value as an integer in the database, but it was later changed to store a value similar to replaygain, and conversion was moved to mediafile. |
Looks like it was changed to I've checked whether we can just change it to
I've also confirmed that As far as I can tell |
Problem
Running this command in verbose (
-vv
) mode:$ beet -vv replaygain -a "a matter of life and death"
Led to this problem:
The calculated gain for all of these tracks gets rounded to an integer value when stored as R128. ReplayGain tags are fine (confirmed by looking at the tags with ffprobe, where RG stores -4.45, R128 is -1024, or -4 * 256). Querying those tags with
beet ls "a matter of life and death" -f '$r128_album_gain $r128_track_gain'
also gives an integer value. I believe this is due to the fact that those tags are NullPaddedInt in the database:beets/beets/library.py
Lines 518 to 519 in 3c78537
Setup
My configuration (output of
beet config
) is:The text was updated successfully, but these errors were encountered: