4387|3

5

帖子

0

TA的资源

一粒金砂(中级)

楼主
 

DE1SOC Linux系统 支持图像和音频 [复制链接]

本帖最后由 nolnew 于 2017-8-15 10:58 编辑

DE1SOC Linux系统 支持图像和音频

实验目的:友晶官方给的硬件工程只包括了VGA的显示逻辑,不包括音频的部分。本文主要参考github上的一个音频例程,在其基础上添加VGA显示系统,实现一个音视频系统。(之前一直放在github上,现在论坛分享给大家,不足之处还请包涵)
实验内容:为方便大家使用,在此之前,已完成了硬件工程添加VGA的部分和在linux内核中添加音视频驱动,以及设备树的修改,这里只用下载编译即可使用。
时间:2017年1月11
作者:knat
实验环境:ubuntu 16.04(也可以在win10 linux子系统下操作)

实验步骤如下:

从GitHub上下载硬件工程和Linux的源代码.
1.硬件工程
     git clone  
链接已隐藏,如需查看请登录或者注册

2.Linux源代码
   git clone
链接已隐藏,如需查看请登录或者注册

   cd linux-socfpga
   git checkout -b de1soc_audio origin/socfpga-3.17_audio
注:需要安装git,教育网下载速度可能会快些。

编译硬件工程
在linux上安装quartus可以参考.USB Blaster II on LinuxInstalling DS-5 on "Unsupported" Linux Distros
也可直接在windos 下编译,操作步骤一致。打开硬件工程后按如下操作
1.add the 'ip/i2s' Path to the ip library in QsysOpen the Hardware project in de1soc_media
[mw_shl_code=bash,false]Open Qsys-->Tools-->IP Search Path-->Add,add the 'xxxx/ip/i2s' path[/code]
2.Compile the Qsys
[mw_shl_code=bash,false]Open the soc_system.qsys,Click 'Generate HDL'       [/code]
3.Compile project
[mw_shl_code=bash,false]Click the 'Start Compilation'[/code]
4.Convert programming files,in shell run the command
[mw_shl_code=bash,false]quartus_cpf -c DE1_SOC_Linux_Audio.sof soc_system.rbf[/code]
need the "quartus_cpf" path in PATH environment

生成 uboot.img 和 PreloaderWithHeader.img

1.run altera embedded command shell
[mw_shl_code=bash,false]~/altera/14.1/embedded/embedded_command_shell.sh[/code]
2.Generate Bsp and Uboot
[mw_shl_code=bash,false]bsp-editor&[/code]
According to the steps Generating and Compiling the Preloader
3.make bsp and uboot
cd to 'project path'/software/spl_bsp/
[mw_shl_code=bash,false]make -j4[/code]
cd to'project path'/software/spl_bsp/uboot-socfpga/
[mw_shl_code=bash,false]make[/code]
4.generate preloader_with_header.img
copy the u-boot-spl.bin form 'software/spl_bsp/uboot-socfpga/spl' to 'software/spl_bsp'
cd to 'project path'/software/spl_bsp/
[mw_shl_code=bash,false]mkpimage -o preloader_with_header.img u-boot-spl.bin -hv 0[/code]

Image
path
Description
preloader_with_header.img
software/spl_bsp
preloader
u-boot.img
software/spl_bsp/uboot-socfpga
u-boot

更新 SD卡的 uboot

Write Terasic de1soc_ubuntu_1604.img to SD Cardon Linux PC,Check which disk is your SD card.Change the sdX according to your situation.
先将上述的官方镜像写到SD卡,然后再将uboot更新,更新步骤如下:
[mw_shl_code=bash,false]sudo dd if=preloader_with_header.img of=/dev/sdX3 bs=64k seek=0
sudo dd if=u-boot.img of=/dev/sdX3 bs=64k seek=4
sudo sync[/code]
注:dd貌似在win下支持的不太好,建议该步骤在linux下操作

将编译环境添加到环境变量
about Path environment,Write the following to env.sh file,change paths for your situation.
#!/bin/bash
export ARCH=arm
export CROSS_COMPILE=/home/tank/app/gcc-linaro-arm-linux-gnueabihf-4.9-xxxxxxxx/bin/arm-linux-gnueabihf-export LOADADDR=0x8000
export PATH=$PATH:/home/tank/app/gcc-linaro-arm-linux-gnueabihf-4.9-xxxxxxxx/bin
编译zImage 和 Device Tree
[mw_shl_code=bash,false]source env.sh[/code]
cd to linux-socfpga
[mw_shl_code=bash,false]cp Linux_config .config
make zImage
make socfpga_audio.dtb[/code]

将 rbf zImage dtb拷贝到SD卡的FAT分区
Image
rename
Description
zImage
zImage

socfpga_audio.dtb
socfpga.dtb

soc_system.rbf
soc_system.rbf


在 DE1_SOC 上使用软件 alsamixer 选择音频的 Line out
on DE1_SOC run alsamixer
use "M" to change the Output Line to DE1_SOC HIFI ,then
[mw_shl_code=bash,false]aplay jouHisaishi.wav[/code]
此帖出自FPGA/CPLD论坛

最新回复

你好,我按照你说的试了试,下载了内核3.17后没找到i2s驱动在哪里?wm8731驱动在哪里?麻烦指点指点小弟,谢谢了  详情 回复 发表于 2019-1-22 15:49
点赞 关注
 

回复
举报

82

帖子

0

TA的资源

一粒金砂(中级)

沙发
 
厉害呀,前排留名
此帖出自FPGA/CPLD论坛
 
 

回复

1

帖子

0

TA的资源

一粒金砂(初级)

板凳
 
你好,我按照你说的试了试,下载了内核3.17后没找到i2s驱动在哪里?wm8731驱动在哪里?麻烦指点指点小弟,谢谢了
此帖出自FPGA/CPLD论坛
 
 
 

回复

5

帖子

0

TA的资源

一粒金砂(中级)

4
 
haozpfhao 发表于 2019-1-22 15:49
你好,我按照你说的试了试,下载了内核3.17后没找到i2s驱动在哪里?wm8731驱动在哪里?麻烦指点指点小弟, ...

链接已隐藏,如需查看请登录或者注册


在sound/soc/de1_soc_audio/下
此帖出自FPGA/CPLD论坛
 
 
 

回复
您需要登录后才可以回帖 登录 | 注册

随便看看
查找数据手册?

EEWorld Datasheet 技术支持

相关文章 更多>>
关闭
站长推荐上一条 1/6 下一条

 
EEWorld订阅号

 
EEWorld服务号

 
汽车开发圈

About Us 关于我们 客户服务 联系方式 器件索引 网站地图 最新更新 手机版

站点相关: 国产芯 安防电子 汽车电子 手机便携 工业控制 家用电子 医疗电子 测试测量 网络通信 物联网

北京市海淀区中关村大街18号B座15层1530室 电话:(010)82350740 邮编:100190

电子工程世界版权所有 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号 Copyright © 2005-2025 EEWORLD.com.cn, Inc. All rights reserved
快速回复 返回顶部 返回列表