Bug 263775

Summary: CD rip fails on ffmpeg call with "NAY, transcoding fail" error in the log.
Product: [Applications] amarok Reporter: Dominic Hosler <dominichosler>
Component: TranscodingAssignee: Amarok Developers <amarok-bugs-dist>
Status: RESOLVED FIXED    
Severity: normal CC: a11409898, d, jacobgodserv, linux.nerdy.kid, sam, teo
Priority: NOR    
Version: 2.4-GIT   
Target Milestone: 2.6   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In: 2.6
Attachments: Log of Amarok (from amarok -d --nofork) from when the error happened.
log during error in amarok 2.4-GIT as of today
Output of 'amarok --debug', starting at CD insert

Description Dominic Hosler 2011-01-20 18:22:15 UTC
Created attachment 56250 [details]
Log of Amarok (from amarok -d --nofork) from when the error happened.

Version:           2.4-GIT (using KDE 4.5.1) 
OS:                Linux

When I try to rip a CD using Amarok it fails.
The call to ffmpeg seems not to work, see attached log, search for "NAY, transcoding fail!" to get to approximately the right section.

I can rip with other programs, just Amarok that seems to fail.

On a side note, why is there the double menu system, it should work fine leaving out the middle menu, titled Amarok <2>, because the other menus all contain the necessary information - or should I submit this as a seperate bug report?

Reproducible: Always

