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

ID3 Tags not being written #1271

Closed
4 of 6 tasks
Kolokial opened this issue Jun 18, 2016 · 17 comments
Closed
4 of 6 tasks

ID3 Tags not being written #1271

Kolokial opened this issue Jun 18, 2016 · 17 comments
Assignees
Labels

Comments

@Kolokial
Copy link

Kolokial commented Jun 18, 2016

  • Ampache version:3.8.2
  • Web server + version: Apache/2.4.7 (Ubuntu)
  • Server operating system: Ubuntu 14.04.3 LTS
  • Client operating system: Windows 7 Ultimate
  • Client type:
    • Web
    • SubSonic
    • Plex
    • DAAP
    • UPnP
    • WebDAV

Settings

Please see attached config file

My music path is /serve/music

The permissions are currently set to 777 as I've been trying to figure out what the problem is, but am new to Ampache and haven't been able to find much by googling.

I should add that although I opted for the clients above, I'm currently only using Web. I thought during install that I might need/want them later on.

Description

I set write_id3 to true, and then went to edit a song to update it. However when I do, the changes do not seem to appear. The song still has the same information previously. Yet when I disable write_id3 Ampache appears to allow the tags to be updated, but when I update the catalog, everything reverts to how it was originally.

So, the logs below are basically me going to find a song by Breaking Benjamin called Water. The song is in the correct folder, and I am able to find it by searching "Saturate", the album name.

When write_id3 is set to false I have to click the "Edit" button twice in order for the "Song edit" pane to appear. Once it does, I then proceed to update the track name from "07 Water" to "Water", change the artist from "Unknown (Orphaned)" to "Breaking Benjamin" from the drop down, and change the album from "Unknown (Orphaned)" to "Saturate" and add the track number "7". Then hit save and the pane closes. The track updates with the information I just submitted. However, when I later on update the catalog in the "Show Catalog" section, I find all the information I've given the track has now reverted to what it was originally.

Whereas, when write_id3 is set to true, I only have to click the "Edit" button once in order for the "Song edit" pane to appear, I then repeat the process above and click save, but this time the information does not update nor does it change once I run an update on the catalog.

Logs

2016-06-18 23:11:04 [gary] (session) -> uvvtg438kbtje12s6mapugov04 has been extended to Sun, 19 Jun 2016 00:11:04 +0100 extension length 3600
2016-06-18 23:11:04 [gary] (edit.server.php) -> Called for action: {show_edit_object}
2016-06-18 23:11:05 [gary] (session) -> uvvtg438kbtje12s6mapugov04 has been extended to Sun, 19 Jun 2016 00:11:05 +0100 extension length 3600
2016-06-18 23:11:05 [gary] (ajax.server.php) -> Called for page: {index}
2016-06-18 23:11:30 [gary] (session) -> uvvtg438kbtje12s6mapugov04 has been extended to Sun, 19 Jun 2016 00:11:30 +0100 extension length 3600
2016-06-18 23:11:30 [gary] (edit.server.php) -> Called for action: {edit_object}
2016-06-18 23:11:30 [gary] (song.class.php) -> title=Water
2016-06-18 23:11:30 [gary] (song.class.php) -> artist=2321
2016-06-18 23:11:30 [gary] (song.class.php) -> album=2296
2016-06-18 23:11:30 [gary] (song.class.php) -> track=7
2016-06-18 23:11:30 [gary] (song.class.php) -> mbid=
2016-06-18 23:11:30 [gary] (song.class.php) -> composer=
2016-06-18 23:11:30 [gary] (song.class.php) -> label=
2016-06-18 23:11:30 [gary] (song.class.php) -> year=0
2016-06-18 23:11:30 [gary] (song.class.php) -> edit_tags=
2016-06-18 23:11:30 [gary] (tag.class) -> Updating tags for values {} type {song} object_id {12326}
2016-06-18 23:11:30 [gary] (song.class.php) -> id=12326
2016-06-18 23:11:30 [gary] (song.class.php) -> type=song_row
2016-06-18 23:11:30 [gary] (song) -> Writing id3 metadata to file /serve/music/Breaking Benjamin/Saturate/07 Water.mp3
2016-06-18 23:11:30 [gary] (tag-read) -> Reading tags from /serve/music/Breaking Benjamin/Saturate/07 Water.mp3
2016-06-18 23:11:30 [gary] (media-diff) -> {"album":"OLD:2296 --> 1154","artist":"OLD:2321 --> 1201","title":"OLD: Water --> 07 Water","track":"OLD:7 --> 0","f_title":"OLD:07 Water --> ","f_artist":"OLD:Unknown (Orphaned) --> ","f_album":"OLD:Unknown (Orphaned) --> ","f_artist_full":"OLD:Unknown (Orphaned) --> ","f_album_full":"OLD:Unknown (Orphaned) --> ","f_time":"OLD:3:51 --> ","f_time_h":"OLD:00:03:51 --> ","f_track":"OLD:0 --> ","f_bitrate":"OLD:160-CBR --> ","link":"OLD:http:\/\/192.168.1.152\/ampache\/song.php?action=show_song&song_id=12326 --> ","f_file":"OLD:Unknown (Orphaned) - 07 Water.mp3 --> ","f_title_full":"OLD:07 Water --> ","f_link":"OLD:<a href=\"http:\/\/192.168.1.152\/ampache\/song.php?action=show_song&amp;song_id=12326\" title=\"Unknown (Orphaned) - 07 Water\"> 07 Water<\/a> --> ","f_album_link":"OLD:<a href=\"http:\/\/192.168.1.152\/ampache\/albums.php?action=show&amp;album=1154\" title=\"Unknown (Orphaned)\"> Unknown (Orphaned)<\/a> --> ","f_artist_link":"OLD:<a href=\"http:\/\/192.168.1.152\/ampache\/artists.php?action=show&amp;artist=1201\" title=\"Unknown (Orphaned)\"> Unknown (Orphaned)<\/a> --> ","f_size":"OLD:4.44 MB --> ","f_lyrics":"OLD:<a title=\"07 Water\" href=\"http:\/\/192.168.1.152\/ampache\/song.php?action=show_lyrics&song_id=12326\">Show Lyrics<\/a> --> "}
2016-06-18 23:11:30 [gary] (update) -> /serve/music/Breaking Benjamin/Saturate/07 Water.mp3 : differences found, updating database
2016-06-18 23:11:30 [gary] (session) -> uvvtg438kbtje12s6mapugov04 has been extended to Sun, 19 Jun 2016 00:11:30 +0100 extension length 3600
2016-06-18 23:11:30 [gary] (edit.server.php) -> Called for action: {refresh_updated}
@Phyks
Copy link
Member

