Wednesday, January 29, 2014

I'm grounded (not really, but sort of)

Samsung RF411 as Paperweight

Since last September my Samsung RF411 has been inflicted by frequent BSOD. The prime culprit was Canon driver - the only changes in months. After performing System Restore prior to installation I didn't get BSOD anymore.
After installing .Net framework 4, I was greeted by another BSOD. I performed another system restore (prior to .Net framework 4 installation) and I could use it again.

Late November the BSOD repeated its regular visits. At this point, I didn't think another system restore could resolve my problem.
Analyzing the minidumps (using WinDbg) points to NVIDIA driver, thus I proceed to uninstall NVIDIA driver. But even after that BSOD persisted.
I could circumvent BSOD by going to safe mode (with networking) every time, but somehow I occasionally missed the chance even though I've rapped on the F8 button frequently. My irritation was multiplied by BSOD that sometimes greet me during start up process. Before you comment, yes I've turned off Driver Verifier that actively triggering BSOD.

I forgot who gave me the idea, but I decided to try updating my BIOS via Samsung SW Update; which gave me corrupted BIOS - it couldn't boot. Again, I could circumvent this by inserting a bootable disc and sticking a bootable usb and not pressing any key when asked. But this gives me no chance to hit F8 to go to safe mode, and the BSOD is lurking around.
Today, 29 Jan 2014 I tried to chat with Samsung support on ways to rectify the BIOS issue and got the generic answer: hit F4 for Samsung Recovery. I had my doubt, but I decided to give it a try anyway:

  • Restart
  • Press F4
  • See a prompt "Please Wait..."
  • Keep the machine on for an hour with nothing happening.
  • Turn it off.

Now every time I turn it on, I just see Samsung logo and "Please Wait..." plea. Yay.
Lesson learned: Whenever you hit a problem in Windows, remember the golden rule: don't bother troubleshoot - re-install!.

ACER D255 to Decommissioned?

Due to RF411 issue, I've been using my mom's netbook. I picked Windows SDK for development because it's comparatively light-weight -- coding in notepad, compiling in command prompt. However, using Visual C++ 2010 as the compiler means that my application depends on .Net framework 4.0.
Thus I made the switch to Qt. It's a behemoth for the tiny netbook; the system often gets unresponsive with very heavy disc activities. It has auto-shutdown twice now, and I think it was cue for me to stop.

DELL D410 to the Rescue?

I still have this old laptop that despite its age is more powerful than D255. Yet, after over 7 years of usage it has a unique flaw: after extended period of heavy usage, it would complained loudly (translation: after 30 minutes of playing facebook flash game, a loud sound would be heard).
I can try re-installing Windows while crossing my finger, hoping that the source of groaning is over-burdened OS rather than wear and tear of the components. Either that or...

I Should Try to Revive The Best One

Found a thread of Samsung BIOS Update Issues. I'll read through the 15 pages and if I find no confidence to proceed myself (which is very likely) I'll post a question there.

Tuesday, January 28, 2014

Continuing MP3 Player Development?

Problems

There are at least 3 problems with Qt 4.8 + Phonon
  1. Unable to play some songs - well known issue with known solution?
  2. For some media, the timer might be off (by a lot, almost 3x). - well known issue.
  3. Dragging progress slider would make the position out of sync - this is a big issue for me since my main intent is to show lyrics in timely manner.
Comparing it with previous development under Ms. Visual C++ from Windows SDK
  1. I managed to resolve the same problem by manually adding WM ASF Reader Filter.
  2. Unknown - didn't display time in this version
  3. No problem on some media that exhibit this issue at Phonon, but a LAME-encoded media exhibits the same problem.
As I've mentioned in another post, I don't want to continue developing via Windows SDK because of dependency to .NET Framework 4.0. Specifically because installation of it on my Windows 7.0 64bit caused BSOD - and later found out this is not unique experience.

After I un-installed Qt 4.8 and installed Qt 5.2 I realized that Phonon has been dropped in favor of QMediaPlayer. After testing QMediaPlayer out:
  1. Same issue as Phonon - can't play some songs
  2. Unknown - forgot which song has the wrong timing - might update this later.
  3. Same issue as Phonon - SDK version is more reliable.

To be sure, I'm not suggesting that Windows SDK is better than Qt; simply that I had more success with Windows SDK thus far.

Confusions

First Confusion Stemming from Qt Bug Tracker