Steps to Reproduce:
Open Amarok, have a CD in the drive, in local music, go to the audio CD.
Right click on the CD album, choose copy to collection, local collection.
Then choose either transcode, or transcode with custom parameters (you get asked again next screen anyway).
Then choose either ogg or flac to transcode to (both of these give the bug I'm reporting).
Finally, choose some filing system in the last menu and click transcode.

Actual Results:  
Very fast percentage completion, whole thing "transfers" in about a second, however nothing is transferred, and nothing is transcoded.

Expected Results:  
The program to actually transcode the audio, and add it to my local collection.

OS: Linux (i686) release 2.6.35-24-generic
Compiler: cc
Kubuntu 10.10 packages for KDE & most other things,
ffmpeg compiled from source, git repository, with vorbis support (I heard flac should work by default?).
Comment 1 Jesse Milette 2011-03-03 18:59:16 UTC
I am running Amarok 2.4 on KDE 4.6 with the same problem.  I have tried encoding with ogg, mp3 and flac all with the same result.  I should not as well, that Amarok can't even play the cd.  It recognizes it and reads the track names, but thats it.
Comment 2 Myriam Schweingruber 2011-03-08 19:26:42 UTC
Setting status to confirmed.
Comment 3 Myriam Schweingruber 2011-06-02 12:26:10 UTC
Could you please test with latest amarok 2.4-git? CD playing and ripping should be fixed now.
Comment 4 Myriam Schweingruber 2011-06-19 12:42:35 UTC
Any news on this? Without feedback within 2 weeks I will close this as fixed.
Comment 5 Myriam Schweingruber 2011-06-19 17:45:00 UTC
*** Bug 276035 has been marked as a duplicate of this bug. ***
Comment 6 David Solbach 2011-06-19 18:48:06 UTC
Created attachment 61153 [details]
log during error in amarok 2.4-GIT as of today

seems still a problem in KDE 4.6.4 and Amarok 2.4-GIT (gst backend).

I still get

amarok:   "" 
amarok:   NAY, transcoding fail! 

Please see attached 'amarok --debug' output for details.
Comment 7 David Solbach 2011-06-19 18:50:49 UTC
reopening since its still reproducible in current 2.4-GIT
Comment 8 Myriam Schweingruber 2011-06-19 22:57:47 UTC
It was never closed, just "waitingforinfo"
Comment 9 Jacob Godserv 2011-06-20 00:04:01 UTC
I don't know if this is at all relevant, but this occurs even when ffmpeg clearly isn't installed or supported by the set of gstreamer plugins. I run on a Gentoo system so I can switch on and off ffmpeg support fairly simply. I did this as a test when I first saw this message.

Also interesting in the message is that it's asking ffmpeg (by all appearances) to access a URL. I'm pretty sure ffmpeg doesn't understand URL's, or at least definitely not KDE URL's.

There's a part of the latest log that reads like this:
"ffmpeg", "-i", "/MP3/Track 01.mp3"

ffmpeg is going to expect an /MP3 folder, when in fact KDE means cdda://MP3, neither of which ffmpeg can read.

I'm not a developer, though, so I could be wrong. It may be that ffmpeg used to be able to understand, or KDE is doing something it's not reporting in logs. I've just switched from GNOME to KDE, so I'm not used to all these library layers that don't have any intermediate executables to allow for debugging and testing, at least from a power user's point of view.
Comment 10 Sam Lade 2011-06-22 11:55:38 UTC
From a discussion on IRC, it appears that if you choose the "copy" option when inserting a CD, this works and produces an output transcoded to ogg vorbis format (I assume using KDE's built-in audio CD handling). This certainly isn't clear from the interface. The "transcode" option, with choices of output format etc, doesn't work.
Comment 11 fed up 2011-09-02 19:25:47 UTC
Created attachment 63319 [details]
Output of 'amarok --debug', starting at CD insert

Also seeing complete CD-Rip failure.

Using 

amarok -v
 Qt: 4.7.3
 KDE Development Platform: 4.7.00 (4.7.0) "release 10"
 Amarok: 2.4.3

On disc insert, I see the CD appear in Amarok.

@ Rt-click, Copy Colletion -> Local Collection -> Transcode (either default or custom), simply creates the ./(Artist Name)/(Album Name) directory/subdirectroy in the target folder, but no transcoding occurs.

Output of 'amarok --debug', starting at CD insert, is attached
Comment 12 fed up 2011-09-02 22:00:48 UTC
building from git,

git log | head -n 7
 commit a501993bb7efa3a4d52e04a9fb206a54b0ff0df4
 Author: Christophe Giboudeaux <cgiboudeaux@gmx.com>
 Date:   Fri Sep 2 21:16:49 2011 +0200
 
     more build fixes
     CCBUG: 281131

installs,

amarok -v
 Qt: 4.7.3
 KDE Development Platform: 4.7.00 (4.7.0) "release 10"
 Amarok: 2.4-GIT

repeating the procedures above, I get a different result.

Amarok now displays in 'Local Collection' under "Various Artists" the "Album Name" (not the Artist Name, as before), and displays a "Scanning Music" progressbar, which unfortunately, never progresses.

output from

 amarok --debug

simply cycles, repeating endlessly,

 ...
 amarok:   BEGIN: virtual bool Meta::AudioCdAlbum::isCompilation() const
 amarok:   END__: virtual bool Meta::AudioCdAlbum::isCompilation() const [Took: 0s]
 ...

with an occassional,

 ...
 amarok:   BEGIN: void ScanManager::checkForDirectoryChanges()
 amarok:     BEGIN: void DirWatchJob::setPaused(bool)
 amarok:     END__: void DirWatchJob::setPaused(bool) [Took: 0s]
 amarok:   END__: void ScanManager::checkForDirectoryChanges() [Took: 0s]
 amarok:   BEGIN: void ScanManager::checkForDirectoryChanges()
 amarok:     BEGIN: void DirWatchJob::setPaused(bool)
 amarok:     END__: void DirWatchJob::setPaused(bool) [Took: 0s]
 ...

thrown in.
Comment 13 Myriam Schweingruber 2011-09-02 22:47:41 UTC
Please do not Cc me, I am already subscribed to the bugs for Amarok, else I get those twice.
Comment 14 fed up 2011-09-02 23:08:12 UTC
(In reply to comment #13)
> Please do not Cc me, I am already subscribed to the bugs for Amarok, else I get
> those twice.

Sorry.

You'd promised to previously close the bug if no feedback within two weeks,

 "Without feedback within 2 weeks I will close this as fixed."

but there hasn't been any comment, from anyone, since 2011-06-22.

It simply wasn't clear what the situation was, whether you'd received any of those responses you'd asked for, and I was trying to be helpful.
Comment 15 Myriam Schweingruber 2011-09-03 08:03:06 UTC
Read comment #7, there was feedback after my request.
Comment 16 fed up 2011-09-03 14:14:33 UTC
yes, that's clear.  i didn't suggest there wasn't.
Comment 17 Myriam Schweingruber 2012-02-23 21:14:29 UTC
Closing, this is fixed in 2.4.3 for sure. Please make sure you have all necessary encoders installed.
Comment 18 Matěj Laitl 2012-03-16 20:10:03 UTC
Git commit 1a0287f7925d92a05a530ab83fffbc9afae67e86 by Matěj Laitl.
Committed on 21/01/2012 at 01:13.
Pushed by laitl into branch 'master'.

Rework transcoding: remember encoder, transcode on move, cleaner code

This is a major rework of transcoding feature that brings following
user-visible changes to Amarok:
 * Amarok can remember preferred transcoding configuration per each
   collection that supports transcoding. Therefore, the "Use default
   configuration" work-around can go away and the "Transcode or copy?"
   dialog can (and is) be one-step now. This preference can be changed
   in configuration.
 * Transcoding is now supported even during the move operation. No
   worries, only successfully transcoded tracks are removed from their
   original location.
 * Only formats playable on the target collection are offered. Already
   used & tested in yet-to-be-merged iPod collection rewrite.
 * The "Organize Tracks" dialog title and progress bar operation name
   now more verbosely describe actual operation to prevent user
   mistakes.
 * Double-transcode when ripping audio CDs that caused failures is
   avoided. (ChangeLog entry for this was miscredited to my earilier
   commit)

Technically, following changes are made:
 * many methods that accepted optional TranscodingConfiguration now
   either have it mandatory or not at all.
 * TranscodingConfiguration's NULL_CODEC was splitted to JUST_COPY and
   INVALID along with convenience methods isValid() and isJustCopy().
   This simplifies logic in many methods.
 * CollectionLocation::prepare{Copy,Move}() now don't have optional
   TranscodingConfiguration parameter. Depending on target collection,
   CollectionLocation determines it automatically or asks user in
   showSourceDialog() (overridable). AudioCdCollectionLocation already
   overrides it.
 * Collections that support transcoding now should expose
   TranscodeCapability which is used to a) indicate that transcoding
   is supported; b) query which file formats are playable on target
   collection; c) read & save & unset preferred transcoding parameters.

