Installing FLAC 1.3.2 on ADM 3.5

Who doesn't love third-party apps? Get together and talk about them here.

Moderator: Lillian.W@AST

Post Reply
ChurchOfSlack
Posts: 3
youtube meble na wymiar Warszawa
Joined: Sat Feb 27, 2021 9:19 am

Installing FLAC 1.3.2 on ADM 3.5

Post by ChurchOfSlack »

I'm doing various types of Python3 dev and working with music (beets for example). I needed to have the flac library on my NAS and I didn't see package for it on the installer. So I took a chance on installing it and got it to run. Here is the step-by-step on how I got it working (from the shell). What I did on my system was not very risky for me but be aware that I was one bad command away from trashing my system the whole way. If you can't do exactly what I did for some reason and don't know how to adapt the process to your system, get advice or be prepared to restore from backups.

Good luck

1. make sure you have ssh set up so you can login to your NAS. I'm logging in as root because I am overconfident, have 20+ years as a sysadm and have already done all the palm-plant stuff that is called 'experience'. If you're not as dumb as me, you should log in on a user account and sudo the root commands which are needed. You have been warned!
2. In your login home dir, create a working directory. I called mine 'flac' because I am a bear of very little brain. But you don't need to be a slave to fashion.
Also check your login shell path with 'echo $PATH'. Mine is "/opt/sbin:/opt/bin:/sbin:/usr/sbin:/bin:/usr/bin:/usr/builtin/sbin:/usr/builtin/bin:/usr/local/sbin:/usr/local/bin:/opt/sbin:/opt/bin:/usr/local/AppCentral/python3/bin".
If yours has more that's fine but if it has less, you might need to add to it so you can type 'flac' and the command runs.
Don't add stuff at random, get some advice on what you need from someone with experience.
3. From here on out, if you're not logged in as root, you'll need to sudo the commands which are refused by the system.
4. run 'uname -m' to get your system architecture. Mine is 'x86-64'. I need deb packages for 'amd64'. If you system
architecture is different, don't blindly use 'amd64' packages. Figure out what the correct package type is for your
architecture. I didn't include a cross-ref for all system architectures and deb package types. Moving on...
5. from your working directory:
curl -O http://ftp.us.debian.org/debian/pool/ma ... _amd64.deb
curl -O http://ftp.us.debian.org/debian/pool/ma ... _amd64.deb
NOTE: I flailed around at https://packages.debian.org to get these links. If you need a different flac version or package
architecture, you can go there to find it. Use a stable version. Make sure you get both the flac and libflac packages.
5. ASUS uses busybox instead of a full set of utilities. But you should have the '7z' command. Try '7z -h' and see if you
get a help list. If not, I got nuthin. You need to unpack the deb files and the only command that did it on my machine was
the '7z' command. Hopefully it worked for you. If so, next step.
6. We're going to unpack the deb packages one at a time. This is important. Unpacking takes two steps and
to avoid confusion, I'm assuming some things. So one at a time.
7. Type '7z e <first package>' I don't know the name so you'll have to pick one and type it in. This will result
in a new file called 'data.tar'. Type '7z e data.tar'. This will get you a bunch of stuff. But you only need
one file and it will be either 'flac' or 'libFLAC.so.8.x.x' (x.x are numbers. Doesn't matter what they are
and they'll change over time). Make sure you have one or the other. When you've found one of them,
delete the data.tar file with 'rm data.tar'.
8. Now do the same thing with the OTHER deb file: '7z e <second package>'. '7z e data.tar'.
You should now have both the flac file and the libFLAC.so.8.x.x file.
9. Verify some things:
[*]'ls /var/local/bin'
this should list programs from packages you have installed. If you installed python or ffmpeg, you should see them here. If not you'll need help figuring out where to copy the flac command.
[*]'ls /etc/ld.so.conf.d'
this should show libext.conf
[*]'cat /etc/ld.so.conf.d/libext.conf'
contents should include /usr/local/lib. If not get advice on where to put the flac shared lib
10. 'cp flac /var/local/bin'
11. 'cp libFLAC.so.8.x.x /usr/local/lib'
12. 'ln -s /usr/local/lib/libFLAC.so.8.x.x /usr/local/lib/libFLAC.so.8' This makes a soft link to the actual
shared lib file. When packages get bug fixes and stuff over time, this technique makes it easier to do
upgrades. The flac program looks for the libFLAC.so.8 file and we point it to whatever the latest
version of it is. If we were using a package manager, this would be done for us but we're not.
13. 'ldconfig -v' This refreshes the library lookup cache. Installing the files doesn't mean they'll be found
when the time comes. We need this command.
14. Now you should be able to type 'flac' and get the help output. When it works, you can delete the working directory you created and all the files in it.

Troubleshooting:
1. Verify the deb package and system architecture match. Most likely if that's the problem you'll get an unexecutable
error of some type but you could get a hang or system crash. Don't repeat hangs or system crashes for troubleshooting!!
2. If you get command not found type errors, check files are where you put them and permissions are correct. root
will execute owner permissions but if you execute as a user it will probably be the general permissions, not group
permissions. 'chown' and 'chmod' are your friends here. Also double check your path. Can you execute other files
in the same directory? Compare the file permissions.
3. Did you do the ldconfig -v thingie in step 13?
User avatar
father.mande
Posts: 1807
Joined: Sat Sep 12, 2015 2:55 am
Location: La Rochelle (France)

Re: Installing FLAC 1.3.2 on ADM 3.5

Post by father.mande »

Hi,
Thanks and good job ... BUT ... flac 1.3.3 is enough for you ...
flac is available natively through Entware APKG (+2500 packages)

Code: Select all

 # opkg list | grep flac
flac - 1.3.3-1 - flac & metaflac utilities
libflac - 1.3.3-1 - Free Lossless Audio Codec library
mpc - 0.33-1 - MPD is a music player supporting flac, mp3 and ogg files. It is typically controlled over a network using one of it's many clients including mpc(console), gmpc(gnome), phpmp(php) etc. this is MPC
squeezelite-full - 1.9.6-1210-3 - Squeezelite is a small headless squeezebox emulator for linux using alsa audio output It is aimed at supporting high quality audio at multiple sample rates including 44.1/48/88.2/96/176.4/192k/352.8/384kHz Supported codecs: mp3, flac, ogg, aac, (wma and alac via ffmpeg) Native support for PCM builtin Optional support of DSD playback via PCM for DoP capable DAC Optional resampling to match sound device  This package has all the audio codecs compiled in.
[/volume1/.@root] #
Install is in a terminal under root /your_admin_password :
opkg update
opkg install flac

Update / Upgrade is automatically managed (thru opkg the Entware package manager) generally one time per month for updated packaged.

N.B. Entware APKG is available for ALL Asustor platform
Philippe.
AS6602T / AS5202T /AS5002T / AS1002T / FS6706T
Post Reply

Return to “Developer's Corner”