QtMultimediaKit would first try to apply WM ASF Reader Filter for mp4 playback.
Yes, it's different tool for different purpose; but my point is: if Qt can use WM ASF Reader Filter there, it should be usable for QMediaPlayer? There shouldn't be any licensing issue with Microsoft for filter usage.
The bug above has been deemed invalid by suggesting Media Foundation over DirectShow.
I've also read someone said Windows Media Player uses Media Foundation rather than DirectShow (to deflect criticism: WMP can play it, why can't yours?). But I used DirectShow in SDK version and managed to tackle the issue? Sigh.

Straying from topic for a bit; a guy here goes further by claiming that
Even the folks in the Qt irc channel told me not use QMediaPlayer on Windows. They suggested using SDL.
 Not sure how much truth in there, but I think using 3rd party codec is more reliable.

Second Confusion: What Codec Should I Use?

Previously I've considered going direct to FFmpeg/libav or Libavcodec but I read in wikipedia that:
  • GStreamer has made a wrapper for FFmpeg/libav
  • Phonon uses / supports it http://en.wikipedia.org/wiki/GStreamer#Distribution_and_adoption
Working on a wrapper will definitely make my work a lot easier, yet considering Phonon has the issues above, can I make the assumption that GStreamer is not a complete wrapper?

Third Confusion: Completeness

An often raised argument is the fact that MP3 implementations are heavily loaded with patents. To support all implementations mean to buy in those patents.
Although a lot of applications use FFmpeg/libav under the hood, each must've improved on it -- like applying the proper filter, properly calculating media duration and current position, etc.
Using Phonon and QMediaPlayer as reference, I highly doubt I'll be able to build an application that can play all MP3s smoothly.

Conclusion?

None for the time being; I need to try implementing WM ASF Reader Filter first, before deciding whether to go on ahead or drop it.

Sunday, January 26, 2014

Minor Update v0.01b

Grab the newer version at the download page.

Change logs:
  • Bug fix: dialog to confirm lyrics creator portion was previously obscured by the main form - this has been fixed.
  • Remove menu bar and replace actions with buttons.
  • Track list table used to show Title, Artist and Album; now it only shows the Title.

Saturday, January 25, 2014

Anime Lyrics

I don't have much for the time being; and I doubt I can add a lot by myself. Thus current presentation layout suffices.

Plan lyrics refer to lyrics without any fancy stuff in it. SubRip specifications allow relative positioning (that has no bearing for audio) and extra formatting (coloring and such).
I wish to support coloring in my player to make it clear who sings what phrase. This feature is important especially for Nichijou - Web Radio songs; where one cuts another sentences.

K-On!

Single - Gohan wa Okazu / U & I

  1. Gohan wa Okazu - plain lyrics
  2. U & I - plain lyrics.

Houkago Tea Time II

  1.  Tenshi no Fureta yo! - plain lyrics.

 

Nichijou

WEB Radio - Nichijou no Radio

  1. Yukko-Mio-Mai no Sucharaka San-nin Shuu - plain incomplete lyrics.
 I want to create one for the 1st song (Shinonome Kenkyuujo no Kyou mo Heiwa desu); unfortunately I don't have a proper English translation for it.

 

Shinryaku! Ika Musume

Metamerism

  1. Metamerism - plain lyrics
I may create the lyrics for the 2nd song (Kimi ga Ireba) next.

Friday, January 24, 2014

MP3 Player with Lyrics

Note: feel free to skip my ramblings and go directly to download page.

Background

Due to my recent interest to hear Japanese songs - particularly those associated with certain anime - I've been wanting to have an application with features:
  • Play mp3 (obviously)
  • Show lyrics
  • It should be modal (always on top even when out of focus)
  • It should be semi transparent, enabling me to do other activities
  • (optional) It can be used to create lyrics.
Finally I've decided to make one myself.
There is a chance that I've just re-invented the wheel - for I'm sure what I want is not something unique - but I don't want the trouble &/ risk of trying out free/share-wares that may suit my wants.

Development History

I used Windows SDK 7.1 for my first try, but after some times decided to switch to Qt 4.8 instead.
Presently (as music player) the SDK version is better than the Qt version but I won't be sharing it.
Reason: It requires .Net Framework 4.0 to run. Framework installation causes BSOD for my best Windows 7.0 laptop and some searches reveal this symptom is quite common.

Creating Lyrics

Lyrics creation is only possible when there is only one item in the track list and there is currently no lyrics available for it.