Why the hell the new Capability?
================================

Many Amarok devs dislike the concept of capabilities[1]. Why the hell I
introduced the new one? In ideal world Amarok would be able to transcode
everything regardless of the target collection. This is however not
doable witch current copyUrlToCollection() design - target collection
needs to do non-trivial things such as re-reading file tags, accounting
for different file name and space requirements etc. See my comments in
[1]. We therefore need a way for target collection to indicate it
supports transcoding (in order not to fool user). Some collection
locations such as TrashCollectionLocation should even intentionally
disallow transcoding. Additionally, we want to be able to query
supported destination file formats, to save preferred transcoding
paremeters etc.

I simply didn't want to pollute already over-crowded CollectionLocation
with three more methods used by only a few subclasses. On the other
hand, TranscodeCapability is not the central idea of this patch and I
can factor it into CollectionLocation should there be a voice supporting
it.

v2 patch version: gui string changes as suggested by Bart & Teo

[1] https://git.reviewboard.kde.org/r/103752/
Related: bug 280526, bug 264681, bug 291722
FIXED-IN: 2.6
REVIEW: 104213
DIGEST: Feature: much improved transcoding

M  +4    -1    ChangeLog
M  +1    -0    src/CMakeLists.txt
M  +10   -33   src/browsers/CollectionTreeView.cpp
M  +1    -2    src/browsers/CollectionTreeView.h
M  +1    -38   src/browsers/filebrowser/FileView.cpp
M  +0    -1    src/browsers/filebrowser/FileView.h
M  +21   -3    src/configdialog/dialogs/CollectionConfig.cpp
M  +33   -0    src/configdialog/dialogs/CollectionConfig.ui
M  +48   -12   src/core-impl/collections/db/sql/SqlCollection.cpp
M  +14   -1    src/core-impl/collections/db/sql/SqlCollection.h
M  +39   -18   src/core-impl/collections/db/sql/SqlCollectionLocation.cpp
M  +3    -1    src/core-impl/collections/db/sql/SqlCollectionLocation.h
M  +1    -1    src/core-impl/collections/mediadevicecollection/MediaDeviceCollectionLocation.h
M  +17   -0    src/core-impl/collections/support/CollectionLocationDelegateImpl.cpp
M  +3    -0    src/core-impl/collections/support/CollectionLocationDelegateImpl.h
M  +1    -1    src/core-impl/collections/support/PlaylistCollectionLocation.h
M  +2    -2    src/core-impl/collections/support/TrashCollectionLocation.h
M  +1    -1    src/core-impl/collections/umscollection/UmsCollectionLocation.h
M  +1    -0    src/core/CMakeLists.txt
M  +1    -0    src/core/capabilities/Capability.h
C  +5    -22   src/core/capabilities/TranscodeCapability.cpp [from: src/core/transcoding/TranscodingConfiguration.cpp - 073% similarity]
A  +84   -0    src/core/capabilities/TranscodeCapability.h     [License: GPL (v2+)]
M  +64   -21   src/core/collections/CollectionLocation.cpp
M  +19   -8    src/core/collections/CollectionLocation.h
M  +22   -0    src/core/collections/CollectionLocationDelegate.h
M  +112  -3    src/core/transcoding/TranscodingConfiguration.cpp
M  +41   -4    src/core/transcoding/TranscodingConfiguration.h
M  +17   -16   src/core/transcoding/TranscodingController.cpp
M  +21   -9    src/core/transcoding/TranscodingController.h
M  +11   -12   src/core/transcoding/TranscodingDefines.h
M  +3    -1    src/core/transcoding/TranscodingFormat.h
M  +4    -6    src/core/transcoding/formats/TranscodingNullFormat.cpp
M  +1    -1    src/core/transcoding/formats/TranscodingNullFormat.h
M  +2    -6    src/services/magnatune/MagnatuneCollectionLocation.cpp
M  +1    -1    src/services/mp3tunes/Mp3tunesServiceCollectionLocation.h
M  +1    -0    src/transcoding/CMakeLists.txt
M  +83   -75   src/transcoding/TranscodingAssistantDialog.cpp
M  +25   -9    src/transcoding/TranscodingAssistantDialog.h
M  +157  -296  src/transcoding/TranscodingAssistantDialog.ui
M  +3    -2    src/transcoding/TranscodingOptionsStackedWidget.cpp
A  +55   -0    src/transcoding/TranscodingSelectConfigWidget.cpp     [License: GPL (v2+)]
C  +42   -39   src/transcoding/TranscodingSelectConfigWidget.h [from: src/transcoding/TranscodingAssistantDialog.h - 050% similarity]
M  +1    -0    tests/core-impl/collections/db/sql/TestSqlCollectionLocation.cpp
M  +3    -0    tests/core/collections/MockCollectionLocationDelegate.h

http://commits.kde.org/amarok/1a0287f7925d92a05a530ab83fffbc9afae67e86