Phyks commented Jun 20, 2016

@Kolokial Why did you close it? Was it solved? A mistake?

@Kolokial
Copy link
Author

Unfortunately not. I've opted for a complete re-install to see if my installation was corrupt. If I get the same problem then I shall re-open this with the relevant information.

@Kolokial
Copy link
Author

So, after a re-install I still have the same problem. I imagine it's something to do with my environment, but I can't for the life of me figure it out. Can anyone suggest where or what I can begin to test/tinker with?

@Kolokial Kolokial reopened this Jun 20, 2016
@Phyks
Copy link
Member

Phyks commented Jun 20, 2016

Could you increase logging level to a maximum? You should get an error.

In my case, I have:

2016-06-20 13:12:53 [phyks] (vainfo) -> WriteID3v2() failed with message(s):<pre><ul><li>Only one COMM tag allowed with the same Language + Description (eng + )</li><li>Frame &quot;COMM&quot; is NOT allowed</li><li>$this-&gt;GenerateID3v2FrameData() failed for &quot;COMM&quot;</li><li>$this-&gt;GenerateID3v2Tag() failed</li></ul></pre>

on a song for which it fails.

It also seems to be failing on OGG files.

Concerning the two clicks needed to open the panel, it seems to be always needed, even with write_id3 set to false.

@Kolokial
Copy link
Author

Kolokial commented Jun 20, 2016

debug_level = "5"

So, with write_id3 = "true" and editing the song "Water", I get the following output from the log:

