buildroot里面选定ffmpeg编译,太大了,rootfs.tar 22M,16M内存放不下。

mplayer也是不行。9M多,重新编译rootfs.tar变成32M。难道要make clean再编译?

ST7789 SPI屏幕

IO按键控制

IO输出

LED驱动

参考https://whycan.com/t_5017.html

#include <dt-bindings/gpio/gpio.h>

/ {
model = "Lichee Pi Nano";
compatible = "licheepi,licheepi-nano", "allwinner,suniv-f1c100s",
     "allwinner,suniv";

aliases {
serial0 = &uart0;
spi0 = &spi0;
};

chosen {
stdout-path = "serial0:115200n8";
};

panel: panel {
compatible = "qiaodian,qd43003c0-40", "simple-panel";
#address-cells = <1>;
#size-cells = <0>;
enable-gpios = <&pio 4 6 GPIO_ACTIVE_HIGH>;

port@0 {
reg = <0>;
#address-cells = <1>;
#size-cells = <0>;

panel_input: endpoint@0 {
reg = <0>;
remote-endpoint = <&tcon0_out_lcd>;
};
};
};

reg_vcc3v3: vcc3v3 {
compatible = "regulator-fixed";
regulator-name = "vcc3v3";
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
};

leds {
compatible = "gpio-leds";

blue_led {
label = "licheepi:blue:usr";
gpios = <&pio 0 0 GPIO_ACTIVE_LOW>; /* PA0 */
};

};
};

添加上面加粗那一段,重新编译内核烧录开机

# cd /sys/class/gpio

# ls

export     gpiochip0  unexport

# chmode 777 export

-sh: chmode: not found

# chmod 777 export

# echo 1 > /sys/class/leds/licheepi\:blue\:usr/brightness

# echo 0 > /sys/class/leds/licheepi\:blue\:usr/brightness

# echo 1 > /sys/class/leds/licheepi\:blue\:usr/brightness

# echo 0 > /sys/class/leds/licheepi\:blue\:usr/brightness

#

添加触摸驱动

https://whycan.com/t_2143.html

看这个↓:

https://whycan.com/t_5897.html

tsc2007

ns2009.c

driver/input/touchscreen

linux内核目录下:

menu:

device-》input device—》touchscreen

cat /dev/input/event

buildroot里面工具测试触摸屏

tb-test

tslib

Target packages > Libraries > Hardware handling > BR2_PACKAGE_TSL

安装工具之后,使用工具

保持:

mount: you must be root

mount: you must be root

mkdir: can't create directory '/dev/pts': Permission denied

mkdir: can't create directory '/dev/shm': Permission denied

mount: you must be root

hostname: sethostname: Operation not permitted

Starting logging: OK

Initializing random number generator... done.

Starting network: ip: RTNETLINK answers: Operation not permitted

ip: SIOCSIFFLAGS: Operation not permitted

FAIL

can't open /dev/console: Permission denied

can't open /dev/console: Permission denied

can't open /dev/console: Permission denied

去掉network dhcp两项,wifi工具部分功能,重新编译文件系统。

或者用指令解压

可以登录

执行OK

  • 调试:笔记-编译LittlevGL GUI demo支持tslib 分享链接

https://whycan.com/t_2303.html

安装lrz,linjie

https://whycan.com/t_4266.html

简单说:将lrz源码目录下src中lsz、lrz放到rootfs/bin
将libc.so.0放到 rootfs/lib
 

使用MobaXterm执行lrz不能用,下载SecureCRT,设置串口COM3,波特率115200,打开终端不能输入,把串口设置RST勾取消掉可以输入。

执行lrz弹出窗口,测试发送ns2009.c发送成功。放在根目录下。

lvgl工程重新编译测试lv_demo_benchmark,while(1)前添加lv_demo_benchmark(),执行make,提示undefined benchmark();,执行make clean,再make,生成demo。

利用lrz传到开发板,效果OK。

lvgl添加触摸功能:

https://whycan.com/t_2303.html

main.c包含头文件lv_drivers/indev/evdev.h

报错 ts_setup找不到

添加 tslab共享链接库,编译通过。
lvgl 目录下Makefile:
LDFLAGS += -lts

学习LVGL

源码链接

https://www.freesion.com/article/9458654169/

源码百度网盘下载

https://pan.baidu.com/s/1KDx2Lr5rJK7K1e2B73YU4A  提取码:ns2p

Source Insight新建项目,打开源码所在位置,添加文件,打开源码,全局搜索

虽然找到了lv_test_theme_1(lv_theme_night_init(210, NULL)),但是

代码庞大,编译很多错误,还是从简单的src——》lv_demo_stress开始测试。

