Wednesday, 25 September 2013

AudioCD: final report.

Summer of code is other, so here is my final report.

My project title was "Audio СD collection refactoring". So now as it was expected Amarok  will have better support of AudioCd collections:
  1. New code does not use deprecated frameworks and follows logic which is common for collections in Amarok.
  2. Almost all bugs are fixed in new implementation.
  3. Some bugs such as 210101, 320356, 320388 were not fixed, but now user has tools which can be used in order to get desired results (see this post). 
  4. I haven't test it yet but new implementation should work in Windows, since AudioCD now uses only cross platform libraries.
  5. AudioCD collection now support not only CDDB as metadata source, but also CD-TEXT. And it is relatively easy to add a new one (for example, Music brainz).
And last, but not least I had a lot of fun during work on this project.

Thursday, 19 September 2013

AudioCD. Previous weeks report.

There two new things that can be noticed by user have appeared in Amarok during this period.

Now user can switch between available metadata sources (CDDB and CD-Text currently). It can be done by clicking on the collection and then choosing Collection:

 and there you can find this two new actions: "Use CDDB Metadata" and ''Use CD-TEXT Metadata":

\
Previously I've showed cases when it is useful. As a reminder: for example when metadata is presented in both CDDB and CDTEXT, it is possible that correct encoding for the metadata has been guessed only for one source, so it is simpler just to switch between different sources, instead of trying to find correct encoding.

But if you want to try your luck in encodings guessing, this option is available to you now. Just choose "Select Encoding" in AudioCD Collection actions and Encoding Selection dialogue with list of guessed encodings and sample text will appear:


Tuesday, 27 August 2013

AudioCD. Week 10.

From now on you can imagine that I'm starting every post with "I've fixed something", since code works pretty stable, but sometimes I come across small issues and fix them.

 If you'll have a look on a bugs left in my branch, then you can easily divide them on three categories: metadata (cddb+cdtext), tracks from "Menu option" windows.

So for the first category I do not see a solution which would fix bug with encoding, but I see one which at least will make an user's life easier: we need to have an ability to switch between cddb and cdtext (there is situations when one of the sources has correct encoding) and ability to select an encoding from some list. So I was working on that this week.

Tuesday, 20 August 2013

AudioCD. Week 9

This week I was also fixing bugs. Fixed bugs marked blue in this table.

Installing Amarok under Windows didn't go well, I can't even install kde libs normally, I have troubles with a permissions: folder has proper permissions for writing, but never the less writing is failed because of permissions. So I decided to have a fresh Windows installation with VirtualBox.

I made changes in AudioCdAlbum, so now I think it is integrated properly with MemoryMeta framework.

And I also fixed some issues in transcoding for AudioCdCollection.

Wednesday, 14 August 2013

Last week I was fixing bugs. Let me summarize.

279485 Amarok trusts CDDB too much

Since I do not have exact the same CD which user reported this bug has, I did following steps in order to reproduce and test it:

1) I have following disc and as already was told last entry in CDDB match is invalid.
I do not see "what can possibly go wrong", but order to test this case I've hardcoded that 5th match instead of first one has to be taken. So, nothing unusual had happend. Amarok displayed wrong names, but was able to play tracks normally.

2) Second problem I wanted to address was "what if CDDB match has less tracks than number of tracks on cd". So as before I've hardcoded this situation and as before nothing unexpected had happend: so track with missed CDDB info has just "standard" name Track n.

290216 Amarok doesn't detect that Audio CD is inserted on Windows

Oh. Obviously, first thing you have to do is to compile Amarok under Windows (and not only Amarok, but also "few" additional libraries). So I'm working on it.

210101 Wrong encoding detection of Japanese CDs

So I've started with some Korean audio CD and get following:








CDDB metadata is on the left, CD-Text metadata is on the right.
There is no special field for encoding type indication nor in CDDB neither in CD-Text.
So I see only one possible solution try to guess the encoding. Some time ago when I've faced with encoding guessing I've used enca, but it support only Slavic languages and Chinese, so it is not enough. Then I've found ICU library. ICU has an API for encoding
detection (it is used for example in chromium). But for now I did not get a lot from it.
For example ICU has a call ucsdet_detectAll which gives you encodings that properly decode given text and it has some heuristics for encoding detection, such that the more likely encodings should be returned first. And for CD-TEXT example above ICU chooses UTF-8 as best
possible encoding, but nor this one neither next three encoding does not decode text properly. Probably, I should find what else can be used for encoding guessing.

305733 On starting amarok existing entry in playlist which is cd track has missing info

This bug doesn't appear anymore in a way it was described in a bug report. But it appears in a different way. On starting amarok there are can be entries in playlist which corresponds to the cd and they are grey (what means that they are unavailable) in both cases if there is no cd in a drive and if there is cd corresponding to this entries.

Tuesday, 6 August 2013

AudioCd. Week 7.

This week report will be short:
  • issue with wrong wav-file I've reported last week was fixed
  • I also did some improvements in code which works with MemoryMeta. 
I also reviewed AudioCdCollection bugs. It is hard to keep track on fixed bugs, because I can't close fixed one in bugzilla. So I'll list bugs here and shall update this post:

Bug id Title Status
210101 Wrong encoding detection of japanese CDs
301149 Amarok crashes when editing tags of a track from a removed CD fixed
311329 Better user feedback in Amarok when transcoding from CD is not working due to lame not being installed fixed
279188 Launching amarok with --cdplay doesn't add the CD to playlist fixed
279485 Amarok trusts CDDB too much, bad audio CD info => cannot play fixed
289294 Amarok recognises data track as audio for mixed audio cd's fixed
290216 Amarok doesn't detect that Audio CD is inserted on Windows
305733 On starting amarok existing entry in playlist which is cd track has missing info fixed
319036 Audio Cd collection doesn't disappear from Collection View when CD is ejected from outside amarok fixed
320356 Amarok does not play CDs if those are selected through the Menu option "Add Media..."
320388 CDs with foreign characters in cddb info not displayed correctly
Amarok freeze up if CD is removed during playback of a track from it fixed

Tuesday, 30 July 2013

AudioCD. Week 6.

During last week I worked with MemoryMeta framework, metadata fetching and transcoding. Nothing very interesting in [MemoryMeta framework/metadata fetching], I just cleaned up the code.

Transcoding with Paranoia.

I've looked around libcdio and discovered that there is a library which allows to read data from CD in a platform independent way. So, I've started working with it during last week and I think it is good alternative for kio-audiocd. Current workflow looks like this (it definitely not a final version, but just prototype for testing): copying of track or bunch of tracks is prepared by standard Amarok transcoding framework, AudioCDCollectionLocation reimplements onlt getKIOCopyableUrls: for each track it starts new job where track is ripped to temporary wav file, when every copy-job is finished information about new tracks temporary locations goes again to standard transcoding framework.

The reason why I repeated word "standard"  quite few times is that if transcoding is done with help of kio-audiocd then AudioCDCollection uses its own implementation of transcoding process. For now there is significant bug in this prototype: resulting wav file isn't correct. Using imagination you can hear the desired melody, but it is obviously not enough ;)