2016-06-20 17:13:49 [gary] (session) -> snj88qn4fitks3bprblkgi7ua2 has been extended to Mon, 20 Jun 2016 18:13:49 +0100 extension length 3600
2016-06-20 17:13:49 [gary] (edit.server.php) -> Called for action: {show_edit_object}
2016-06-20 17:14:18 [gary] (session) -> snj88qn4fitks3bprblkgi7ua2 has been extended to Mon, 20 Jun 2016 18:14:18 +0100 extension length 3600
2016-06-20 17:14:18 [gary] (edit.server.php) -> Called for action: {edit_object}
2016-06-20 17:14:18 [gary] (song.class.php) -> title=Water
2016-06-20 17:14:18 [gary] (song.class.php) -> artist=1136
2016-06-20 17:14:18 [gary] (song.class.php) -> album=1091
2016-06-20 17:14:18 [gary] (song.class.php) -> track=7
2016-06-20 17:14:18 [gary] (song.class.php) -> mbid=
2016-06-20 17:14:18 [gary] (song.class.php) -> composer=
2016-06-20 17:14:18 [gary] (song.class.php) -> label=
2016-06-20 17:14:18 [gary] (song.class.php) -> year=0
2016-06-20 17:14:18 [gary] (song.class.php) -> edit_tags=
2016-06-20 17:14:18 [gary] (tag.class) -> Updating tags for values {} type {song} object_id {5941}
2016-06-20 17:14:18 [gary] (song.class.php) -> id=5941
2016-06-20 17:14:18 [gary] (song.class.php) -> type=song_row
2016-06-20 17:14:18 [gary] (song) -> Writing id3 metadata to file /serve/music/Breaking Benjamin/Saturate/07 Water.mp3
2016-06-20 17:14:18 [gary] (tag-read) -> Reading tags from /serve/music/Breaking Benjamin/Saturate/07 Water.mp3
2016-06-20 17:14:18 [gary] (media-diff) -> {"album":"OLD:1091 --> 4","artist":"OLD:1136 --> 16","title":"OLD: Water --> 07 Water","track":"OLD:7 --> 0","f_title":"OLD:07 Water --> ","f_artist":"OLD:Unknown (Orphaned) --> ","f_album":"OLD:Unknown (Orphaned) --> ","f_artist_full":"OLD:Unknown (Orphaned) --> ","f_album_full":"OLD:Unknown (Orphaned) --> ","f_time":"OLD:3:51 --> ","f_time_h":"OLD:00:03:51 --> ","f_track":"OLD:0 --> ","f_bitrate":"OLD:160-CBR --> ","link":"OLD:https:\/\/192.168.1.152\/ampache\/song.php?action=show_song&song_id=5941 --> ","f_file":"OLD:Unknown (Orphaned) - 07 Water.mp3 --> ","f_title_full":"OLD:07 Water --> ","f_link":"OLD:<a href=\"https:\/\/192.168.1.152\/ampache\/song.php?action=show_song&amp;song_id=5941\" title=\"Unknown (Orphaned) - 07 Water\"> 07 Water<\/a> --> ","f_album_link":"OLD:<a href=\"https:\/\/192.168.1.152\/ampache\/albums.php?action=show&amp;album=4\" title=\"Unknown (Orphaned)\"> Unknown (Orphaned)<\/a> --> ","f_artist_link":"OLD:<a href=\"https:\/\/192.168.1.152\/ampache\/artists.php?action=show&amp;artist=16\" title=\"Unknown (Orphaned)\"> Unknown (Orphaned)<\/a> --> ","f_size":"OLD:4.44 MB --> ","f_lyrics":"OLD:<a title=\"07 Water\" href=\"https:\/\/192.168.1.152\/ampache\/song.php?action=show_lyrics&song_id=5941\">Show Lyrics<\/a> --> "}
2016-06-20 17:14:18 [gary] (update) -> /serve/music/Breaking Benjamin/Saturate/07 Water.mp3 : differences found, updating database
2016-06-20 17:14:18 [gary] (session) -> snj88qn4fitks3bprblkgi7ua2 has been extended to Mon, 20 Jun 2016 18:14:18 +0100 extension length 3600
2016-06-20 17:14:18 [gary] (edit.server.php) -> Called for action: {refresh_updated}

But the song information in front of me does not update at all.

The song title before editing is displayed as "07 Water", and I go to remove the number so it is just "Water". Not sure if I am reading the above incorrectly, but shouldn't this
"title":"OLD: Water --> 07 Water"
be this
"title":"OLD: 07 Water --> Water"

@Phyks
Copy link
Member

Phyks commented Jun 21, 2016

Yes, the order of the info in the title is weird, but expected I think.

Could you confirm the two clicks behavior does not depend on write_id3?

Could you also try another music? (MP3 from a different source ideally)

Could you also send me the MP3 files you are using, so that I could try to reproduce? (my email address is on my profile page).

Thanks

@Kolokial
Copy link
Author

Thanks @Phyks for responding. My apologies, the two clicks on the edit window are irrelevant, it seems that two clicks are required the first time on page load. I never noticed this because I was always navigating to another page, so always experienced two clicks. Once the first two clicks are made to bring up the pane, it is one click to edit anything else on the same page.

I tried the same process again on a different song, 'Voices', by 'Disturbed'.