lv_ex_con.h打开demo_stress,make clean后make。得到demo。

解决思路:注册回调函数去处理触摸事件。

lv_obj_set_event_cb(btn, btn_event_cb);

LV_INDEV_TYPE_POINTER 类型输入设备注册之后,当有触摸事件发生时,获得触摸坐标位置

data->point.x = indev->proc.types.pointer.act_point.x;

data->point.y = indev->proc.types.pointer.act_point.y;

indev_pointer_proc中调用indev_proc_press处理触摸事件,发送按键事件

lv_event_send(indev_obj_act, LV_EVENT_PRESSED, NULL);

typedef struct _lv_indev_drv_t {

/**< Input device type*/
    lv_indev_type_t type;

/**< Function pointer to read input device data.
     * Return 'true' if there is more data to be read (buffered).
     * Most drivers can safely return 'false' */
    bool (*read_cb)(struct _lv_indev_drv_t * indev_drv, lv_indev_data_t * data);

/** Called when an action happened on the input device.
     * The second parameter is the event from `lv_event_t`*/
    void (*feedback_cb)(struct _lv_indev_drv_t *, uint8_t);

#if LV_USE_USER_DATA
    lv_indev_drv_user_data_t user_data;
#endif

/**< Pointer to the assigned display*/
    struct _disp_t * disp;

/**< Task to read the periodically read the input device*/
    lv_task_t * read_task;

/**< Number of pixels to slide before actually drag the object*/
    uint8_t drag_limit;

/**< Drag throw slow-down in [%]. Greater value means faster slow-down */
    uint8_t drag_throw;

/**< At least this difference should between two points to evaluate as gesture */
    uint8_t gesture_min_velocity;

/**< At least this difference should be to send a gesture */
    uint8_t gesture_limit;

/**< Long press time in milliseconds*/
    uint16_t long_press_time;

/**< Repeated trigger period in long press [ms] */
    uint16_t long_press_rep_time;
} lv_indev_drv_t;

MD,可以了,由于版本差异,evdev_read的形参没对应上
bool evdev_read(lv_indev_data_t * data);改为
bool evdev_read(lv_indev_drv_t * indev_drv,lv_indev_data_t * data);

复盘触摸有坐标无响应问题,开始总想在网上找到遇到相同问题的帖子,好可惜,这条路越走越窄,东西越细,资料越少,仔细阅读LittlevGL.pdf,把源代码用sourceinsight分析代码调用,代码中添加printf打印调试,看看代码是怎么跑的,最后发现输入设备中断POINTER触摸屏部分进不去,那预计是触摸输入注册部分出现问题,检测自己改动的代码部分,发现lv_indev_drv_t;里面read_cb的参数是_lv_indev_drv_t * indev_drv, lv_indev_data_t * data,而实体函数read_cb的参数是bool evdev_read(lv_indev_data_t * data);不确定是否这个问题,但这样肯定是不对的,改正之后测试正常。

Ubuntu安装中文输入法,测试lvgl是否支持中文。 https://blog.csdn.net/smart_ferry/article/details/84186835

System Settings->Language Support-》install/Remove Languages.

执行sudo apt-get install ibus-pinyin

打开终端输入

ibus-daemon -drx  然后sudo reboot

测试没有中文字库

下载LvglFontTool_V0_1.rar

存为myFont.c文件

将字库添加到工程需要一下几步:
1、将myFont.c另存为UTF-8编码格式,并复制到 lvgl/src/lv_font/  下。
2、在lvgl目录CMakeLists.txt中  lvgl/src/lv_font/lv_font_montserrat_48.c 附近添加lvgl/src/lv_font/myFont.c。
3、在 main.c 文件中声明LV_FONT_DECLARE(myFont);(也可以按照官方改lv_conf.h)。
4、在main函数前添加测试函数

void lv_font_test()
{
    LV_FONT_DECLARE(myFont);//放这里也行
    lv_obj_t* label1 = lv_label_create(lv_scr_act(), NULL);
    lv_obj_set_style_local_text_font(label1, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &myFont_6763);
    lv_obj_set_pos(label1, 20, 20);
    lv_label_set_text(label1, "Hello,你好,哇酷网!");
 
}

5、在主函数while前添加语句调用lv_font_test();
6、编译后,查看 file yourName

7、rz -y 传到板子上运行(要chmod 777 yourName)

修改了lv_conf.h,之后,需要make clean。

修改lv_font目录下lv_font。mk,后面加+=myFont.c,头文件不用改都行。

1.ST7789液晶屏

2.按键输入

3.TF卡启动

4.TF跟wifi共用

5.emwin