The steps to create a lyrics

  1. Open a song.
  2. Show Subtitle Creation section.
  3. Fill in the text box(es) with lyrics. Tick on the checkbox and fill in the text box below it if secondary / tertiary lyrics is/are available.
  4. Play the song.
  5. Hit [Start] to grab a line into the lyrics box - don't worry too much if you're always clicking it a bit late.
  6. Hit [Stop] to indicate that line has been uttered completely.
  7. Repeat step 5 & 6 until the end. You might want to pause somewhere in the middle to take a breather.
  8. Hit [Save Lyrics] to save your lyrics.
For your 1st lyrics, it's recommended to:
  1. Save after only 2-3 lines.
  2. Close and re-load the song (apologize for the inconvenience).
  3. Play it and observe whether the lyrics appear too late.
  4. If so, consider adjusting the setting before starting another lyrics creation.

Before we begin lyrics creation, there are some things to note

  1. It's recommended to adjust app's width to max by dragging on app's corner.
    The application picks the lyrics line by line, as shown in the text boxes. This means that word-wrap may break a line, causing Japan-Romaji-Translation lyrics to be out of synch.
  2. If a line is still wrapped despite above, consider editing it. Revising a line later is easier than out-of-synch lyrics.
  3. Remove empty lines between verses.

Technical consideration for above

Qt practitioners recommend block over line capturing. When I copy-pasted UNICODE text (one with Japanese / other characters) a block would be a line, disregarding word-wraps. However, if I copy-pasted ASCII text (translated lyrics) a block is the entire lyrics. An easy work-around is to inject a UNICODE character somewhere beforehand; yet I can't expect all users to follow this step.
Application won't automatically remove empty lines. Some empty lines maybe necessary if some parts (in the middle) don't have proper translation.

Application Settings



Currently there are only 2 settings available.
The first is to set opacity level with value ranging between 50 and 100. Value of 50 means 50% transparency while 100 means no transparancy at all. I personally feel 70 is the best, but because I don't want to force my own flavor, I initialize the value at 100 (solid view).
The second is to set time adjustment for lyrics creation with current value ranging between -600ms and 0ms. The minimum value is for people with slow reflect while the maximum is for one with precognition / has the entire song already imprinted in one's brain.

Current Limitations, Known Bugs and Other Shortcomings

Phonon (Qt's default wrapper for media playback)

  • Can't play some MP3. The SDK version can play those songs after manually applying a certain filter.
  • Dragging the progress slider forward/backward would mess-up the timing. The SDK version doesn't have this problem.
  • Timing for certain MP3 is off - up to 3x of actual timing. I didn't bother to show timing for the SDK version, so no comparison on this one.

Usability

  • No feature to delete a song from track list.
  • No feature to re-order the track list.
  • No feature to drag-n-drop into the track list.
  • Open dialog always start from the top (rather than the last opened folder).
  • Objects (table, text box, etc) dimension can't be adjusted individually.

Annoyance

  • Unconditionally creates LogFile.log that may grow quite big.

Future Enhancements (in no particular order)

Settings

  • Save settings into a config file.
  • Font for lyrics box should be configurable.
  • Debug level should be configurable.

Player Codec

  • May drop Phonon for direct access to Windows' driver or switch to FFMPeg.

Usability

Download MP3 Player with Lyrics

STOP!! Don't bother downloading anything here.

Just uninstalled Qt 4.8 to try Qt 5.2; long story short, Phonon library is required for music playback and I don't have the library anymore.

 The original intention was to see whether some known Phonon issues have been resolved in Qt 5.2 - only to realize that Qt doesn't use Phonon - natively - anymore.

Tested Environments

 Works

  •  Windows 7 Starter on a netbook with Intel Atom N550.

Doesn't Work

  • Windows XP --> application runs, but can't load any song.

Download 

Dependency Libraries 

Only need to download once, unless I decide to use other library(ies).

Application


Ramblings


This application is created using Qt 4.8. It is currently dynamically linked, thus several libraries are required for it to run.
Statically linked application would be smaller, but that means:
  • I have to statically compile my Qt.
  • The license for application would change - I haven't read through what's the implication.
In any case, if I decide to statically compile Qt, it would be the latest version of Qt rather than 4.8.

Version 0.01b has been uploaded within a zip file.
I provide the application as an executable rather than bundling it in a zip file.
Reason: I'm curious if any anti-virus would flag it as a virus or such.
--edit 1--
Well, well,  bitly already considers it problematic. I've replaced the link for the application with the real-longer link.