Kodi Community Forum

Full Version: FLAC audio encoder not working
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4
I was just working on the binary addons system on win32 to get all the dependencies of the audioencoder addons built on the fly instead of downloading pre-built binaries and includes. Because there were no detailed instructions on how the prebuilt win32 binaries of those libraries were built in the past I wanted to be sure that all audioencoders were still working with the newly built libraries. So I took out a music CD and ripped it with all the different audioencoders available using Kodi Beta 2. Then I did the same with my WIP. All the files were identical so that's good.

What is bad is that neither VLC nor MPC nor XBMC/Kodi is able to play the FLAC encoded files. All other encoded files (Lame MP3, OGG, WAV) can be played perfectly fine. Can anybody test if the same issue is present on Linux and/or OSX to rule out whether it's something platform specificor not?

This is the debug log from when I tried to play one of the FLAC encoded files in Kodi: http://xbmclogs.com/show.php?id=350901

Unfortunately I have no clue about the inner workings of the audio encoders, I'm just the cmake buildsystem monkey Confused Playing a test FLAC file I downloaded from some website worked fine so it doesn't seem to be ffmpeg related.
* Ned Scott puts on a mining helmet with a flashlight to look for his USB CD drive.

EDIT: oh man, I guess I need to find a CD to rip as well..
Found a "best of Donna Summers" CD.

Well, this is weird. In XBMC v13.2 I see lots of encoder options, including FLAC, vorbis, etc. In the November 14th nightly helix build, there is only AAC and WMA.

In both v13.2 and v14 I cannot find any option to rip anything. I'm looking in context menus left and right, including where it should be, Music -> Files (non-library mode) -> Audio CD -> context menu

I also tried to bring up the context menu on individual audio tracks and still there was no rip option.

I know XBMC/Kodi sees an optical drive, because the "play disc" menu pops up, but it's still a USB drive, and maybe OS X + XBMC doesn't like USB optical drives? Like maybe there's some kind of check preventing the rip option from showing up.


Also, maybe unrelated, playing the CD from the "play disc" menu works great, but going to Music -> Audio CD -> and playing an a track (which is named something like "1 Audio Track.aiff") is all stuttery and doesn't play smoothly. As if it has skips in it (it doesn't appear to have any scuffs on the physical CD).
(2014-11-15, 02:33)Ned Scott Wrote: [ -> ]Well, this is weird. In XBMC v13.2 I see lots of encoder options, including FLAC, vorbis, etc. In the November 14th nightly helix build, there is only AAC and WMA.
Sounds like you don't have the audioencoder addons installed. AAC and WMA are not binary addons but are builtin encoders so they are always available.

(2014-11-15, 02:33)Ned Scott Wrote: [ -> ]In both v13.2 and v14 I cannot find any option to rip anything. I'm looking in context menus left and right, including where it should be, Music -> Files (non-library mode) -> Audio CD -> context menu
Yeah that's where it should be. I haven't tried Gotham though. We didn't have binary addons back then.

(2014-11-15, 02:33)Ned Scott Wrote: [ -> ]I also tried to bring up the context menu on individual audio tracks and still there was no rip option.
That should work as well on the audio tracks from the CD. But it doesn't work on ones from your normal library.

(2014-11-15, 02:33)Ned Scott Wrote: [ -> ]Also, maybe unrelated, playing the CD from the "play disc" menu works great, but going to Music -> Audio CD -> and playing an a track (which is named something like "1 Audio Track.aiff") is all stuttery and doesn't play smoothly. As if it has skips in it (it doesn't appear to have any scuffs on the physical CD).
I can't notice any difference in playback when starting from "Play Disc" or from Music -> Audio CD.
OK I investigated some more and it seems like the FLAC audioencoder has been broken (at least on win32) ever since the binary addons merge. With https://github.com/xbmc/xbmc/commit/4090...f3d357ea90 it doesn't work but with the commit before that (i.e. without binary addons) it works fine.
OK I think the problem is this change that went into the binary addon version of the FLAC encoder: https://github.com/xbmc/audioencoder.fla...ce56abad71
The commit message says that iTrackLength is in seconds but it clearly isn't and at least on win32 the original code was correct because there the value of iTrackLength is
Code:
iTrackLength = <sample rate> * 4 * <track length in seconds> = 44100 * 4 * <track length in seconds>
so dividing iTrackLength by 4 should result in the estimated number of samples as is required.

EDIT: See https://github.com/xbmc/audioencoder.flac/pull/7 for a fix. After this PR has gone in we will need to update the commit used to build audioencoder.flac in mainline.
(2014-11-15, 09:10)Montellese Wrote: [ -> ]
(2014-11-15, 02:33)Ned Scott Wrote: [ -> ]Well, this is weird. In XBMC v13.2 I see lots of encoder options, including FLAC, vorbis, etc. In the November 14th nightly helix build, there is only AAC and WMA.
Sounds like you don't have the audioencoder addons installed. AAC and WMA are not binary addons but are builtin encoders so they are always available.

I'm probably missing something here, but do I need to install or compile something to help test this?
Which platform are you using Ned? On Linux the audio encoders need to be downloaded from a repo going by http://forum.kodi.tv/showthread.php?tid=208134
OS X
Why do we have this external encoder addons like flac encoder? FFmpeg can do this too.
@Ned: I have no idea how this works on OSX or Linux. On win32 you can choose which audioencoder addons to install during the installation process and the default is to install them all.

@FernetMenta: I don't know. We had them (flac, lame mp3, ogg vorbis and wav) for ages and they were simply moved from being part of the core code to binary addons. There are also two other builtin audio encoders (AAC and WMA) which use FFmpeg AFAIK.
(2014-11-15, 20:26)jjd-uk Wrote: [ -> ]Which platform are you using Ned? On Linux the audio encoders need to be downloaded from a repo going by http://forum.kodi.tv/showthread.php?tid=208134

on ubuntu, with our PPA(s) enabled: sudo apt-get install xbmc-audioencoder-[name]
the names will change to kodi-audioencoder-* in the future

edit: OSX should include those with the kodi.dmg. If not, there might be path fixes needed in depends.
I'm just ripping an Audio-CD as FLAC with default compression and it's playing just fine. Using Windows nightly 2cd9438.

edit: ok, half of the files is broken it seems
sounds like a packaging issue for osx - will have a look asap
by testing all audio encoders I noticed that WMA rips are always 2 secs longer than others. So if a song is 3:20 as MP3 it's 3:22 as WMA
Pages: 1 2 3 4