2016-06-21 20:29:22 [gary] (session) -> l02a25d1tj1uoc999bpn8oqpl5 has been extended to Tue, 21 Jun 2016 21:29:22 +0100 extension length 3600
2016-06-21 20:29:22 [gary] (edit.server.php) -> Called for action: {show_edit_object}
2016-06-21 20:29:50 [gary] (session) -> eb1b4dsrk3d7dtfsuv4bovu1k4 has been extended to Tue, 21 Jun 2016 21:29:50 +0100 extension length 3600
2016-06-21 20:29:50 [gary] (ajax.server.php) -> Called for page: {index}
2016-06-21 20:30:14 [gary] (session) -> l02a25d1tj1uoc999bpn8oqpl5 has been extended to Tue, 21 Jun 2016 21:30:14 +0100 extension length 3600
2016-06-21 20:30:14 [gary] (ajax.server.php) -> Called for page: {index}
2016-06-21 20:30:26 [gary] (session) -> l02a25d1tj1uoc999bpn8oqpl5 has been extended to Tue, 21 Jun 2016 21:30:26 +0100 extension length 3600
2016-06-21 20:30:26 [gary] (edit.server.php) -> Called for action: {edit_object}
2016-06-21 20:30:26 [gary] (song.class.php) -> title=Voices
2016-06-21 20:30:26 [gary] (song.class.php) -> artist=754
2016-06-21 20:30:26 [gary] (song.class.php) -> album=663
2016-06-21 20:30:26 [gary] (song.class.php) -> track=1
2016-06-21 20:30:26 [gary] (song.class.php) -> mbid=
2016-06-21 20:30:26 [gary] (song.class.php) -> composer=
2016-06-21 20:30:26 [gary] (song.class.php) -> label=
2016-06-21 20:30:26 [gary] (song.class.php) -> year=2000
2016-06-21 20:30:26 [gary] (song.class.php) -> edit_tags=
2016-06-21 20:30:26 [gary] (tag.class) -> Updating tags for values {} type {song} object_id {3418}
2016-06-21 20:30:26 [gary] (song.class.php) -> id=3418
2016-06-21 20:30:26 [gary] (song.class.php) -> type=song_row
2016-06-21 20:30:26 [gary] (song) -> Writing id3 metadata to file /serve/music/Disturbed/Unknown Album/01 Voices.mp3
2016-06-21 20:30:26 [gary] (tag-read) -> Reading tags from /serve/music/Disturbed/Unknown Album/01 Voices.mp3
2016-06-21 20:30:26 [gary] (media-diff) -> {"album":"OLD:663 --> 4","artist":"OLD:754 --> 16","title":"OLD: Voices --> 01 Voices","year":"OLD:2000 --> 0","track":"OLD:1 --> 0","f_title":"OLD:01 Voices --> ","f_artist":"OLD:Unknown (Orphaned) --> ","f_album":"OLD:Unknown (Orphaned) --> ","f_artist_full":"OLD:Unknown (Orphaned) --> ","f_album_full":"OLD:Unknown (Orphaned) --> ","f_time":"OLD:3:10 --> ","f_time_h":"OLD:00:03:10 --> ","f_track":"OLD:0 --> ","f_bitrate":"OLD:160-CBR --> ","link":"OLD:http:\/\/192.168.1.152\/ampache\/song.php?action=show_song&song_id=3418 --> ","f_file":"OLD:Unknown (Orphaned) - 01 Voices.mp3 --> ","f_title_full":"OLD:01 Voices --> ","f_link":"OLD:<a href=\"http:\/\/192.168.1.152\/ampache\/song.php?action=show_song&amp;song_id=3418\" title=\"Unknown (Orphaned) - 01 Voices\"> 01 Voices<\/a> --> ","f_album_link":"OLD:<a href=\"http:\/\/192.168.1.152\/ampache\/albums.php?action=show&amp;album=4\" title=\"Unknown (Orphaned)\"> Unknown (Orphaned)<\/a> --> ","f_artist_link":"OLD:<a href=\"http:\/\/192.168.1.152\/ampache\/artists.php?action=show&amp;artist=16\" title=\"Unknown (Orphaned)\"> Unknown (Orphaned)<\/a> --> ","f_size":"OLD:3.64 MB --> ","f_lyrics":"OLD:<a title=\"01 Voices\" href=\"http:\/\/192.168.1.152\/ampache\/song.php?action=show_lyrics&song_id=3418\">Show Lyrics<\/a> --> "}
2016-06-21 20:30:26 [gary] (update) -> /serve/music/Disturbed/Unknown Album/01 Voices.mp3 : differences found, updating database
2016-06-21 20:30:26 [gary] (session) -> l02a25d1tj1uoc999bpn8oqpl5 has been extended to Tue, 21 Jun 2016 21:30:26 +0100 extension length 3600
2016-06-21 20:30:26 [gary] (edit.server.php) -> Called for action: {refresh_updated}

I have also just emailed you both mp3s from kolokial@icloud.com.

@Phyks
Copy link
Member

Phyks commented Jun 22, 2016

Thanks. The issue seems to be with this condition which is not satisfied. I also saw the same issue with some OGG files.

I created a separate issue for the double click issue.

@Phyks
Copy link
Member

Phyks commented Jun 22, 2016

The parsed structure from getID3 looks like:

