821586284
易百纳技术社区
易百纳技术社区
2.2w 访问量
0 原创专栏
0 资料
0 粉丝
个性签名:此E友还没有留下个性签名哦~
加入易百纳时间:2019-12-02

个人成就

易百纳技术社区 共获得 0 个点赞
易百纳技术社区 共获得 0 个收藏
易百纳技术社区 共获得 0 次评论/回复

个人勋章

暂无勋章
分类专栏

Ta擅长的领域

暂无
按发布时间
按阅读量
按点赞量
  • 一、zlib-1.2.6 gcp@gcp-virtual-machine:~/cross_compile/zlib-1.2.6$ export CC=arm-fsl-linux-gnueabi-gcc gcp@gcp-virtual-machine:~/cross_compile/zlib-1.2.6$ ./configure --prefix=$PWD/imx6_install make make install 二、libpng-1.5.6 gcp@gcp-virtual-machine:~/cross_compile/libpng-1.5.6$ ./configure --host=arm-linux CC=arm-fsl-linux-gnueabi-gcc --prefix=$PWD/imx6_install LDFLAGS=-L/home/gcp/cross_compile/zlib-1.2.6/ CPPFLAGS=-I/home/gcp/cross_compile/zlib-1.2.6/ make make install 三、jpeg-8d gcp@gcp-virtual-machine:~/cross_compile/jpeg-8d$ ./configure CC=arm-fsl-linux-gnueabi-gcc --host=arm-linux --prefix=$PWD/imx6_install make make install 四、gsnap Makefile: CC = arm-fsl-linux-gnueabi-gcc CFLAGS = -I/home/gcp/cross_compile/jpeg-8d/imx6_install/include -I/home/gcp/cross_compile/zlib-1.2.6/imx6_install/include -I/home/gcp/cross_compile/libpng-1.5.6/imx6_install/include LDFLAGS = -L/home/gcp/cross_compile/zlib-1.2.6/imx6_install/lib -L/home/gcp/cross_compile/libpng-1.5.6/imx6_install/lib -L/home/gcp/cross_compile/jpeg-8d/imx6_install/lib -lpng -ljpeg -lz targets = gsnap objs = gsnap.o all: $(targets) $(targets): $(objs) @echo "[ Building] $@" $(CC) $^ -o $@ $(LDFLAGS) %.o: %.c @echo "[GCC Compiling] $^" $(CC) $(CFLAGS) -c $^ -o $@ clean: -rm $(targets) $(objs)
    2018-01-25
    0 0 2747
  • 链接:https://pan.baidu.com/s/1c2HEEXi 密码:voay
    2017-12-18
    0 0 2487
  • 1、找不到配置文件错误 在执行configure的时候 --with-alsa-devdir=/dev/snd 这个选项需要pcm设备的位置来定,否则编译出来的库会出现找不到配置文件的问题 2、错误信息: ALSA lib pcm_direct.c:1616:(snd1_pcm_direct_parse_open_conf) The field ipc_gid must be a valid group (create group audio) 修改 alsa.conf 配置文件中的defaults.pcm.ipc_gid root选项,将其改为root 3、arecord程序找不到pcm设备 检查alsa.conf 中的 defaults.ctl.card 1 defaults.pcm.card 1 defaults.pcm.device 0 defaults.pcm.subdevice 0 与 **** List of CAPTURE Hardware Devices **** card 0: Device [PDP Audio Device], device 0: USB Audio [USB Audio] Subdevices: 1/1 Subdevice #0: subdevice #0 对应起来。
    2017-11-25
    0 0 9343
  • Start the Linux Kernel Configuration tool: make ARCH=arm CROSS_COMPILE=arm-hisiv300-linux- menuconfig Select Device Drivers from the main menu. ... ... Power management options ---> [ ] Networking support ---> Device Drivers ---> File systems ---> Kernel hacking ---> ... ... Select Sound card support as shown here ... ... Graphics support ---> <*> Sound card support ---> [*] HID Devices ---> [*] USB support ---> ... Select "Advanced Linux Sound Architecture" as shown here ... ... --- Sound card support <*> Advanced Linux Sound Architecture ---> < > Open Sound System (DEPRECATED) ---> select USB sound devices as shown here ... ... [ ] SPI sound devices ---> [*] USB sound devices ---> <*> ALSA for SoC audio support ---> ... ... Select USB Audio/MIDI driver as shown here ... ... --- USB sound devices <*> USB Audio/MIDI driver < > Edirol UA-101/UA-1000 driver ... ... This is all required for adding USB host audio support in kernel.
    2017-11-24
    0 0 2217
  • 在Linux下监控网卡的连接状态有多种方式,我想要的方式,不是以轮询方式定时查询或主动获取某个值,而是在网卡连接状态变化时我的程序能收到通知。 具体做法如下: 使用AF_NETLINK socket 绑定到RTMGRP_LINK组 等待接收RTM_NEWLINK和RTM_DELLINK类型的message 解析收到的消息中ifinfomsg结构体的ifi_flags成员是否被设置了IFF_RUNNING1. - 代码如下: #include #include #include #include #include #include #include #include #include //#include #include #include #include #include #define PRINTF(fmt, ...) printf("%s:%d: " fmt, __FUNCTION__, __LINE__, ## __VA_ARGS__) #define BUF_SIZE 4096 static int init(struct sockaddr_nl *psa); static int deinit(); static int msg_req(); static int msg_loop(struct msghdr *pmh); static void sig_handler(int sig); static int sfd = -1; int main (int argc, char *argv[]) { int ret = 0; char buf[BUF_SIZE]; struct iovec iov = {buf, sizeof(buf)}; struct sockaddr_nl sa; struct msghdr msg = {(void *)&sa, sizeof(sa), &iov, 1, NULL, 0, 0}; ret = init(&sa); if (!ret) { ret = msg_req(); } if (!ret) { ret = msg_loop(&msg); } ret = deinit(); return ret; } static int init(struct sockaddr_nl *psa) { int ret = 0; struct sigaction sigact; sigact.sa_handler = sig_handler; if (!ret && -1 == sigemptyset(&sigact.sa_mask)) { PRINTF("ERROR! sigemptyset\n"); ret = -1; } if (!ret && -1 == sigaction(SIGINT, &sigact, NULL)) { PRINTF("ERROR! sigaction SIGINT\n"); ret = -1; } if (!ret && -1 == sigaction(SIGTERM, &sigact, NULL)) { PRINTF("ERROR! sigaction SIGTERM\n"); ret = -1; } if (!ret) { sfd = socket(AF_NETLINK, SOCK_DGRAM, NETLINK_ROUTE); if (-1 == sfd) { PRINTF("ERROR! socket: %s\n", strerror(errno)); ret = -1; } } memset(psa, 0, sizeof(*psa)); psa->nl_family = AF_NETLINK; psa->nl_groups = RTMGRP_LINK; if (!ret && bind(sfd, (struct sockaddr *)psa, sizeof(*psa))) { PRINTF("ERROR! bind: %s\n", strerror(errno)); ret = -1; } if (0 != ret) { deinit(); } return ret; } static int deinit() { int ret = 0; if (-1 != sfd) { if (-1 == close(sfd)) { PRINTF("ERROR! close: %s\n", strerror(errno)); ret = -1; } sfd = -1; } return ret; } static int msg_req() { int ret = 0; struct { struct nlmsghdr nh; struct ifinfomsg ifimsg; } req; memset(&req, 0, sizeof(req)); req.nh.nlmsg_len = NLMSG_LENGTH(sizeof(struct ifinfomsg)); req.nh.nlmsg_flags = NLM_F_REQUEST | NLM_F_DUMP; req.nh.nlmsg_type = RTM_GETLINK; req.ifimsg.ifi_family = AF_UNSPEC; req.ifimsg.ifi_index = 0; req.ifimsg.ifi_change = 0xFFFFFFFF; if (-1 == send(sfd, &req, req.nh.nlmsg_len, 0)) { PRINTF("ERROR! send: %s\n", strerror(errno)); ret = -1; } return ret; } static int msg_loop(struct msghdr *pmh) { int ret = 0; ssize_t nread = -1; char *buf = (char *)(pmh->msg_iov->iov_base); struct nlmsghdr *nh; struct ifinfomsg *ifimsg; struct rtattr *rta; int attrlen; while (!ret) { nread = recvmsg(sfd, pmh, 0); if (-1 == nread) { PRINTF("ERROR! recvmsg: %s\n", strerror(errno)); ret = -1; } for (nh = (struct nlmsghdr *)buf; !ret && NLMSG_OK(nh, nread); nh = NLMSG_NEXT(nh, nread)) { if (NLMSG_DONE == nh->nlmsg_type) { break; } if (NLMSG_ERROR == nh->nlmsg_type) { PRINTF("ERROR! NLMSG_ERROR\n"); ret = -1; } if (!ret && (RTM_NEWLINK == nh->nlmsg_type || RTM_DELLINK == nh->nlmsg_type)) { ifimsg = (struct ifinfomsg *)NLMSG_DATA(nh); if (ARPHRD_LOOPBACK != ifimsg->ifi_type) { attrlen = nh->nlmsg_len - NLMSG_LENGTH(sizeof(struct ifinfomsg)); for (rta = IFLA_RTA(ifimsg); RTA_OK(rta, attrlen) && rta->rta_type <= IFLA_MAX; rta = RTA_NEXT(rta, attrlen)) { if (IFLA_IFNAME == rta->rta_type) { printf("%s: ", (char*)RTA_DATA(rta)); } } if (IFF_RUNNING & ifimsg->ifi_flags) printf("link up\n"); else printf("link down\n"); } } } } return ret; } static void sig_handler(int sig) { exit(deinit()); }
    2017-11-23
    0 0 2323
  • 假设我们定义了一个变量为: file=/dir1/dir2/dir3/my.file.txt 可以用${ }分别替换得到不同的值: ${file#*/}:删掉第一个 / 及其左边的字符串:dir1/dir2/dir3/my.file.txt ${file##*/}:删掉最后一个 / 及其左边的字符串:my.file.txt ${file#*.}:删掉第一个 . 及其左边的字符串:file.txt ${file##*.}:删掉最后一个 . 及其左边的字符串:txt ${file%/*}:删掉最后一个 / 及其右边的字符串:/dir1/dir2/dir3 ${file%%/*}:删掉第一个 / 及其右边的字符串:(空值) ${file%.*}:删掉最后一个 . 及其右边的字符串:/dir1/dir2/dir3/my.file ${file%%.*}:删掉第一个 . 及其右边的字符串:/dir1/dir2/dir3/my` 也可以对变量值里的字符串作替换: ${file/dir/path}:将第一个dir 替换为path:/path1/dir2/dir3/my.file.txt ${file//dir/path}:将全部dir 替换为 path:/path1/path2/path3/my.file.txt`
    2017-11-22
    0 0 2796
易百纳技术社区
共6条
易百纳技术社区