当前位置:网站首页>The migration of arm architecture to alsa lib and alsa utils is smooth
The migration of arm architecture to alsa lib and alsa utils is smooth
2022-07-25 13:17:00 【Jiang Lin】
Catalog
introduction
- Basically transplant alsa-lib and alsa-utils The problem of transplantation can be found in this blog , If not found in the text , Please look at the difficult and miscellaneous diseases in the catalogue
- First of all, this article defaults that your root file system is guided by the network
Access to the source code
Download at https://www.alsa-project.org/main/index.php/Main_Page
The latest version is 1.2.7.2, The version used in this article is 1.2.2
Compile trial and error
- notes : There was no success here , Just slowly reproduce the pit I encountered yesterday , Tell readers how I solved these mistakes , If you want to succeed at one time, please skip the step of compiling trial and error
New folder ( The default is in the downloaded source directory )
First, you need to create some new folders , To provide our compilation results directory .
sudo mkdir /usr/share/arm-alsa
mkdir alsa-lib
mkdir alsa-utils
Decompress the package ( The default is in the downloaded source directory )
tar -xvjf alsa-lib-1.2.2.tar.bz2
tar -xvjf alsa-utils-1.2.2.tar.bz2
compile alsa-lib
cd alsa-lib-1.2.2/
/* Notice the alsa-lib Folder is what we do when we create a new folder */
./configure --host=arm-linux-gnueabihf --prefix= Source code storage directory /alsa-lib --with-configdir=/usr/share/arm-alsa
make
sudo make install

If this error occurs , Because sudo Will switch to the root Under the user , But this
when root There is no cross compiler path in the environment variable under the user , Therefore, you will be prompted that you cannot find “arm-linux-gnueabihf-gcc”, Which leads to libatopology.la Compile failed , Do as follows
sudo -s // Switch to root user
source /etc/profile // perform /etc/profile
make install // install , At this time, I have been working in root Next , So there is no need to add “sudo”
su zuozhongkai // After compilation, return to the original user
compile alsa-utils
cd alsa-utils-1.2.2/
/*
--prefix= Appoint alsa-utils Which folder is the output file in
--with-alsa-inc-prefix= because alsa-utils rely on alsa-lib, So specified alsa-lib The header directory of
--with-alsa-prefix= because alsa-utils rely on alsa-lib, So specified alsa-lib The Library Directory of
*/
./configure --host=arm-linux-gnueabihf --prefix= Source code storage directory /alsa-utils --with-alsa-inc-prefix= Source code storage directory /alsa-lib/include/ --with-alsa-prefix= Source code storage directory /alsa-lib/lib/ --disable-alsamixer --disable-xmlto
make
sudo make install
Copy alsa-lab and alsa-utils Go to the root directory of the development board
Copy alsa-lab
cd alsa-lib // Get into alsa-lib
sudo cp lib/* Root file system directory /rootfs/lib/ -af
cd /usr/share/arm-alsa // Get into arm-alsa Catalog , Copy configuration file
mkdir Root file system directory /rootfs/usr/share/arm-alsa/
sudo cp * Root file system directory /rootfs/usr/share/arm-alsa/ -raf
Copy alsa-utils
cd alsa-utils
sudo cp bin/* Root file system directory /rootfs/bin/ -rfa
sudo cp sbin/* Root file system directory //rootfs/sbin/ -rfa
sudo cp share/* Root file system directory //rootfs/usr/share/ -rfa
Open... In the root file system of the development board /etc/profile file , Add the following
export ALSA_CONFIG_PATH=/usr/share/arm-alsa/alsa.conf
Run it on the development board amixer Tool testing
amixer --help

It seems to be 32 Bit system running 64 Bit program , And the architecture is incompatible , Let's check the properties of the compiled file
cd Source code storage directory /alsa-utils/bin
file amixer
This document is for x86 Architecture compiled ?
stay ubuntu Try it on , Sure enough
./amixer --help

Get into makefile See whether the cross compilation chain is successfully configured
cd alsa-utils-1.2.2/
vi Makefile
It doesn't seem to be a problem ,host Specify normal 
Let's think about it , When we perform the installation, we use sudo make install, Because some of the generated files need to be generated in the directory protected by the system , So it must be added sudo,sudo It runs in administrator mode , Then whether our administrator mode specifies the cross compilation chain directory ? Test it
Compile successfully
sudo -s
arm-linux-gnueabihf-gcc -v
As expected, there is no , Then let's add a directory
export PATH=$PATH: Cross compile chain directory /bin
Clear the file directory just compiled
rm -rf alsa-lib/*
rm -rf alsa-utils/*
rm -rf /usr/share/arm-alsa/*
recompile alsa-lib
cd alsa-lib-1.2.2/
make clean
/* Notice the alsa-lib Folder is what we do when we create a new folder */
./configure --host=arm-linux-gnueabihf --prefix= Source code storage directory /alsa-lib --with-configdir=/usr/share/arm-alsa
make
make install
Check any output file , Sure enough ,arm framework ,32 Yes. 
compile alsa-utils
cd alsa-utils-1.2.2/
make clean
/*
--prefix= Appoint alsa-utils Which folder is the output file in
--with-alsa-inc-prefix= because alsa-utils rely on alsa-lib, So specified alsa-lib The header directory of
--with-alsa-prefix= because alsa-utils rely on alsa-lib, So specified alsa-lib The Library Directory of
*/
./configure --host=arm-linux-gnueabihf --prefix= Source code storage directory /alsa-utils --with-alsa-inc-prefix= Source code storage directory /alsa-lib/include/ --with-alsa-prefix= Source code storage directory /alsa-lib/lib/ --disable-alsamixer --disable-xmlto
make
make install