{  
   "GETID3_VERSION":"1.9.11-201602240818",
   "filesize":3819693,
   "filepath":"\/tmp",
   "filename":"01 Voices.mp3",
   "filenamepath":"\/tmp\/01 Voices.mp3",
   "avdataoffset":2158,
   "avdataend":3819693,
   "fileformat":"mp3",
   "audio":{  
      "dataformat":"mp3",
      "channels":2,
      "sample_rate":44100,
      "bitrate":160000,
      "channelmode":"joint stereo",
      "bitrate_mode":"cbr",
      "lossless":false,
      "encoder_options":"CBR160",
      "compression_ratio":0.11337868480726,
      "streams":[  
         {  
            "dataformat":"mp3",
            "channels":2,
            "sample_rate":44100,
            "bitrate":160000,
            "channelmode":"joint stereo",
            "bitrate_mode":"cbr",
            "lossless":false,
            "encoder_options":"CBR160",
            "compression_ratio":0.11337868480726
         }
      ]
   },
   "error":[  
      "Next ID3v2 frame is also invalid, aborting processing."
   ],
   "warning":[  
      "error parsing \"TT2\u0000\" (10 bytes into the ID3v2.3 tag). (ERROR: !IsValidID3v2FrameName(\"TT2 \", 3)))."
   ],
   "encoding":"UTF-8",
   "id3v2":{  
      "header":true,
      "flags":{  
         "unsynch":false,
         "exthead":false,
         "experim":false
      },
      "majorversion":3,
      "minorversion":0,
      "headerlength":2158,
      "tag_offset_start":0,
      "tag_offset_end":2158,
      "encoding":"UTF-8"
   },
   "mime_type":"audio\/mpeg",
   "mpeg":{  
      "audio":{  
         "raw":{  
            "synch":4094,
            "version":3,
            "layer":1,
            "protection":1,
            "bitrate":10,
            "sample_rate":0,
            "padding":0,
            "private":0,
            "channelmode":1,
            "modeextension":0,
            "copyright":0,
            "original":0,
            "emphasis":0
         },
         "version":"1",
         "layer":3,
         "channelmode":"joint stereo",
         "channels":2,
         "sample_rate":44100,
         "protection":false,
         "private":false,
         "modeextension":"",
         "copyright":false,
         "original":false,
         "emphasis":"none",
         "padding":false,
         "bitrate":160000,
         "framelength":522,
         "bitrate_mode":"cbr"
      }
   },
   "playtime_seconds":190.87675,
   "bitrate":160000,
   "playtime_string":"3:11"
}

Notice the error key.

I see two issues here:

  • First, Ampache does not check for this error and only catch exception, which makes this error silent.
  • Second, this MP3 file seems to have invalid ID3v2 tags, but I have no idea why this is happening.

I do not know enough about ID3v3 tags. Maybe @Afterster or @Niols would have ideas.

@Kolokial
Copy link
Author

Kolokial commented Jun 22, 2016

I have news...

I wondered if it was my environment or the MP3, it may be something to do with the MP3 specifically. I decided to edit a track that already had the correct name, track number, album and artist. I chose 'Here We Are' by 'Breaking Benjamin' and updated the title to 'Here We Are1' and ran an update. This time the title change stuck.

