Bug 369672 - [Amarok] Editing genre-tag leads to corrupt ogg/vorbis header on some files.
Summary: [Amarok] Editing genre-tag leads to corrupt ogg/vorbis header on some files.
Status: RESOLVED WORKSFORME
Alias: None
Product: amarok
Classification: Applications
Component: Metadata Editing and Reading (show other bugs)
Version: 2.8.90 (2.9 beta)
Platform: Arch Linux Linux
: NOR critical
Target Milestone: 2.9
Assignee: Amarok Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-10-03 11:53 UTC by qqqqqqqqq9
Modified: 2022-11-26 05:16 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
ogginfo-output of corrupted file (1.21 MB, text/plain)
2016-10-03 11:54 UTC, qqqqqqqqq9
Details

Note You need to log in before you can comment on or make changes to this bug.
Description qqqqqqqqq9 2016-10-03 11:53:02 UTC
Hi, 

after changing the genre-tag of some ogg-files amarok is not able to play them anymore because of a corrupt ogg-header (see attached ogginfo-output).

I am sure, the corruption is caused by amarok, because i explicitely confirmed with ogginfo, that the now corrupt files were ok before changing the tag with amarok. 




Reproducible: Sometimes

Steps to Reproduce:
1. Check your ogg-files with ogginfo.
2. Change the genre-tag with amarok.
3. Check your ogg-files again with ogginfo.

Actual Results:  
Some ogg-files are corrupt.

Expected Results:  
All ogg-files should be fine.
Comment 1 qqqqqqqqq9 2016-10-03 11:54:15 UTC
Created attachment 101389 [details]
ogginfo-output of corrupted file
Comment 2 Guilherme Furst 2016-10-03 18:23:15 UTC
Aleluiah brother, I' had this issue last week and went crazy seeing random ogg files getting corrupted all around my collection.
I have the same issue, audio files getting completely unplayable by any means, nothing can play the resulting files...
Also already tried a number of different utilities, like oggfix (from ubuntu launchpad), oggsplt (to split files, resets something), oggvorbisfix... and so on.

Still not really sure how the corruption happens, but changing the album tags seems like a good option, most of the ones that got corrupted for me happened change album and tagged as 'various artists'.

Anyway any luck getting those files fixed?
Comment 3 Myriam Schweingruber 2016-10-04 07:09:37 UTC
hm, I can't reproduce this here on a rather old KDE4 installation, so this might well be related to other changes in the system. Tested with Amarok git master on KDE 4.14.2, Kubuntu 14.10, changed genre and album artist tags on ogg files. All the files are still playable and no corruption visible. I somewhat doubt this is related to Amarok, more likely another library you use.
Comment 4 Dainius Masiliūnas 2016-10-04 07:25:19 UTC
I can confirm this too, using Amarok frameworks git on openSUSE. FYI, this happens without editing tags manually too (in fact mine can't edit tags to begin with). And the result is that the header gets overwritten by some number of 64-bit 0x1 values (it varies how many).

I'm not certain if this is actually exclusive to OGG files, too. MP3s are simply more resilient to such corruption, since their header holds ID3 tags instead. So check if you have some MP3s that have lost their tags too.

Also, one useful way to find corrupt files is to use:
  find . -iname "*.ogg" -exec file {} \; | grep "Data"
since `file` will return "stuff.ogg: Data" if it's corrupt, or "stuff.ogg: Ogg data, Vorbis audio, ..." if it's not.

It's true that it's odd how this could be related to Amarok. I'm not sure when exactly the corruption happens: on playback or on scanning the filesystem, or some other factors. Also, setting the music files to read-only prevents this problem.
Comment 5 Guilherme Furst 2016-10-04 16:24:09 UTC
(In reply to Myriam Schweingruber from comment #3)
> hm, I can't reproduce this here on a rather old KDE4 installation, so this might well be related to other changes in the system.
> Tested with Amarok git master on KDE 4.14.2, Kubuntu 14.10, changed genre and album artist tags on ogg files.

I'm on Arch with Amarok version 2.8.0-9, quite an old build actually, so yeah it might be related with other backends responsible to handling the files.
Another thing to note, my files were visibly more affected when changing tag from normal to "various artists" section, the shortcut action from the library itself.

And also another hint: it seems the tags themselves are unaffected, using vorbiscomment you can see and change them without issues, the oggz tools also validates the ogg header and formats without issues, so the corruption really happens at the vorbis track level.
Comment 6 Guilherme Furst 2016-10-06 19:56:54 UTC
(In reply to Dainius Masiliūnas from comment #4)
> Also, one useful way to find corrupt files is to use:
>   find . -iname "*.ogg" -exec file {} \; | grep "Data"
> since `file` will return "stuff.ogg: Data" if it's corrupt, or "stuff.ogg:
> Ogg data, Vorbis audio, ..." if it's not.
tried the find command I wasn't able to find anything, can you confirm it?
Comment 7 Dainius Masiliūnas 2016-10-06 20:58:00 UTC
Yea, looking deeper into it, the corruption issue I was seeing (64-bit 0x1s written to the top of the header) is completely different from Guilherme's ("vorbis" packet headers missing at the start of the audio track, OggS packets in weird places). That's also why `file` gives different results for us. Probably an entirely different cause for the two as well.
Comment 8 Pascal VITOUX 2016-11-14 22:26:26 UTC
(In reply to Guilherme Furst from comment #2)
> Aleluiah brother, I' had this issue last week and went crazy seeing random
> ogg files getting corrupted all around my collection.
> ...
> Still not really sure how the corruption happens, but changing the album
> tags seems like a good option, most of the ones that got corrupted for me
> happened change album and tagged as 'various artists'.
> ...

I can confirm the corruption with Amarok 2.8.0-9 on Archlinux. Some of my ogg files are getting corrupted after being played with Amarok. 

I use the "Write statistics to file" option , so I guess the corruption happens when the playcount tag is updated.
Comment 9 Pascal VITOUX 2016-11-21 23:13:54 UTC
I found a bug in taglib 1.11.1 ( https://github.com/taglib/taglib/issues/775 ) which is used by Amarok and the gstreamer and vlc backends.

So If you can reproduce the bug inside Amarok (if you still have the non corrupted version of your ogg files) you can try with a patched version of taglib (the patch is my comment on github)
Comment 10 Justin Zobel 2022-10-27 02:48:36 UTC
Thank you for reporting this bug in KDE software. As it has been a while since this issue was reported, can we please ask you to see if you can reproduce the issue with a recent software version?

If you can reproduce the issue, please change the status to "REPORTED" when replying. Thank you!
Comment 11 Bug Janitor Service 2022-11-11 05:18:23 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 12 Bug Janitor Service 2022-11-26 05:16:04 UTC
This bug has been in NEEDSINFO status with no change for at least
30 days. The bug is now closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!