Closed spt5007 closed 8 years ago
Hi @spt5007, thanks for your feedback. I must admit that I'd missed this, though I've thought occasionally that the tracks seem to be in a different order than I expected.
My track files have the track number at the start of the filename, and have usually been copied in bulk, so the order of the files on the USB drive are probably in track order in the directory table, and hence mostly play correctly. It's curious that your track order, in this case, is the exact reverse.
I'll take a look, though I can't promise an instant fix (I have to work this weekend).
Regards, Chris.
Thanks for your work on this project @chrrrisw. It enables me to update the music on my drive from linux (or any os really) and that's very helpful!
I'm not in a hurry for a fix. I've looked at the code and bit and I'm considering fixing it myself if I can find the time. If you need any more information from me don't hesitate to ask.
Thanks, Sean
Also, I forgot to mention that I'm running e3c27133e7ec7770583006eaccc602533430dc85
Thanks Sean, the project solved the same issue for me also (and was one of the projects I set myself to learn Python, also). Regards, Chris.
Hi @spt5007, I've discovered it's not so simple. I have an album that has two discs, which means that track numbers are duplicated within the album. Although the best way to resolve this is to look at the TPOS (Part of a set) ID3v2 tag to order by disc number also, this is not currently available through the hsaudiotag library that I'm using (at first glance, anyway). The 794a824 commit just made will print out duplicated track numbers, but won't otherwise affect the output database.
I see the same problem when I run 794a824 against my music. Unfortunate about hsaudiotag3k. I wonder why there is no TPOS attribute. I suppose it's not standard in the other file types it supports.
How about deriving a new album title from the original title + TPOS? Now each disc of multipart albums is treated separately. Alternatively this process could be done manually by the user at the tag level. I don't have so many multidisc albums that I'd consider this all that cumbersome.
Another idea is to consider a different tagging library. I used mutagen some years ago and it appears under active development. That's probably a big rewrite but I figured I'd mention it. Thanks again for your help @chrrrisw. With any luck things will slow down for me and I'll have more time to help.
Hi Sean, I've been looking into adding TPOS to hsaudiotag3k, and it doesn't look too difficult - so I might try that avenue first. Thanks for your offer to help and for your input so far. Cheers, Chris.
Hi @spt5007 , there's been some progress on getting disc number into hsaudiotag3k, so I should be able to progress this soon. If not, I'm working on a mutagen-based branch also. Regards, Chris.
Hi all, I have a pull request at:
https://github.com/hsoft/hsaudiotag/pull/3
to add disc numbers to hsaudiotag3k, which (with the latest push to this repository) should fix this issue.
If you're impatient, you could try installing my branch into a virtualenv and testing that out before the new version of hsaudiotag3k is published. My branch is at:
https://github.com/chrrrisw/hsaudiotag/tree/TPOS
Regards, Chris.
Awesome work @chrrrisw. Thanks again!
I tried your hsaudiotag branch in a virtual env. I notice when I run DapGen.py that my multidisc album tracks are printed:
Duplicate track number 1 Birthday
Duplicate track number 2 Yer Blues
Duplicate track number 3 Mother Nature's Son
Duplicate track number 4 Everybody's Got Something To Hide Except Me And My Monkey
Duplicate track number 5 Sexy Sadie
Duplicate track number 6 Helter Skelter
Duplicate track number 7 Long, Long, Long
Duplicate track number 8 Revolution 1
Duplicate track number 9 Honey Pie
Duplicate track number 10 Savoy Truffle
Duplicate track number 11 Cry Baby Cry
Duplicate track number 12 Revolution 9
Duplicate track number 13 Good Night
It seemed to work okay otherwise, though I haven't tried it in my deck just yet. When I run KenwoodDBReader.py I see this just after the last album on my drive (alphabetically):
DEBUG: Album Ordered Title- 'Complexity'; genre 0015; performer 0011; album 0044
DEBUG: Album Ordered Title- 'Silverlake (K.S.O.F.M.)'; genre 0015; performer 0011; album 0044
DEBUG: Album Ordered Title- 'Got A Woman'; genre 0015; performer 0011; album 0044
DEBUG: Album Ordered Title- 'I Love You All The Time'; genre 0015; performer 0011; album 0044
DEBUG: Album Ordered Title- 'Oh Girl'; genre 0015; performer 0011; album 0044
DEBUG: Album Ordered Title- 'Got The Power'; genre 0015; performer 0011; album 0044
DEBUG: Album Ordered Title- 'Skin-Tight Boogie'; genre 0015; performer 0011; album 0044
DEBUG: Album Ordered Title- 'Got A Woman (Slight Return)'; genre 0015; performer 0011; album 0044
DEBUG: Album Ordered Title- 'The Deuce'; genre 0015; performer 0011; album 0044
DEBUG: Album Ordered Title- 'Save A Prayer'; genre 0015; performer 0011; album 0044
DEBUG: Album Ordered Title- 'The Reverend'; genre 0015; performer 0011; album 0044
Traceback (most recent call last):
File "./KenwoodDBReader.py", line 1548, in <module>
db = DBfile(args.inputfile)
File "./KenwoodDBReader.py", line 479, in __init__
self.parse_album_ordered_titles()
File "./KenwoodDBReader.py", line 771, in parse_album_ordered_titles
title = self.entries[title_index]
IndexError: list index out of range
The Reverend is the last track on the last album. I can provide the dap file if it's useful to you. I suspect the tracks will be correct on my deck and that's what matters to me. Great work!
I tried the new dap db with my deck yesterday. The Modest Mouse album now plays in the correct order, but a few others are still backwards: Pigeons Playing Ping Pong and Spin Doctors. I dug into the issue a bit this morning and gathered up some debug output. Here are my insights:
I'm beginning to wonder if the issue is with the way the deck reads albums. Attached is the debug output which I hope is useful to you.
I'm running 1ac93ded930988da8da41f06f01e48a353ac60a6 of this project and a7a62013ffe53e77f44d8f6e875dd14366733cca of hsaudiotag in a virtualenv. TrackOrderDebugOutput.zip
Hi, thanks again for the feedback. Sorry the issue is not yet fixed - I noticed some of my albums now play in the correct order but one, at least, did not. I'll have to go back to the original KMEL program to get a file to which to compare. I may not have fully interpreted the format of these tables. Cheers, Chris.
Hi again, the duplicate track message will be printed if a track number is repeated within the same disc number. Do the files have a 'part of set' tag (disc number tag)?
I believe so. Looking at the files with mid3v2 (utility that shipts with mutagen) I see:
Raw IDv2 tag info for White Album Disc 1/01 Back In The USSR.mp3
TALB(encoding=3, text=['The Beatles (White Album)'])
TDRL(encoding=3, text=['1968'])
TXXX(encoding=3, desc='MCN', text=['0094638345329'])
TCON(encoding=3, text=['Rock'])
TIT2(encoding=3, text=['Back In The USSR'])
TXXX(encoding=3, desc='DISCTOTAL', text=['2'])
TPE1(encoding=3, text=['The Beatles'])
TXXX(encoding=3, desc='REPLAYGAIN_TRACK_GAIN', text=['-8.62 dB'])
TPOS(encoding=3, text=['1'])
TXXX(encoding=3, desc='ITUNES_CDDB_1', text=['E50AE011+209006+17+150+12409+30092+40430+54602+58575+73137+94512+106853+117996+127258+137637+146957+162940+180224+187811+195756'])
TXXX(encoding=3, desc='TOTALDISCS', text=['2'])
TXXX(encoding=3, desc='REPLAYGAIN_TRACK_PEAK', text=['0.95858765'])
TXXX(encoding=3, desc='TOTALTRACKS', text=['17'])
TXXX(encoding=3, desc='TRACKTOTAL', text=['17'])
TCOM(encoding=3, text=['Lennon-McCartney'])
TXXX(encoding=3, desc='ISRC', text=['GBAYE0601644'])
TSSE(encoding=3, text=['Lavf53.21.1'])
TRCK(encoding=3, text=['1'])
...
Raw IDv2 tag info for White Album Disc 2/01 Birthday.mp3
TALB(encoding=3, text=['The Beatles (White Album)'])
TDRL(encoding=3, text=['1968'])
TXXX(encoding=3, desc='MCN', text=['0094638345428'])
TCON(encoding=3, text=['Rock'])
TIT2(encoding=3, text=['Birthday'])
TXXX(encoding=3, desc='DISCTOTAL', text=['2'])
TPE1(encoding=3, text=['The Beatles'])
TXXX(encoding=3, desc='REPLAYGAIN_TRACK_GAIN', text=['-6.89 dB'])
TPOS(encoding=3, text=['2'])
TXXX(encoding=3, desc='ITUNES_CDDB_1', text=['C711CA0E+341759+14+150+12381+30415+43017+53875+68520+88754+102727+121905+133992+147077+160733+198384+224316'])
TXXX(encoding=3, desc='TOTALDISCS', text=['2'])
TXXX(encoding=3, desc='REPLAYGAIN_TRACK_PEAK', text=['0.96218872'])
TXXX(encoding=3, desc='TOTALTRACKS', text=['14'])
TXXX(encoding=3, desc='TRACKTOTAL', text=['14'])
TCOM(encoding=3, text=['John Lennon & Paul McCartney/Paul McCartney'])
TXXX(encoding=3, desc='ISRC', text=['GBAYE0601661'])
TSSE(encoding=3, text=['Lavf53.21.1'])
TRCK(encoding=3, text=['1'])
Hi @spt5007, the latest commits (ending with ac3a697), produce a file much closer to what KMEL does, and so hopefully gets us a lot closer to resolving this issue.
I had a album which played in the correct order when selected by Artist and Album on the deck, but played incorrectly when 'All Artists' -> 'All Albums' was selected.
I've had to reorder all the tracks after reading them all in and processing all albums - that seems to have fixed that particular album on my deck, at least.
I saw this output on my multidisc albums after running DapGen:
Duplicate track numbers:
First 1 Back In The USSR
Second 1 Birthday
Setting disc number to: 1 - you may want to edit the file and set disc number yourself.
Duplicate track numbers:
First 2 Dear Prudence
Second 2 Yer Blues
Setting disc number to: 1 - you may want to edit the file and set disc number yourself.
Duplicate track numbers:
First 3 Glass Onion
Second 3 Mother Nature's Son
Setting disc number to: 1 - you may want to edit the file and set disc number yourself.
Duplicate track numbers:
First 4 Ob-La-Di, Ob-La-Da
Second 4 Everybody's Got Something To Hide Except Me And My Monkey
Setting disc number to: 1 - you may want to edit the file and set disc number yourself.
Duplicate track numbers:
First 5 Wild Honey Pie
Second 5 Sexy Sadie
Setting disc number to: 1 - you may want to edit the file and set disc number yourself.
Duplicate track numbers:
First 6 The Continuing Story Of Bungalow Bill
Second 6 Helter Skelter
Setting disc number to: 1 - you may want to edit the file and set disc number yourself.
Duplicate track numbers:
First 7 While My Guitar Gently Weeps
Second 7 Long, Long, Long
Setting disc number to: 1 - you may want to edit the file and set disc number yourself.
Duplicate track numbers:
First 8 Happiness Is A Warm Gun
Second 8 Revolution 1
Setting disc number to: 1 - you may want to edit the file and set disc number yourself.
Duplicate track numbers:
First 9 Martha My Dear
Second 9 Honey Pie
Setting disc number to: 1 - you may want to edit the file and set disc number yourself.
Duplicate track numbers:
First 10 I'm So Tired
Second 10 Savoy Truffle
Setting disc number to: 1 - you may want to edit the file and set disc number yourself.
Duplicate track numbers:
First 11 Blackbird
Second 11 Cry Baby Cry
Setting disc number to: 1 - you may want to edit the file and set disc number yourself.
Duplicate track numbers:
First 12 Piggies
Second 12 Revolution 9
Setting disc number to: 1 - you may want to edit the file and set disc number yourself.
Duplicate track numbers:
First 13 Rocky Racoon
Second 13 Good Night
Setting disc number to: 1 - you may want to edit the file and set disc number yourself.
Oops, reordering failed - please report as a bug
Number of titles 926
Number re-ordered 925
1#############################################
2#############################################
I will try the drive in my deck in a few minutes. Attaching KenwoodDBReader output for reference. Is it possible that I didn't setup my virtualenv correctly? Thanks again for all your help.
Hi Sean, The output does seem indicative of not having access to the disc parameter in hsaudiotag3k.
I'm also concerned about the last two output lines, I'll check what they mean and get back to you.
In terms of the disc number issue, the fallback should be correct in your case.
Hi Sean, I think the key is that the album based re-ordering fails (one fewer titles), and that leads to further problems down the chain. I've just pushed a change that introduces more robust handling of duplicate track numbering - which may help. I've also added more meaningful debug output for the last two lines. I can successfully run without a hsaudiotag library that supports disc numbers, but I'll be interested to see what the output is on your data. Are you running DapGen.py within your virtualenv (i.e. after you activate it?).
To everybody else, apologies for not working on this in a branch off master.
Regards, Chris.
The tracks of the single disc albums appear to be correct. Nice work there.
I re-ran DapGen and see this output
Duplicate track numbers:
First: Disc 0, Track 1, Title 'Back In The USSR'
Second: Disc 0, Track 1, Title 'Birthday'
Trying disk 1
Duplicate track numbers:
First: Disc 0, Track 2, Title 'Dear Prudence'
Second: Disc 0, Track 2, Title 'Yer Blues'
Trying disk 1
Duplicate track numbers:
First: Disc 0, Track 3, Title 'Glass Onion'
Second: Disc 0, Track 3, Title 'Mother Nature's Son'
Trying disk 1
Duplicate track numbers:
First: Disc 0, Track 4, Title 'Ob-La-Di, Ob-La-Da'
Second: Disc 0, Track 4, Title 'Everybody's Got Something To Hide Except Me And My Monkey'
Trying disk 1
Duplicate track numbers:
First: Disc 0, Track 5, Title 'Wild Honey Pie'
Second: Disc 0, Track 5, Title 'Sexy Sadie'
Trying disk 1
Duplicate track numbers:
First: Disc 0, Track 6, Title 'The Continuing Story Of Bungalow Bill'
Second: Disc 0, Track 6, Title 'Helter Skelter'
Trying disk 1
Duplicate track numbers:
First: Disc 0, Track 7, Title 'While My Guitar Gently Weeps'
Second: Disc 0, Track 7, Title 'Long, Long, Long'
Trying disk 1
Duplicate track numbers:
First: Disc 0, Track 8, Title 'Happiness Is A Warm Gun'
Second: Disc 0, Track 8, Title 'Revolution 1'
Trying disk 1
Duplicate track numbers:
First: Disc 0, Track 9, Title 'Martha My Dear'
Second: Disc 0, Track 9, Title 'Honey Pie'
Trying disk 1
Duplicate track numbers:
First: Disc 0, Track 10, Title 'I'm So Tired'
Second: Disc 0, Track 10, Title 'Savoy Truffle'
Trying disk 1
Duplicate track numbers:
First: Disc 0, Track 11, Title 'Blackbird'
Second: Disc 0, Track 11, Title 'Cry Baby Cry'
Trying disk 1
Duplicate track numbers:
First: Disc 0, Track 12, Title 'Piggies'
Second: Disc 0, Track 12, Title 'Revolution 9'
Trying disk 1
Duplicate track numbers:
First: Disc 0, Track 13, Title 'Rocky Racoon'
Second: Disc 0, Track 13, Title 'Good Night'
Trying disk 1
I'm not super savy with Python virtualev but here's my flow:
virtualenv hsaudiotag_env
source hsaudiotag_env/bin/activity # prompt changes
cd path/to/chriss/hsaudiotag
python setup.py install
cd path/to/kmel_db
python DapGen.py /path/to/usb
That flow looks correct to me, although I'm no expert either. I'm still puzzled by the output you're getting on the White Album, since your earlier output from mid3v2 indicates that TPOS is set. In any case, the output is telling me that the tracks for disc 2 are being adjusted appropriately - is it playing in disc and track order? Is there no other output from DapGen.py?
Just a thought, after you've activated your virtualenv with my hsaudiotag installed, try starting python and trying the following:
>>> from hsaudiotag import auto
>>> print (auto.TAG_ATTRS)
It should print out something like:
{'title', 'disc', 'track', 'album', 'artist', 'genre', 'comment', 'year'}
If 'disc' doesn't appear, then my changes are not present.
Regards, Chris.
I found the issue. It was actually two things. First I needed to checkout your TPOS branch in my hsaudio clone. I was also relying on the executable bit in the DapGen.py script which was using my non-virtualenv python which lacked your hsaudiotag changes. Executing with my virtualenv python did the trick. The tracks look great. Thanks again for going the extra mile and adding features to hsaudiotag to make this all work. I really appreciate it!
Hi Sean, I'm glad you found the issue - I would not have thought of the shebang at the start of the file, so well done - I should change the first line so that it takes into account any virtualenv that may be used rather than hard code the Python path. Thanks for your help with this issue, too. Cheers, Chris.
I have the following Album on my USB drive:
I run DapGen on my drive thusly:
./DapGen.py /media/user/Music/
I notice when I play the album on my deck (KDC-BT31BU) that the tracks are in reverse order. I look at the database file via:
./KenwoodDBReader.py -i /media/user/Music/kenwood.dap/kenwood.dap
This leads me to believe that DapGen isn't respecting the track number in the media file.