2016-06-22 20:03:53 [gary] (session) -> coqo1d8e8d5h5c2e6i2b3q85n2 has been extended to Wed, 22 Jun 2016 21:03:53 +0100 extension length 3600
2016-06-22 20:03:53 [gary] (edit.server.php) -> Called for action: {edit_object}
2016-06-22 20:03:53 [gary] (song.class.php) -> title=Here We Are1
2016-06-22 20:03:53 [gary] (song.class.php) -> artist=1136
2016-06-22 20:03:53 [gary] (song.class.php) -> album=1092
2016-06-22 20:03:53 [gary] (song.class.php) -> track=9
2016-06-22 20:03:53 [gary] (song.class.php) -> mbid=
2016-06-22 20:03:53 [gary] (song.class.php) -> composer=
2016-06-22 20:03:53 [gary] (song.class.php) -> label=Hollywood
2016-06-22 20:03:53 [gary] (song.class.php) -> year=2006
2016-06-22 20:03:53 [gary] (song.class.php) -> edit_tags=Rock
2016-06-22 20:03:53 [gary] (tag.class) -> Updating tags for values {Rock} type {song} object_id {5951}
2016-06-22 20:03:53 [gary] (tag.class) -> Processing tag {Rock}...
2016-06-22 20:03:53 [gary] (tag.class) -> Already found. Do nothing.
2016-06-22 20:03:53 [gary] (song.class.php) -> id=5951
2016-06-22 20:03:53 [gary] (song.class.php) -> type=song_row
2016-06-22 20:03:53 [gary] (song) -> Writing id3 metadata to file /serve/music/Breaking Benjamin/Phobia/09 Here We Are.mp3
2016-06-22 20:03:53 [gary] (tag-read) -> Reading tags from /serve/music/Breaking Benjamin/Phobia/09 Here We Are.mp3
2016-06-22 20:03:53 [gary] (vainfo) -> Cleaning id3v1
2016-06-22 20:03:53 [gary] (vainfo) -> Cleaning id3v2
2016-06-22 20:03:53 [gary] (media-diff) -> {"tags":"OLD: Rock Array --> Rock","f_title":"OLD:Here We Are --> ","f_artist":"OLD:Breaking Benjamin --> ","f_album":"OLD:Phobia --> ","f_artist_full":"OLD:Breaking Benjamin --> ","f_albumartist_full":"OLD:Breaking Benjamin --> ","f_album_full":"OLD:Phobia --> ","f_time":"OLD:4:17 --> ","f_time_h":"OLD:00:04:17 --> ","f_track":"OLD:9 --> ","f_bitrate":"OLD:257-VBR --> ","link":"OLD:https:\/\/192.168.1.152\/ampache\/song.php?action=show_song&song_id=5951 --> ","f_file":"OLD:Breaking Benjamin - 9 - Here We Are.mp3 --> ","f_title_full":"OLD:Here We Are --> ","f_link":"OLD:<a href=\"https:\/\/192.168.1.152\/ampache\/song.php?action=show_song&amp;song_id=5951\" title=\"Breaking Benjamin - Here We Are\"> Here We Are<\/a> --> ","f_album_link":"OLD:<a href=\"https:\/\/192.168.1.152\/ampache\/albums.php?action=show&amp;album=1092\" title=\"Phobia\"> Phobia<\/a> --> ","f_artist_link":"OLD:<a href=\"https:\/\/192.168.1.152\/ampache\/artists.php?action=show&amp;artist=1136\" title=\"Breaking Benjamin\"> Breaking Benjamin<\/a> --> ","f_albumartist_link":"OLD:<a href=\"https:\/\/192.168.1.152\/ampache\/artists.php?action=show&amp;artist=1136\" title=\"Breaking Benjamin\"> Breaking Benjamin<\/a> --> ","f_tags":"OLD:<a href=\"https:\/\/192.168.1.152\/ampache\/browse.php?action=tag&show_tag=3&type=song\" title=\"Rock\">Rock<\/a> --> ","f_size":"OLD:7.94 MB --> ","f_lyrics":"OLD:<a title=\"Here We Are\" href=\"https:\/\/192.168.1.152\/ampache\/song.php?action=show_lyrics&song_id=5951\">Show Lyrics<\/a> --> ","f_publisher":"OLD:Hollywood --> "}
2016-06-22 20:03:53 [gary] (update) -> /serve/music/Breaking Benjamin/Phobia/09 Here We Are.mp3 : differences found, updating database
2016-06-22 20:03:53 [gary] (tag.class) -> Updating tags for values {Rock} type {song} object_id {5951}
2016-06-22 20:03:53 [gary] (tag.class) -> Processing tag {Rock}...
2016-06-22 20:03:53 [gary] (tag.class) -> Already found. Do nothing.
2016-06-22 20:03:53 [gary] (tag.class) -> Updating tags for values {Rock} type {album} object_id {1092}
2016-06-22 20:03:53 [gary] (tag.class) -> Processing tag {Rock}...
2016-06-22 20:03:53 [gary] (tag.class) -> Already found. Do nothing.
2016-06-22 20:03:53 [gary] (tag.class) -> Updating tags for values {Rock,Other,Metal,Blues,genre} type {artist} object_id {1136}
2016-06-22 20:03:53 [gary] (tag.class) -> Processing tag {Rock}...
2016-06-22 20:03:53 [gary] (tag.class) -> Already found. Do nothing.
2016-06-22 20:03:53 [gary] (tag.class) -> Processing tag {Other}...
2016-06-22 20:03:53 [gary] (tag.class) -> Already found. Do nothing.
2016-06-22 20:03:53 [gary] (tag.class) -> Processing tag {Metal}...
2016-06-22 20:03:53 [gary] (tag.class) -> Already found. Do nothing.
2016-06-22 20:03:53 [gary] (tag.class) -> Processing tag {Blues}...
2016-06-22 20:03:53 [gary] (tag.class) -> Already found. Do nothing.
2016-06-22 20:03:53 [gary] (tag.class) -> Processing tag {genre}...
2016-06-22 20:03:53 [gary] (tag.class) -> Already found. Do nothing.
2016-06-22 20:03:53 [gary] (session) -> coqo1d8e8d5h5c2e6i2b3q85n2 has been extended to Wed, 22 Jun 2016 21:03:53 +0100 extension length 3600
2016-06-22 20:03:53 [gary] (edit.server.php) -> Called for action: {refresh_updated}

Not sure how I would parse the mp3 to get the ID3 tag structure as above.

@Phyks
Copy link
Member

Phyks commented Jun 22, 2016

Some things:

  • Yes, this error is specific to this file, your environment is not in fault. But this error is due to a third-party library used in Ampache, to fetch ID3 tags.
  • I kind of "magically" fixed your MP3 file by saving metadata again in it using VLC. Then, I get the following error:
