Unable to Convert to MP3 on Raspberry Pi 5 / arm64 / aarch64
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:
- install latest version of raspberry pi os debian bookworm
- download libation 11.1 for linux arm64
- sudo dpkg -i the deb file
- download an audible book (successful)
- libationcli convert
Expected behavior libationcli convert should create an mp3
Screenshots
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
I'm about to be nothing but bad news:
- 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
- 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
- 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.
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!
If you can fix this with a PR I'll for sure take a look when I get back in town. Best of luck
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.
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
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
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
This bug seems to be out of date. If you have more information, please reply here and we can look into it further.
Please try the latest version: https://github.com/rmcrackan/Libation/releases/latest
@Mbucari Your annoying packaging bug has returned
"Version":"12.0.3.2","ReleaseIdentifier":"LinuxAvalonia_Arm64"
{}2025-03-13 08:57:35.023 +00:00 [ERR] (at Dinah.Core.StepRunner.AsyncBaseStep+<RunAsync>d__2.MoveNext()) End step 'Step 2: Download Decrypted Audiobook'. FAILED. Completed in 00:00:00
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 AaxDecrypter.AaxcDownloadSingleConverter.Step_DownloadAndDecryptAudiobookAsync() in /home/runner/work/Libation/Libation/Source/AaxDecrypter/AaxcDownloadSingleConverter.cs:line 49
at Dinah.Core.StepRunner.AsyncBasicStep.RunRawAsync()
at Dinah.Core.StepRunner.AsyncBaseStep.RunAsync()
{"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])"}}2025-03-13 08:57:35.033 +00:00 [ERR] (at Dinah.Core.StepRunner.AsyncBaseStep+<RunAsync>d__2.MoveNext()) End step 'Download and Convert Aaxc To Mp3'. FAILED. Completed in 00:00:00
@Adramelech91 Whether you used the .deb or .rpm package, libation should be installed in /usr/lib/libation
can you please run 'ls' in that directory and show me the output?
I solved the problem by running this command: sudo ln -s /usr/lib/aarch64-linux-gnu/libmp3lame.so.0 /usr/lib/aarch64-linux-gnu/libmp3lame.arm64.so (This creates a symbolic link so that programs looking for libmp3lame.arm64.so will use the existing libmp3lame.so.0 library.)
Thanks for following up. I feel like I should document that little incantation but I'm not sure where.
@Adramelech91 That's very weird because the log showed it wasn't able to find ffmpegaac.arm64.so. oh well, I'm glad it works.
I was able to push a docker image for use by others
I tried to run libation on my raspberry pi and had similar problems (conversion failed). If I use your docker image, everything works fine. What did you change? @jcarletto27
EDIT: Read your other comments. would be nice to have your insides as script or a step by step guide.
regards christian