基于F1C100s完美运行RTX4+emWin

GPIO引脚gpio-miso = <&pio 3 3 1>;  0-A 1-B 2-C 3-D,即为PD3

ST7789

参考贴子:

https://whycan.com/t_5699.html

选型http://www.zcsd-tech.com/news/content-26.html

小型广告机。

LVGL | GUI-Guider的使用

插入图片,控件拖入图片,右边栏设置图片路径。

https://blog.csdn.net/zhengnianli/article/details/114325873

结合上述链接方法,将generated文件拷贝到lv_port_linux_frame_buffer下,修改makefile添加generated路径,修改generated目录下generated.mk,,修改gui_guide.h头文件,仿写lv_examples.mk,编译后还是为横屏。

尝试修改lv_hal_disp.crotated为1,烧录还是横屏,并且右边是黑色底。

尝试修改lv_conf.h中横竖res交换,还是横屏,只不过是正常的横屏。

sw_rotate修改为1无变化。

GUI-Guider里面使用横屏开发,下载到开发板,依然还是横屏。所以还是要在lv_port_linux_frame_buffer里面代码改。

driver->rotated          = LV_DISP_ROT_NONE;

driver->sw_rotate        = 0;

同时改1,OK,但是触摸输入法有问题。

切换成原来横屏,测试输入法正常。

LED控制,温度,速度显示。

利用wifi9800后台测试数据上传。

开机启动应用程序。

产品方案规划,自动播放视频,但是解码速度慢。

摄像头解码。

产品模块集成商。

导览器项目:输入播放视频。

配置TF卡启动

参照:https://blog.csdn.net/qq_40611389/article/details/104032286

1.获取工具链

# 获取编译器

sudo mkdir /usr/local/arm

cd /usr/local/arm

wget http://releases.linaro.org/components/toolchain/binaries/7.2-2017.11/arm-linux-gnueabi/gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabi.tar.xz

tar -vxJf gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabi.tar.xz

# 修改环境变量

sudo nano /etc/profile    (ctrl+x保存离开)

# 把它添加在最后保存退出

export PATH=$PATH:/usr/local/arm/gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabi/bin

# 安装相关库

sudo apt-get install lsb-core lib32stdc++6

# 重启,验证

arm-linux-gnueabi-gcc -v

2.编译Uboot

进入uboot目录

恢复默认配置make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- licheepi_nano_defconfig

修改Makefile:

ARCH ?= arm
CROSS_COMPILE ?= arm-linux-gnueabi-

编译:make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- -j4

编译生成u-boot-sunxi-with-spl.bin

3.TF卡分区

(参考https://whycan.com/t_547.html

1. 先编译出u-boot, Linux, dtb 文件, 用buildroot编译出根文件系统.

2. 烧录TF卡,打开gparted
1) 删除TF卡所有分区
2) 将uboot写入到sd卡8k偏移处。
    sudo dd if=u-boot-sunxi-with-spl_480800.bin of=/dev/sdb bs=1024 seek=8
3) 建立第一个分区,大小32M(可以随意填写), 格式FAT16, 把zImage, sun8i-v3s-licheepi-zero-dock.dtb拷贝到 这个分区
4) 建立第二个分区,用尽剩余空间,格式ext4, 把buildroot产生的rootfs.tar解压到该分区根目录

3. TF卡插入荔枝派Zero开发板, 插入串口, 启动

安装gparted

sudo apt  install  gparted

搜索gparted显示应用程序

插入TF卡,打开gparted,右上角选择找到TF卡盘符sde,右击delete,再新建

分好区后

第0分区时u-boot,第1分区FAT32,存放dtb和linux内核,第2分区为EXT4,存放根文件系统

# 查看sd卡

sudo fdisk -l

# 找到内存卡,我的是/dev/sdb,在下面改好(在uboot根目录下)

sudo dd if=u-boot-sunxi-with-spl.bin of=/dev/sdb bs=1024 seek=8

3.修改uboot

打开 /include/configs/suniv.h

* 添加以下代码(mmc 0为TF卡,1是第一分区,文件系统为fat32,把zImage和dtb文件拷入DRAM)*/

#define CONFIG_BOOTCOMMAND         "fatload mmc 0:1 0x80800000 zImage; "  \

"fatload mmc 0:1 0x83000000 suniv-f1c100s-licheepi-nano.dtb; " \

"bootz 0x80800000 - 0x83000000;"

/* 继续添加(linux将使用uart0进行交互,死机5s重启,根文件系统在mmc0(tf卡)第二分区(EXT4),等待 mmc 设备初始化完成以后再挂载,开启读写权限) */

