Skip to content
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

Remove the version restriction on mutagen #619

Merged

Conversation

Robbt
Copy link
Member

@Robbt Robbt commented Nov 28, 2018

This fixes #610 and possibly other issues regarding mutagen. In theory it could introduce new bugs but I suspect the version restriction wasn't necessary and was geared towards simply avoiding the need to rewrite tests. We can respond to new issues if we are able to find them but this should fix a number of potential issues based upon the number of bug fixes from 1.31 to 1.41.

@Robbt
Copy link
Member Author

Robbt commented Nov 28, 2018

Looks like we found the "python tests" that were failing that mutagen restriction was aimed at. So now I get to look into the tests and try to figure that out.

@hairmare hairmare changed the title Remove the version restriction on mutagen WIP: Remove the version restriction on mutagen Nov 28, 2018
@Robbt
Copy link
Member Author

Robbt commented Dec 4, 2018

Ok, so I did more investigation for this, basically all that changed was the bitrate that mutagen determines. If you comment out the bitrate assertion it passes. I suspect it is because of this the change in 1.39 and made in this PR. My suggestion is that we change the assertions to the bitrate that mutagen now reports and merge this so that we can use the newest version that has the fixes since we are installing it from pip vs. the one included in the distro. If for some reason we want to support the older version or suspect that this would happen again we could change it to check and see if the bitrate is within a reasonable range vs. an exact number and/or we could just not worry about the tests regarding the bitrate.

@Robbt Robbt changed the title WIP: Remove the version restriction on mutagen Remove the version restriction on mutagen Dec 4, 2018
@Robbt
Copy link
Member Author

Robbt commented Dec 4, 2018

I decided testing it on the range of bitrate made the most sense in terms of dealing with this particular problem that different mutagen versions show different bitrates for mp3s. I also don't think the bitrate test was really testing anything with analyzer itself.

@hairmare
Copy link
Member

hairmare commented Dec 4, 2018

Plot twist: 129757 is a prime number and 64876 seems to be somewhat related to it as it's roughly half of the first number. Are we positive that these don't look right and the issue isn't mutagens? Somehow our existing number kinda "feel right" and I can't quite figure out if it's just a weird kilo/kibi-byte/bit mixup...

Just out of interest, what would the numbers have look if you just fixed the tests for the new mutagen version rather than allowing a range? Maybe they add up to something smart like 128 kbit/s or 64 kbit/s (the latter being rather weird in itself but not impossible). Could it make sense to trust mutagen on this and not assert a range?

@Robbt
Copy link
Member Author

Robbt commented Dec 4, 2018

Yeah, I don't know here is what the new version provides, which are 2 bytes shy of 64000 and 128000 on all of them so they're probably more accurate than the previous one.
Here's the list of what we got.
63998
127998
127998
127998
127998
63998

For ogg there are round numbers.

@Robbt
Copy link
Member Author

Robbt commented Dec 4, 2018

I'm happy to rewrite the test to match the new output but it seems like the bitrate is unrelated to anything actually being tested on the test and so the test will fail if they have the older version of mutagen but with a range it'll work with either version but fail if something gets out of wack completely with the bit rate. Changing it to the new version probably makes sense as every other test passed with mutagen 1.41

@hairmare
Copy link
Member

hairmare commented Dec 4, 2018

The mutagen changelog has lots of notes about improving bitrate accuracy for MP3 files so I'd say it's safe to assume the new values are sane... It could be an interesting challenge to figure out where exactly those two byte are going missing, we really would expect to see 64000 and 128000 tbh.

@frecuencialibre
Copy link
Contributor

merging this one would unblock #639 which would then (i think) let @ned-kelly use the main libretime repo for his multicontainer docker repo. i however am unqualified to merge this. @hairmare ? gracias!

@frecuencialibre
Copy link
Contributor

@paddatrapper do this one and #639 look ok to you?

Copy link
Contributor

@paddatrapper paddatrapper left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Mutagen is usually good at backward compatibility. The bitrate differences definitely look like just better detection. I seem to recall MP3 bitrates are fairly in-exact...

@Robbt
Copy link
Member Author

Robbt commented Dec 17, 2018

So @paddatrapper I just added you as a maintainer, our intention was to ask you if you would like to be on the maintainer team before adding you but I thought that already happened and so I jumped the gun. So if your willing you should be able to merge this now.

@paddatrapper paddatrapper merged commit 9d7aecc into libretime:master Dec 17, 2018
@paddatrapper
Copy link
Contributor

Heh thanks. Merged

@hairmare hairmare added this to the 3.0.0-alpha.6 milestone Dec 17, 2018
@frecuencialibre
Copy link
Contributor

i just did a fresh install from master at a subsequent commit in ubuntu 16, noticed that it looked like mutagen 1.31 was still being installed, ran pip list, and sure enough:

...
mutagen (1.31)
...

can anyone else reproduce this?

@hairmare
Copy link
Member

Ubuntu seems to have a patched 1.31. Are you sure that pip isn't just showing the version of the distro package? I didn't check but I kind of remember pip also knowing about site-packages installed by the distro.

@paddatrapper
Copy link
Contributor

paddatrapper commented Dec 20, 2018

Pip does know about distro-provided python packages (they're installed in similar paths under the python install). This skidoo means pip should be able to update a distro-provided package.

Do we install python-mutagen via apt or mutagen via pip in the installer?

@hairmare
Copy link
Member

Do we install python-mutagen via apt or mutagen via pip in the installer?

It looks like we let setuptools do it's thing and it installs mutagen through pip. In my CentOS packages I install the distro package which leads to setuptools not trying to reinstall/update mutagen.

@Robbt
Copy link
Member Author

Robbt commented Dec 21, 2018

So it is definitely installing it via pip but for some reason it thinks that 1.31 is the best version, perhaps there is a preferred version somewhere set by the distribution. I included a commit to require version 1.41 or better in the airtime-celery non-mp3 fix PR in #639. It is working. I don't know enough about how Python determines what version to use and the documentation is somewhat obtuse but this appears to work so hopefully that can be considered to resolve this.

@lock
Copy link

lock bot commented Dec 22, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please chat to us on discourse or ask for help on our chat if you have any questions or need further assistance with this issue.

@lock lock bot locked as resolved and limited conversation to collaborators Dec 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Crash on import of certain mp3 files
4 participants