当前位置:网站首页>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
边栏推荐
- OAuth, JWT, oidc, you mess me up
- pytorch创建自己的Dataset加载数据集
- Migrate PaloAlto ha high availability firewall to panorama
- Simple understanding of flow
- B tree and b+ tree
- 卷积神经网络模型之——AlexNet网络结构与代码实现
- 【GCN-CTR】DC-GNN: Decoupled GNN for Improving and Accelerating Large-Scale E-commerce Retrieval WWW22
- Atcoder beginer contest 261e / / bitwise thinking + DP
- 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
- Excel录制宏
猜你喜欢

Atcoder beginer contest 261 f / / tree array

Introduction to web security UDP testing and defense

网络空间安全 渗透攻防9(PKI)

C#基础学习(二十三)_窗体与事件

卷积神经网络模型之——GoogLeNet网络结构与代码实现

6W+字记录实验全过程 | 探索Alluxio经济化数据存储策略

Zero basic learning canoe panel (13) -- trackbar

Atcoder beginer contest 261e / / bitwise thinking + DP

从输入网址到网页显示

并发编程 — 内存模型 JMM
随机推荐
cv2.resize函数报错:error: (-215:Assertion failed) func != 0 in function ‘cv::hal::resize‘
【GCN-RS】Region or Global? A Principle for Negative Sampling in Graph-based Recommendation (TKDE‘22)
Convolutional neural network model -- googlenet network structure and code implementation
【AI4Code】《Pythia: AI-assisted Code Completion System》(KDD 2019)
Summary of Niuke forum project deployment
Friends let me see this code
[Video] Markov chain Monte Carlo method MCMC principle and R language implementation | data sharing
Zero basic learning canoe panel (13) -- trackbar
若依如何实现用户免密登录配置方法?
Chapter5 : Deep Learning and Computational Chemistry
Word style and multi-level list setting skills (II)
Esp32-c3 is based on blinker lighting control 10 way switch or relay group under Arduino framework
程序员成长第二十七篇:如何评估需求优先级?
Shell common script: check whether a domain name and IP address are connected
工业互联网的内涵及其应用
Substance Designer 2021软件安装包下载及安装教程
Zero basic learning canoe panel (16) -- clock control/panel control/start stop control/tab control
录制和剪辑视频,如何解决占用空间过大的问题?
Docker learning - redis cluster -3 master and 3 slave - capacity expansion - capacity reduction building
Excel import and export source code analysis