rmcrackan / Libation

Libation: Liberate your Library
GNU General Public License v3.0
2.7k stars 148 forks source link

Unable to Convert to MP3 on Raspberry Pi 5 / arm64 / aarch64 #959

Open jcarletto27 opened 2 months ago

jcarletto27 commented 2 months ago

Describe the bug I receive an error "Conversion failed" when I run LibationCli convert on my raspberry pi, I've tried this in docker, and a bare install to the host raspberry pi system with the same results. the logs claimed it could load the ffmpegacc.so or ffmpegacc.arm64.so so I compiled it myself and linked it but I still see the same issue.

thanks again for such great work!

To Reproduce Steps to reproduce the behavior:

  1. install latest version of raspberry pi os debian bookworm
  2. download libation 11.1 for linux arm64
  3. sudo dpkg -i the deb file
  4. download an audible book (successful)
  5. libationcli convert

Expected behavior libationcli convert should create an mp3

Screenshots image

Platform Raspberry pi 5 both 4 and 8 gb versions

uname -a: Linux homeserver4 6.6.45-v8-16k+ #1791 SMP PREEMPT Tue Aug 13 12:52:29 BST 2024 aarch64 GNU/Linux

'/etc/os-release':

PRETTY_NAME="Debian GNU/Linux 12 (bookworm)" NAME="Debian GNU/Linux" VERSION_ID="12" VERSION="12 (bookworm)" VERSION_CODENAME=bookworm ID=debian HOME_URL="https://www.debian.org/" SUPPORT_URL="https://www.debian.org/support" BUG_REPORT_URL="https://bugs.debian.org/"

Log Files _Log202408.zip

rmcrackan commented 2 months ago

I'm about to be nothing but bad news:

1) I'm beyond novice at all things Linux. Chardonnay uses tech which is out of the box supposed to work for mac and linux. Aside from what you see in my docs, this is more or less the extent to which I'm able to support linux 2) In the morning I fly out for quite a while so I wouldn't be able to address this even if I did know what I was doing 3) This error technically appears to be from a dependency of mine: AAXClean. I'm not sure if he still maintains it. I recommend opening a ticket on his page. Maybe also reply here with a link to your new ticket so they can be connected:

 {}2024-08-16 13:14:53.906 -04:00 [ERR] (at FileLiberator.ConvertToMp3+<ProcessAsync>d__8.MoveNext()) AAXClean error
System.PlatformNotSupportedException: Could not load ffmpegaac or ffmpegaac.arm64.so
   at AAXClean.Codecs.Mp4FileExtensions.DllImportResolver(String libraryName, Assembly assembly, Nullable`1 searchPath) in /home/runner/work/AAXClean.Codecs/AAXClean.Codecs/src/AAXClean.Codecs/Mp4FileExtensions.cs:line 36
   at System.Runtime.InteropServices.NativeLibrary.LoadLibraryCallbackStub(String libraryName, Assembly assembly, Boolean hasDllImportSearchPathFlags, UInt32 dllImportSearchPathFlags)
   at AAXClean.Codecs.FfmpegAacDecoder.NativeAacDecode.aacDecoder_Open(AacDecoderOptions* decoder_options)
   at AAXClean.Codecs.FfmpegAacDecoder.NativeAacDecode.Open(Byte[] ASC, WaveFormat waveFormat) in /home/runner/work/AAXClean.Codecs/AAXClean.Codecs/src/AAXClean.Codecs/FfmpegAacDecoder.cs:line 167
   at AAXClean.Codecs.FfmpegAacDecoder..ctor(Byte[] asc, WaveFormatEncoding waveFormatEncoding, SampleRate sampleRate, Boolean stereo) in /home/runner/work/AAXClean.Codecs/AAXClean.Codecs/src/AAXClean.Codecs/FfmpegAacDecoder.cs:line 29
   at AAXClean.Codecs.Mp4FileExtensions.ConvertToMp3Async(Mp4File mp4File, Stream outputStream, LameConfig lameConfig, ChapterInfo userChapters) in /home/runner/work/AAXClean.Codecs/AAXClean.Codecs/src/AAXClean.Codecs/Mp4FileExtensions.cs:line 99
   at FileLiberator.ConvertToMp3.ProcessAsync(LibraryBook libraryBook) in /home/runner/work/Libation/Libation/Source/FileLiberator/ConvertToMp3.cs:line 71
 {"ExceptionDetail":{"Type":"System.PlatformNotSupportedException","HResult":-2146233031,"Message":"Could not load ffmpegaac or ffmpegaac.arm64.so","Source":"AAXClean.Codecs","TargetSite":"IntPtr DllImportResolver(System.String, System.Reflection.Assembly, System.Nullable`1[System.Runtime.InteropServices.DllImportSearchPath])"}}

I feel bad about my lack of success here in general and for you specifically as a recent tipper. I'd do more if I could.

jcarletto27 commented 2 months ago

No worries, I'm a software dev too, so I get it. I'll see what I can do, and maybe off a PR or a docker image if I get it working.

thanks again for such a great program! aside from the MP3 conversion it's been great!

rmcrackan commented 2 months ago

If you can fix this with a PR I'll for sure take a look when I get back in town. Best of luck

CLHatch commented 2 months ago

I have no idea if the 11.3 changes affect Linux builds or not, but perhaps something in there fixes the issues? I was just looking, and saw this: AAXClean upgrade to .net8.

jcarletto27 commented 2 months ago

Thanks @CLHatch I did test that but to no avail. This seems to be an issue with missing and loading libraries on arm64/aarch64.

Thankfully I just had luck moments ago! I built the libraries from AAXCLEAN.Codecs inside the docker container (not sure if this is important), moving them to the core libation folder were LibationCli sits, and then added a config in /etc/ld.so.conf.d/ that points back to the libation executable folder. Then cleared the cache by echo "" > /etc/ld.so.cache then ran ldconfig to repopulate the cache.

I'm now successfully converting to mp3 on the RPI 5

image

moving those same .so files to another folder that already exists in the conf.d folder might have also worked but I didn't test it

jcarletto27 commented 2 months ago

here's a copy of my built .so files and my conf in case this is helpful to anyone else having the same problem. I'll see about adding these steps to the Dockerfile somehow

configs_and_so.tar.gz

jcarletto27 commented 2 months ago

I was able to push a docker image for use by others

Docker - Jcarletto/libation