2016-06-22 23:24:08 [phyks] (vainfo) -> Failed to write tags! ID3v2: Skipping "RECORDING_TIME" because cannot match it to a known ID3v2 frame type 
2016-06-22 23:24:08 [phyks] (vainfo) -> ID3v2: Skipping "FILE" because cannot match it to a known ID3v2 frame type 
2016-06-22 23:24:08 [phyks] (vainfo) -> ID3v2: Skipping "BITRATE" because cannot match it to a known ID3v2 frame type 
2016-06-22 23:24:08 [phyks] (vainfo) -> ID3v2: Skipping "RATE" because cannot match it to a known ID3v2 frame type 
2016-06-22 23:24:08 [phyks] (vainfo) -> ID3v2: Skipping "MODE" because cannot match it to a known ID3v2 frame type 
2016-06-22 23:24:08 [phyks] (vainfo) -> ID3v2: Skipping "MIME" because cannot match it to a known ID3v2 frame type 
2016-06-22 23:24:08 [phyks] (vainfo) -> ID3v2: Skipping "ALBUMARTIST" because cannot match it to a known ID3v2 frame type 
2016-06-22 23:24:08 [phyks] (vainfo) -> ID3v2: Skipping "MB_TRACKID" because cannot match it to a known ID3v2 frame type 
2016-06-22 23:24:08 [phyks] (vainfo) -> ID3v2: Skipping "MB_ALBUMID" because cannot match it to a known ID3v2 frame type 
2016-06-22 23:24:08 [phyks] (vainfo) -> ID3v2: Skipping "MB_ARTISTID" because cannot match it to a known ID3v2 frame type 
2016-06-22 23:24:08 [phyks] (vainfo) -> ID3v2: Skipping "MB_ALBUMARTISTID" because cannot match it to a known ID3v2 frame type 
2016-06-22 23:24:08 [phyks] (vainfo) -> ID3v2: Skipping "TRACK" because cannot match it to a known ID3v2 frame type 
2016-06-22 23:24:08 [phyks] (vainfo) -> ID3v2: Skipping "REPLAYGAIN_TRACK_GAIN" because cannot match it to a known ID3v2 frame type 
2016-06-22 23:24:08 [phyks] (vainfo) -> ID3v2: Skipping "REPLAYGAIN_TRACK_PEAK" because cannot match it to a known ID3v2 frame type 
2016-06-22 23:24:08 [phyks] (vainfo) -> ID3v2: Skipping "REPLAYGAIN_ALBUM_GAIN" because cannot match it to a known ID3v2 frame type 
2016-06-22 23:24:08 [phyks] (vainfo) -> ID3v2: Skipping "REPLAYGAIN_ALBUM_PEAK" because cannot match it to a known ID3v2 frame type 
2016-06-22 23:24:08 [phyks] (vainfo) -> WriteID3v2() failed with message(s):<pre><ul><li>Only one COMM tag allowed with the same Language + Description (eng + )</li><li>Frame &quot;COMM&quot; is NOT allowed</li><li>$this-&gt;GenerateID3v2FrameData() failed for &quot;COMM&quot;</li><li>$this-&gt;GenerateID3v2Tag() failed</li></ul></pre> 

Which at least I have some clues to debug.

  • To get the structure in one of my previous messages, you should dump $this->_raw array just before the if condition here. Something like
debug_event("vainfo", json_encode($this->_raw), 5)

would do the trick.

  • I had a look at getID3 and found in the README
  • iTunes (versions "X v2.0.3", "v3.0.1" are known-guilty, probably other versions are too) writes ID3v2.3 comment tags using a frame name 'COM ' which is not valid for ID3v2.3+ (it's an ID3v2.2-style frame name) (detected by getID3())
  • iTunes has been known to append a new ID3v1 tag on the end of an existing ID3v1 tag when ID3v2 tag is also present (detected by getID3())

I saw your file was encoded by iTunes (it is written in one of the id3 tags field), so I guess the error is coming from this. In particular, the first point looks a lot like the "invalid frame" we are getting and the error above. Still, this should be handled by getID3 and I am not sure why he did not do it.

I will try to investigate further on this in the upcoming days.

P.S.: @Afterster do you have an idea about why the condition is present in this file? I do not get the point of checking the presence of id3v2. I may have missed something, but if a file does not have any tags, we could still write some, no?

@Phyks
Copy link
Member

Phyks commented Jun 22, 2016

Actually, I think I got most of the error.

See this commit in getID3 which seems to be fixing the exact issue we are encountering here.

@Kolokial if you have some time, I think you can try to run a composer update getID3 to update to the latest commit which should solve the issue. Let me know about it.

Else, I will have a deeper look at it tomorrow and see if it solves everything :)

EDIT: Correct command is composer update james-heinrich/getid3.

@Phyks
Copy link
Member

Phyks commented Jun 23, 2016

I updated to latest getid3 version, and it does actually fix part of the issue.

Quick summary on this issue:

  1. We do not check for the error field in the returned structure, which we should do I think.
  2. This line breaks edit on my OGG file. Not sure why though.
  3. Some errors appear with MP3 files encoded with iTunes (the actual issue from @Kolokial), fixed in this commit. Then, there remain errors preventing tags edit:
2016-06-23 10:41:18 [phyks] (vainfo) -> Failed to write tags! ID3v2: Skipping "RECORDING_TIME" because cannot match it to a known ID3v2 frame type 
2016-06-23 10:41:18 [phyks] (vainfo) -> ID3v2: Skipping "FILE" because cannot match it to a known ID3v2 frame type 
2016-06-23 10:41:18 [phyks] (vainfo) -> ID3v2: Skipping "BITRATE" because cannot match it to a known ID3v2 frame type 
2016-06-23 10:41:18 [phyks] (vainfo) -> ID3v2: Skipping "RATE" because cannot match it to a known ID3v2 frame type 
2016-06-23 10:41:18 [phyks] (vainfo) -> ID3v2: Skipping "MODE" because cannot match it to a known ID3v2 frame type 
2016-06-23 10:41:18 [phyks] (vainfo) -> ID3v2: Skipping "MIME" because cannot match it to a known ID3v2 frame type 
2016-06-23 10:41:18 [phyks] (vainfo) -> ID3v2: Skipping "ALBUMARTIST" because cannot match it to a known ID3v2 frame type 
2016-06-23 10:41:18 [phyks] (vainfo) -> ID3v2: Skipping "MB_TRACKID" because cannot match it to a known ID3v2 frame type 
2016-06-23 10:41:18 [phyks] (vainfo) -> ID3v2: Skipping "MB_ALBUMID" because cannot match it to a known ID3v2 frame type 
2016-06-23 10:41:18 [phyks] (vainfo) -> ID3v2: Skipping "MB_ARTISTID" because cannot match it to a known ID3v2 frame type 
2016-06-23 10:41:18 [phyks] (vainfo) -> ID3v2: Skipping "MB_ALBUMARTISTID" because cannot match it to a known ID3v2 frame type 
2016-06-23 10:41:18 [phyks] (vainfo) -> ID3v2: Skipping "TRACK" because cannot match it to a known ID3v2 frame type 
2016-06-23 10:41:18 [phyks] (vainfo) -> ID3v2: Skipping "REPLAYGAIN_TRACK_GAIN" because cannot match it to a known ID3v2 frame type 
2016-06-23 10:41:18 [phyks] (vainfo) -> ID3v2: Skipping "REPLAYGAIN_TRACK_PEAK" because cannot match it to a known ID3v2 frame type 
2016-06-23 10:41:18 [phyks] (vainfo) -> ID3v2: Skipping "REPLAYGAIN_ALBUM_GAIN" because cannot match it to a known ID3v2 frame type 
2016-06-23 10:41:18 [phyks] (vainfo) -> ID3v2: Skipping "REPLAYGAIN_ALBUM_PEAK" because cannot match it to a known ID3v2 frame type 
2016-06-23 10:41:18 [phyks] (vainfo) -> WriteID3v2() failed with message(s):<pre><ul><li>Only one COMM tag allowed with the same Language + Description (eng + )</li><li>Frame &quot;COMM&quot; is NOT allowed</li><li>$this-&gt;GenerateID3v2FrameData() failed for &quot;COMM&quot;</li><li>$this-&gt;GenerateID3v2Tag() failed</li></ul></pre> 

I will try to fix them.

Phyks added a commit to Phyks/ampache that referenced this issue Jun 23, 2016
@Phyks Phyks self-assigned this Jun 23, 2016
@Phyks
Copy link
Member

Phyks commented Jun 23, 2016

After having looked into it, the specific issue about @Kolokial file is that it has deeply invalid idv3 tags structure. I opened an issue on getID3 to see how we can deal with it. I think Ampache should clean up files whenever imported into the catalog, or something like this.

For those interested, I set up a branch to work on a PR on this on my fork: https://github.com/Phyks/ampache/tree/issue_1271. It does not do much at the moment, just giving more logging for errors and fixing the first issue encountered because of iTunes invalid frame.

@Kolokial
Copy link
Author

@Phyks thanks for looking at this issue. I've run an update on composer and pulled the most recent version of Ampache (3.8.3-develop) however the issue persists, I can only assume this is a problem with my MP3s. Is there perhaps something I can run on the MP3s to reset them entirely?

@Phyks
Copy link
Member

Phyks commented Jun 27, 2016

I did not expect the composer update to solve the whole problem, just part of it (the tip of the iceberg).

To solve the whole issue, one would have to tackle this issue. I am waiting for an update from the maintainer and may try to handle it, at least for the precise issue which arises here.

In the meantime, if I remember well, I managed to get your files working by resaving the id3 tags with VLC. I do not know much about id3 tags edition software, I guess you may be able to force rewrite them with either vlc, ffmpeg or any such software.

Quick search on Google (for Linux) gave me http://www.linux.org/threads/tool-for-repairing-mp3-id3-tags.3274/, https://unix.stackexchange.com/questions/39185/command-line-tool-to-remove-selected-tags-from-mp3-files and https://superuser.com/questions/327410/is-there-a-tool-that-can-detect-and-if-possible-fix-glitches-in-mp3-files that you may find interesting.

@Phyks Phyks added the bug label Jun 27, 2016
@lachlan-00 lachlan-00 added the stale Issues not updated in over a year label Feb 16, 2021
@mitchray
Copy link
Member

Closing due to inactivity (and age), reopen if this is still relevant in latest version

@mitchray mitchray removed the stale Issues not updated in over a year label Jan 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants