beetbox / beetbox/mediafile

In MP3s, TXXX fields are always case insensitive

Open
#62 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
120
Forks
41
PR merge metrics
No merged PRs in 30d

Description

Beets seems to write replaygain tags in upper-case regardless of changelog entry 1.3.2 (https://beets.readthedocs.io/en/stable/changelog.html#december-22-2013)
There are music player in the wild which only understand lower-case ReplayGain tags (Poweramp, KODI),

Using an actual version of a of Beets I can only find upper-case ReplayGain tags in my tagged files with a hex editor.

How I reproduced it:

First of all I download a clean WAV file from bandcamp.com for example. I convert the WAV file to a mp3 via Foobar using the Lame mp3 encoder. After that this mp3 goes into Picard. This goes through processing by Beets. For this I use a Docker Beets version (https://hub.docker.com/r/linuxserver/beets). After that I get a mp3 file including replay gain tags: 03 - New Light.mp3

[03.-.New.Light.zip](https://github.com/beetbox/mediafile/files/9762218/03.-.New.Light.zip)

Using a hex editor I only find upper-case ReplayGain tags in the header of the file.

![192885491-bf485e2e-22b7-48fb-8386-0ed8d8900031](https://user-images.githubusercontent.com/5084469/195269158-c896b994-e0cd-4033-9da4-1fab8849dd28.png)

I tried `beet write` (files have not changed) and `beet write -f` (files have changed) but the mp3 files still only have upper-case ReplayGain tags.

I also tried: I have completely deleted the ReplayGain tags from a series of files with `zero` and checked that they are really gone in the library (`info`) and the mp3 files. After that I re-tagged them with replaygain (`replaygain`). After that I found the ReplayGain tags again, only in upper-case.

I changed the lines of code in mediafile.py (https://github.com/beetbox/mediafile/blob/edc64145e9e96624f8a77fd3cb929891c946d4dc/mediafile.py#L2202-L2209) to see what tags are written. After applying `scrub` and `relaygain` again, I suddenly found two tags in my file, although with different names.
So when both are named differently, all of a sudden both show up. If both have the same name but are capitalized differently, they don't show up.

![194117912-0c47220f-0332-4673-b2b3-2ef49e6a7eb8](https://user-images.githubusercontent.com/5084469/195269682-13331a85-281e-4eb8-b00d-b4ce1ebe611b.png)

![194117932-44bebc12-37e3-46a3-ac4a-eabd21f8424a](https://user-images.githubusercontent.com/5084469/195331950-fc7d1a43-ceb6-49a3-a604-1274b65bccaa.png)

Contributor guide

Open the contributing guide

Research direction

Start in mediafile.py at lines 2202-2209 and reproduce the reported behavior with the attached MP3 or by running the described scrub and replaygain commands. Check how differently cased TXXX names are handled; done means ReplayGain tags can retain the required casing without collapsing distinct names, verified in the resulting MP3.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
audio-video-rtc
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.