#define CONFIG_BOOTARGS   "console=ttyS0,115200 panic=5 root=/dev/mmcblk0p2 rootwait rw "

/* 回到u-boot目录进行编译 */

make ARCH=arm menuconfig

/* 取消勾选 [] Enable a default value for bootcmd */

/* 勾选 [v] Enable boot arguments;*/

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- -j4

将生成的u-boot-sunxi-with-spl.bin文件再烧录到TF卡

sudo dd if=u-boot-sunxi-with-spl.bin of=/dev/sdb bs=1024 seek=8

编译dts

参考

https://blog.csdn.net/Code_MoMo/article/details/104623584?utm_medium=distribute.pc_relevant.none-task-blog-baidujs_title-0&spm=1001.2101.3001.4242

/arch/arm/boot/dts

sun8i-v3s-licheepi-zero-dock.dtb

拷到uboot盘

编译内核源码:

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- -j4

编译dtbs

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- dtbs

编译buildroot

make menuconfig

make

左边目录可以看到挂载的目录为/media/obm/ROOTFS

tar xvf rootfs.tar -C /media/obm/ROOTFS/即可解压文件

启动成功!

总结一下

分两个区就OK,uboot和roots

三步骤:

1.sudo dd if=u-boot-sunxi-with-spl.bin of=/dev/sdb bs=1024 seek=8

2.拷贝Zimages和dts到u盘uboot

3.tar 文件系统到/media/obm/ROOTFS/,具体目录可以鼠标移到盘符ROOTFS上

下一步将播放器编译进去。

buildroot里面选定target package-》audio and video application-》ffmpeg

重新编译文件系统,make

播放命令:

/usr/bin/mplayer 1.mp3

/usr/bin/mplayer -x 800 -y 480 -zoom -framedrop aa.avi

ffmpeg命令

https://blog.csdn.net/jk110333/article/details/8978328

这个工具只是音视频处理,无法播放视频

再安装这个工具:mplayer

/usr/bin/mplayer -x 800 -y 480 -zoom -framedrop 9.mp4

报错:

# # /usr/bin/mplayer -x 800 -y 480 -zoom -framedrop 9.mp4

# Creating config file: /root/.mplayer/config

yer 1.3.0-6.4.0 -sh: Creating: not found

(C) 2000-20# MPlayer 1.3.0-6.4.0 (C) 2000-2016 MPlayer Team

-sh: syntax error: unexpected "("

#

# Playing 9.mp4.

-sh: Playing: not found

# libavformat version 57.25.100 (internal)

-sh: syntax error: unexpected "("

# libavformat file format detected.

-sh: libavformat: not found

# [mov,mp4,m4a,3gp,3g2,mj2 @ 0x737a78]Protocol name not provided, cannot determi

ne if input is local or a network protocol, buffers and access patterns cannot b

e configured optimally without knowing the protocol

0x853550]deblocking-sh: [mov,mp4,m4a,3gp,3g2,mj2: not found

_filter# [h264 @ 0x853550]deblocking_filter_idc 24 out of range

-sh53550]decode_sli: [h264: not found

# [h264 @ 0x853550]decode_slice_header error

-sh: [h264: not found

# [h264 @ 0x853550]concealing 450 DC, 450 AC, 450 MV errors in I frame

-sh: [h264: not found

# [lavf] stream 0: audio (aac), -aid 0, -alang und

-sh: syntax error: unexpected "("

# [lavf] stream 1: video (h264), -vid 0

-sh: syntax error: unexpected "("

# VIDEO:  [H264]  720x480  24bpp  30.000 fps  652.1 kbps (79.6 kbyte/s)

-sh: syntax error: unexpected "("

# ==========================================================================

Opening video de-sh: ==========================================================================: not found

# Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family

> libavcodec version 57.24.102 (internal)

> Selected video codec: [ffh264] vfm: ffmpeg (FFmpeg H.264)

> ==========================================================================

> Clip info:

>  major_brand: isom

>  minor_version: 512

>  compatible_brands: isomiso2avc1mp41

>  encoder: Lavf58.12.100

> Load subtitles in ./

> ==========================================================================

> Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders

> AUDIO: 44100 Hz, 2 ch, floatle, 64.6 kbit/2.29% (ratio: 8070->352800)

> Selected audio codec: [ffaac] afm: ffmpeg (FFmpeg AAC (MPEG-2/MPEG-4 Audio))

> ==========================================================================

> AO: [oss] 44100Hz 2ch s16le (2 bytes per sample)

> Starting playback...

> [h264 @ 0x853550]deblocking_filter_idc 24 out of range

> [h264 @ 0x853550]decode_slice_header error

> [h264 @ 0x853550]concealing 450 DC, 450 AC, 450 MV errors in I frame

> Could not find matching colorspace - retrying with -vf scale...

> Opening video filter: [scale]

> [swscaler @ 0x963a18]bicubic scaler, from yuv420p to bgra using C

> VO: [fbdev] 800x480 => 800x480 BGRA  [zoom]

> Can't put VSCREENINFO: Invalid argument

-shFATAL: Cannot ini: Opening: not found

# FATAL: Cannot initialize video driver.

-sh: FATAL:: not found

# VO: [fbdev] 800x480 => 800x480 BGRA  [zoom]

-sh: VO:: not found

# Can't put VSCREENINFO: Invalid argument

> FATAL: Cannot initialize video driver.

> VO: [fbdev] 800x480 => 800x480 BGRA  [zoom]

> Can't put VSCREENINFO: Invalid argument

-sh: Cant put VSCREENINFO: Invalid argument

FATAL: Cannot initialize video driver.

VO: [fbdev] 800x480 => 800x480 BGRA  [zoom]

Cant: not found

# FATAL: Cannot initialize video driver.

-shVO: [fbdev: FATAL:: not found

# VO: [fbdev] 800x480 => 800x480 BGRA  [zoom]

Can't put VSCREENINFO: In-sh: VO:: not found

# Can't put VSCREENINFO: Invalid argument

> FATAL: Cannot initialize video driver.

> VO: [fbdev] 800x480 => 800x480 BGRA  [zoom]

> Can't put VSCREENINFO: Invalid argument

-shFATAL: Cant put VSCREENINFO: Invalid argument

FATAL: Cannot initialize video driver.

VO: [fbdev] 800x480 => 800x480 BGRA  [zoom]

Cant: not found

# FATAL: Cannot initialize video driver.

-sh: FATAL:: not found

# VO: [fbdev] 800x480 => 800x480 BGRA  [zoom]

Can't put VSCREEN-sh: VO:: not found

# Can't put VSCREENINFO: Invalid argument

> FATAL: Cannot initialize video driver.

> VO: [fbdev] 800x480 => 800x480 BGRA  [zoom]

> Can't put VSCREENINFO: Invalid argument

-sh: Cant put VSCREENINFO: Invalid argument

FATAL: Cannot initialize video driver.

VO: [fbdev] 800x480 => 800x480 BGRA  [zoom]

Cant: not found

# FATAL: Cannot initialize video driver.

-sh: FATAL:: not found

# VO: [fbdev] 800x480 => 800x480 BGRA  [zoom]

Can't pu-sh: VO:: not found

t VSCREENINFO: I# Can't put VSCREENINFO: Invalid argument

> FATAL: Cannot initialize video driver.

> VO: [fbdev] 800x480 => 800x480 BGRA  [zoom]

> Can't put VSCREENINFO: Invalid argument

-sh: Cant put VSCREENINFO: Invalid argument

FATAL: Cannot initialize video driver.

VO: [fbdev] 800x480 => 800x480 BGRA  [zoom]

Cant: not found

# FATAL: Cannot initialize video driver.

-sh: FATAL:: not found

# VO: [fbdev] 800x480 => 800x480 BGRA  [zoom]

Can't put VSCREENI-sh: VO:: not found

# Can't put VSCREENINFO: Invalid argument

> FATAL: Cannot initialize video driver.

>

> FATAL: Could not initialize video filters (-vf) or video output (-vo).

>

>

> Exiting... (End of file)

/usr/bin/mplayer 107.mp3

/usr/bin/mplayer -x 800 -y 480 -zoom -framedrop 2.avi

播放器没有解码功能?

需要配合ffmepg使用?先解码,再播放?

https://whycan.com/p_22206.html

于是指定alsa驱动:

mplayer -ao alsa /mnt/sda1/aoa.mp4

提示: No such audio driver 'alsa'

于是 mplayer -ao help :

# mplayer -ao help
MPlayer 1.3.0-6.3.1 (C) 2000-2016 MPlayer Team
Available audio output drivers:
    oss    OSS/ioctl audio output
    mpegpes    DVB audio output
    v4l2    V4L2 MPEG Audio Decoder output
    null    Null audio output
    pcm    RAW PCM/WAVE file writer audio output

于是播放mp3试试:madplay -o wave:- 1.MP3 | aplay &   竟然有声音!!!

我再看看buildroot  发现加了alsa驱动了

alsa驱动->声卡驱动

尝试把工具mencoder也编译进文件系统,

测试显示和触摸驱动是否正确,使用fb-test和ts_calibrate工具。发现触摸驱动有改动,进入内核目录,添加ns2009驱动,重新编译生成zimages。测试正常

添加声卡驱动

target-》lib-》audio/sound

bsp声卡

tinymix  contents

要看清是喇叭还是耳机

# ./tinymix set 1 63 设置声音大小
# ./tinymix set 2 1
# /usr/bin/mplayer -x 800 -y 480 -zoom aa.avi  播放频视

./ usr/bin/madplay 107.mp3

还是不行。。。。。

参照linjie操作:

https://whycan.com/t_5826.html

编译mad_player

tinyplay也应该可以

cat proc/asound/cards 查看声卡

未验证,下载源码,Makefile跟描述不一样

主线驱动不完整

bsp是全志官方的

tina3.5

make && pack 打包成烧录镜像

移植声卡驱动linux_patch失败,使用代码备份文件还原,遇错误

/usr/bin/ts_calibrate: '/usr/lib/libts.so.0' is not an ELF file

重新放置libts.so.0文件进去,还是报错

No raw modules loaded.

ts_config: No such file or directory

ts_setup: No such file or directory

判断为文件系统损坏,重新解压rootfs.tar到TF卡,解决。

I2S声卡

GT911触摸屏

将新作F1C200S,打算百分之百开源,给大家的新年礼物。 linux-5.4.77

内核源码放在环境下编译,生成镜像文件和dtb文件,放入TFuboot盘,开机可进入系统,播放音频但无声音,播放视频死机损坏了TF卡。

tinymix  contents
# ./tinymix set 1 63 设置声音大小# ./tinymix set 2 1

tinymix set 2 1

tinymix set 8 1

tinymix set 14 1

tinymix set 19 1

tinymix set 1 63

tinyplay /T004.wav

播放WAV格式文件OK,MP3文件还不行。

测试播放视频。使用mplayer

mplayer -x 800 -y 480 -zoom -framedrop badapple.avi

报错:
Can't put VSCREENINFO: Invalid argument

mplayer 在字符界面下不能用fbdev放视频?

先转码,再播放?↓

ffmpeg -re -i 16x.mkv -c:v rawvideo -pix_fmt bgra -f fbdev /dev/fb0

ffplay 或许也支持 fbdev

https://www.ffmpeg.org/ffmpeg-devices.html

4.4.2 Examples
Play a file on framebuffer device /dev/fb0. Required pixel format depends on current framebuffer settings.

ffmpeg -re -i INPUT -c:v rawvideo -pix_fmt bgra -f fbdev /dev/fb0

ffmpeg -re -i /26.mp4 -c:v rawvideo -pix_fmt bgra -f fbdev /dev/fb0

'scale' filter not present, cannot convert pixel formats.

Error reinitializing filters!

Failed to inject frame into filter network: Invalid argument

Error while processing the decoded data for stream #0:0

Conversion failed!

解决方法:
    编译时添加scale的支持:
        --enable-swscale --enable-swscale-alpha --enable-filter=scale

ffmpeg --help

是说视频显示卡对吗?这个问题是因为解码器出来是YUV数据, 转成RGB显示到LCD的, 如果驱动了2D, 就可以直接显示YUV, 显示会流畅很多.

可以考虑把MP4解码到TF卡文件,

然后用VLC播放YUV测试测试:

把mp4格式的h.264视频文件解码成NV12格式, 并使用VLC播放 / V3s 摄像头录制成NV12原始数据
http://whycan.com/t_934.html
(出处:哇酷开发者社区【全志 V3S/F1C100s/X3】)

烧录过程中发现显示屏驱动和触摸驱动没了,要在linux-5.4.77上添加驱动。

首先添加lcd驱动,linux-f1c100s-480272lcd-test/drivers/gpu/drm/panel/panel-simple.c,修改

static const struct drm_display_mode qd43003c0_40_mode = {
.clock = 33300,
.hdisplay = 800,
.hsync_start = 800 + 1,
.hsync_end = 800 + 1 + 64,
.htotal = 800 + 1 + 64 + 64,
.vdisplay = 480,
.vsync_start = 480 + 1,
.vsync_end = 480 + 1 + 23,
.vtotal = 480 + 1 + 23 + 22,
.vrefresh = 60,
};

static const struct panel_desc qd43003c0_40 = {
.modes = &qd43003c0_40_mode,
.num_modes = 1,
.bpc = 8,
.size = {
.width = 152,
.height = 91,
},
.bus_format = MEDIA_BUS_FMT_RGB888_1X24,
};

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- -j4

重新编译Zimage。

重新替换TF卡中uboot盘Zimage,进入usr/bin,执行fb-test,显示正确。

移植触摸:将NS2009.C放入

driver/input/touchscreen

makefile添加
obj-$(CONFIG_TOUCHSCREEN_NS2009) += ns2009.o

config中 TSC2007_IIO添加

config TOUCHSCREEN_NS2009

tristate "Nsiway NS2009 touchscreen"

depends on I2C

select INPUT_POLLDEV

help

Say Y here to enable Nsiway NS2009 resistive touchscreen

controller support.

If unsure, say N.

To compile this driver as a module, choose M here: the

module will be called ns2009.

suniv.dtsi中

i2c0_pins: i2c0 {

pins = "PE11", "PE12";

function = "i2c0";

};

已经一样,不用改了。

\suniv-f1c100s-licheepi-nano.dts中改为

&i2c0 {

status = "okay";

ns2009: ns2009@48 {

compatible = "nsiway,ns2009";

reg = <0x48>;

};

};

make ARCH=arm menuconfig  device-》input device—》touchscreen

选定NS2009,重新编译,显示 restart  config。

将linux-5.4.77中.config删除 rm .config,再将window中linux-5.4.77源码中.config,放入重新编译,提示输入两个Y,生成Zimage。

拷入TF,放入板子中重新启动,执行ts_calibrate,提示ts_setup: No such file or directory。

重新解压rootfs.tar到TF卡rootfs盘,还是一样。

修改内核make ARCH=arm menuconfig重新保存,提示restart config

使用make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- menuconfig

未提示,所以SPI的时候用make ARCH=arm menuconfig,TF卡用make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- menuconfig,重新编译文件树,连屏幕显示都不行了。

开机后dev目录没有input。

/dev/input/

内核版本信息在顶层Makefile文件中

lemon@ubuntu:~/Develop/OrangePi_Lite2/lichee/linux-3.10$ vim Makefile

VERSION = 3

PATCHLEVEL = 10

SUBLEVEL = 65

EXTRAVERSION =

直接解压,执行make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- menuconfig,

下载到开发板没问题,有fb0

安装xshell工具或者SecureCRT,在windows终端下敲命令行。

按上述改了linux-5.77之后,文件树那些不行。还是利用tsc2007驱动ns2009。

menu重新选tsc2007——》Y,重新编译内核,拷进fb就不行了。

还是将原来代码linux-f1c100s一步步加入音视频驱动吧。

使用对比软件,两份代码的文件。

sourceinsight 查看 linux内核源代码,add tree。

linux  4.xx内核版本移植声卡驱动有问题,还是要在linux  5.xx上搞。

测试发现,文件树suniv-f1c100s-licheepi-nano.dts后面加上

&i2c0 {
status = "okay";

ns2009: ns2009@48 {
compatible = "nsiway,ns2009";
reg = <0x48>;
};
};

显示屏就会显示错误,显示屏跟触摸冲突。对比linux-4.xx与linux-5.xx文件suniv-f1c100s.dtsi。

OK,问题解决,触摸正常,显示正常,音频

tinymix set 2 1

tinymix set 8 1

tinymix set 14 1

tinymix set 19 1

tinymix set 1 63

tinyplay /T004.wav

正常。

原因是suniv-f1c100s.dtsi中

i2c0: i2c@1c27000 {

compatible = "allwinner,sun6i-a31-i2c";

reg = <0x01c27000 0x400>;

interrupts = <7>;

clocks = <&ccu CLK_BUS_I2C0>;

resets = <&ccu RST_BUS_I2C0>;

pinctrl-names = "default";

pinctrl-0 = <&i2c0_pd_pins>;

status = "disabled";

#address-cells = <1>;

#size-cells = <0>;

};

代码备份。

显示图片buildroot里选中fbv模块,fbv /usr/1.jpg

F1C200s主线gstreamer使用openmax调用cedar硬解码

https://whycan.com/t_5824.html

f1c100s调用cedar 实现硬编码jpeg h.264

f1c100s成功运行jpeg硬解码demo,但输出还是有问题

新手玩荔枝派 f1c100s nano折腾笔记(四)相关推荐

  1. 新手玩荔枝派 f1c100s nano折腾笔记(二)

    查看文件信息 stat xxx 安装sunxi tools sudo apt install libz libusb-1.0-0-dev 报错unable  to libz 改为sudo apt in ...

  2. 新手玩荔枝派 f1c100s nano折腾笔记(三)

    应用开发篇: minimal_f1c100s-framebuffer.zip 荔枝派 nano引脚图 使用OTG功能没办法挂载U盘,插入TF卡,开机自动TF卡启动,开机后插入TF有提示,但找不到盘. ...

  3. 基于荔枝派Lichee Nano(全志f1c100s)的kernel移植(二)

    基于荔枝派Lichee Nano(全志f1c100s)的kernel移植(二) 1.获取源代码 2.linux内核修改dts设备树文件 3.内核配置修改 3.1.使用命令进入配置界面 3.2.支持jf ...

  4. 基于荔枝派Lichee Nano(全志f1c100s)的rootfs移植(三)

    基于荔枝派Lichee Nano(全志f1c100s)的rootfs移植(三) 1.下载Buildroot代码包 2.解压文件,获得源代码 3.配置Buildroot 4.编译 5.生成rootfs. ...

  5. LicheePI (荔枝派)Zero 开发笔记(3):安装 GoAhead 5.2.0 并交叉编译在 LicheePI 上运行,增加自定义 Actions

    下载源码和尝试性安装 项目开发需要,使用 Goahead 作为嵌入式 WEB 服务器.以前一直选择 Goahead,这一次也不例外.到 Goahead 主页一看,只有 GoAhead 5.2.0 呈现 ...

  6. 基于荔枝派Nano学习Buildroot的构建过程

    文章目录 0. 声明 1. 前言 2. 开发环境以及工具准备 2.1 主机系统 2.2 编译工具链 3. 构建系统Buildroot 3.1 工程配置 (1)首次构建工具链的情况 (2)使用外部工具链 ...

  7. 玩转RT-Thread之荔枝派Nano(全志F1C100S) 新手上路

    玩转RT-Thread之荔枝派Nano(全志F1C100S) 一.新手上路 --作者:燕十三(flyingcys) blog:http://blog.csdn.net/flyingcys --荔枝派n ...

  8. 荔枝派 Nano 全志 F1C100s 编译运行 Linux 笔记

    首先是荔枝派的官方文档,写的不是很细,应当说我们必须明确几点: 出厂时 SPI Flash 自带了一个 U-Boot+Linux Kernel(出厂的时候可能烧过了),可直接拿来用.如果希望自己烧固件 ...

  9. 荔枝派nano上手笔记(一)移植Uboot

    在放假前就买了荔枝派nano和zero这俩块小板子,打算寒假上手玩一下,但是赶放假看了看官方的文档发现那时的水平还不太能玩的动,那时对Linux基本不太熟悉,只会一些简单的操作,经过了快一个月的学习, ...

  10. 荔枝派 Nano 全志 F1C100s 编译运行 Linux ubuntu并升级gcc

    首先是荔枝派的官方文档,写的不是很细,应当说我们必须明确几点: 出厂时 SPI Flash 自带了一个 U-Boot+Linux Kernel(出厂的时候可能烧过了),可直接拿来用.如果希望自己烧固件 ...

最新文章

  1. C# chart控件基础使用
  2. SAP系统权限管理及参数设置
  3. python编程发展_编程的发展史及Python简介
  4. Unity5和WebGL移植指南的一些总结
  5. java编写一个集合类_Java集合类
  6. 庭审出示用户观影信息是否违法?律师表示如是举证行为 不涉及侵犯隐私
  7. LINUX 中htop的安装
  8. linux内核之进程地址空间
  9. Windows上更换鼠标指针图标
  10. 21天学通java6 pdf_21天学通Java(第6版) PDF_IT教程网
  11. ROS教程(四):RVIZ使用教程(详细图文)
  12. 解决微信支付商户平台安全控件无法启用(Mac/windows)
  13. 线程的先进先出,后进先出,以及优先级队列
  14. 使命召唤9怎么样使用计算机,玩家实测COD9 教你如何使用FXAA、TXAA
  15. 记录下公司刻录新版本/repo_kitkat 命令
  16. 数据结构----主席树
  17. arcgis加载项双击没反应
  18. 学校校园学生寝室管理查寝打分系统 毕业设计毕设源码毕业论文开题报告参考(4)网站和学生功能
  19. 计算机系举办迎新晚会简报,大学生迎新晚会简报
  20. wxPython:一曲MFC时代的挽歌,更是理想主义的绝唱

热门文章

  1. JetBrains 提供面向开发人员的免费开源字体 Mono
  2. 小爱音箱怎么装app_小爱音箱最新版本下载  小爱音箱app介绍_2113手游
  3. 九宫格拼图游戏的总结
  4. SimpleITK读取DCM文件
  5. 与时俱进的迅捷多功能转换器
  6. uni-app项目的启动
  7. 新手学习selenium路线图(老司机亲手绘制)-学前篇(转上海悠悠)
  8. 【javaEE】——synchronized使用和单例模式(线程安全)03
  9. 【电源专题】BUCK电源效率和输出电压的关系
  10. 递归算法计算二叉树中叶子结点数目 c语言,编写递归算法,计算二叉树中叶子结点的数目。...