according to Copy alsa-lab and alsa-utils Go to the root directory of the development board This step copies the file , You can succeed .
Difficult miscellaneous diseases
About configure: error: No linkable libasound was found
1. If the above errors occur , First check the directory 、 Whether the command is correct
2.alsa-lib and alsa-utils Not compiled by the same user , I stepped on this pit last night , If lib It's compiled x86 Running , that alsa-utils Configuration is ok , If lib It compiles arm Architecture operation , that alsa-utils The configuration will cause this error , Keep compiling in the same user , Because the output folder may need super user mode , So keep root Compile below , And in root The user configures the cross compilation chain , For details, please refer to Compile successfully
About the board running unsuccessfully
/bin/amixer: line 1:ELF: not found
/bin/amixer: line 2: H
: not found
/bin/amixer: line 3: P: not found
/bin/amixer: line 4: syntax error: unexpected ")"
If this error is reported , There's only one possibility , The files you compile are not used by the board, but x86 The use of , stay ubuntu Found this file on ,file once , Directory is alsa-utils Compile target directory /bin/amixer, You must be the following :
Refer to Compilation success section Can solve
边栏推荐
- 为提高效率使用ParallelStream竟出现各种问题
- Blindly expanding the scale of the meta universe has deviated from the development logic of the meta universe
- 0720RHCSA
- Excel录制宏
- How to use causal inference and experiments to drive user growth| July 28 tf67
- Substance Designer 2021软件安装包下载及安装教程
- mysql函数汇总之日期和时间函数
- Docker learning - redis cluster -3 master and 3 slave - capacity expansion - capacity reduction building
- Substance designer 2021 software installation package download and installation tutorial
- pytorch创建自己的Dataset加载数据集
猜你喜欢

Cv2.resize function reports an error: error: (-215:assertion failed) func= 0 in function ‘cv::hal::resize‘

Microsoft proposed CodeT: a new SOTA for code generation, with 20 points of performance improvement

Zero basic learning canoe panel (15) -- CAPL output view

Vim技巧:永远显示行号

【CTR】《Towards Universal Sequence Representation Learning for Recommender Systems》 (KDD‘22)

Emqx cloud update: more parameters are added to log analysis, which makes monitoring, operation and maintenance easier

Zero basic learning canoe panel (12) -- progress bar

MLIR原理与应用技术杂谈

Connotation and application of industrial Internet

Esp32-c3 is based on blinker lighting control 10 way switch or relay group under Arduino framework
随机推荐
Memory layout of program
Error: cannot find or load main class XXXX
B树和B+树
Mu Changchun, data Research Institute of the central bank: controllable anonymity of digital RMB is an objective need to safeguard public interests and financial security
Programmer growth chapter 27: how to evaluate requirements priorities?
Connotation and application of industrial Internet
【CSDN 年终总结】结束与开始,一直在路上—— “1+1=王”的2021总结
Generate SQL script file by initializing the latest warehousing time of vehicle attributes
int数组获取重复数据
VIM tip: always show line numbers
程序员成长第二十七篇:如何评估需求优先级?
备战2022 CSP-J1 2022 CSP-S1 初赛 视频集
Convolutional neural network model -- googlenet network structure and code implementation
Pytorch creates its own dataset and loads the dataset
Excel录制宏
Substance Designer 2021软件安装包下载及安装教程
Shell common script: check whether a domain name and IP address are connected
[300 opencv routines] 239. accurate positioning of Harris corner detection (cornersubpix)
机器学习强基计划0-4:通俗理解奥卡姆剃刀与没有免费午餐定理
全网最简单解决方式1045-Access denied for user [email protected](using password:YES)