我试图在C2上编译Linux内核,并使用媒体_构建安装DVB驱动程序。我遵循了官方维基和论坛上描述的步骤。根据论坛的说法,如果我想要使用支持的Device Drivers -> Amlogic Device Drivers -> Multimedia Support DVB-T驱动程序,就有必要将media_build编译成模块。
首先,我获得了Linux源代码:
git clone --depth 1 https://github.com/hardkernel/linux.git -b odroidc2-3.14.y然后设置Odroid C2的配置:
make odroidc2_defconfig最后,我遵循了内核编译和禁用V4L依赖的步骤,如下所示:
$make menuconfig
Device Drivers
Amlogic Device Drivers
ION Support
ION memory management support = no
Amlogic ion video support
videobuf2-ion video device support = no
Amlogic ion video devic support = no
V4L2 Video Support
Amlogic v4l video device support = no
Amlogic v4l video2 device support = no
Amlogic Camera Support
Amlogic Platform Capture Driver = no
Multimedia support = m这个配置编译时没有错误,然后我可以编译和安装media_build驱动程序。问题是,使用这种配置,Odroid C2无法通过硬件解码在Kodi中播放视频文件。我的印象是,我禁用了一个依赖,这是必要的非逻辑硬件解码。我试图修改配置,并将以前禁用的所有依赖项标记为模块。不幸的是,使用此配置,无法编译内核,编译失败时出现以下错误:
drivers/built-in.o: In function `v4l2_device_release':
odroid-battery.c:(.text+0x1731c0): undefined reference to
`media_device_unregister_entity'
odroid-battery.c:(.text+0x1731c0): relocation truncated to fit:
R_AARCH64_CALL26 against undefined symbol `media_device_unregister_entity'
drivers/built-in.o: In function `__video_register_device':
odroid-battery.c:(.text+0x173c4c): undefined reference to
`media_device_register_entity'
odroid-battery.c:(.text+0x173c4c): relocation truncated to fit:
R_AARCH64_CALL26 against undefined symbol `media_device_register_entity'
drivers/built-in.o: In function `v4l2_device_register_subdev':
odroid-battery.c:(.text+0x1797b0): undefined reference to
`media_device_register_entity'
odroid-battery.c:(.text+0x1797b0): relocation truncated to fit:
R_AARCH64_CALL26 against undefined symbol `media_device_register_entity'
drivers/built-in.o: In function `v4l2_device_unregister_subdev':
odroid-battery.c:(.text+0x179a58): undefined reference to
`media_entity_remove_links'
odroid-battery.c:(.text+0x179a58): relocation truncated to fit:
R_AARCH64_CALL26 against undefined symbol `media_entity_remove_links'
odroid-battery.c:(.text+0x179a60): undefined reference to
`media_device_unregister_entity'
odroid-battery.c:(.text+0x179a60): relocation truncated to fit:
R_AARCH64_CALL26 against undefined symbol `media_device_unregister_entity'
drivers/built-in.o: In function `subdev_close':
odroid-battery.c:(.text+0x180c10): undefined reference to `media_entity_put'
odroid-battery.c:(.text+0x180c10): relocation truncated to fit:
R_AARCH64_CALL26 against undefined symbol `media_entity_put'
drivers/built-in.o: In function `subdev_open':
odroid-battery.c:(.text+0x1814f4): undefined reference to `media_entity_get'
odroid-battery.c:(.text+0x1814f4): relocation truncated to fit:
R_AARCH64_CALL26 against undefined symbol `media_entity_get'
odroid-battery.c:(.text+0x181540): undefined reference to `media_entity_put'
odroid-battery.c:(.text+0x181540): relocation truncated to fit:
R_AARCH64_CALL26 against undefined symbol `media_entity_put'
Makefile:831: recipe for target 'vmlinux' failed
make: *** [vmlinux] Error 1我如何编译内核的多媒体支持作为模块,但仍然能够使用硬件解码的视频文件?
发布于 2018-02-18 14:39:01
我终于成功了。我用脚本、补丁和指令创建了一个git存储库。如果有人也在处理这个问题,请克隆这个储存库并执行以下步骤(这些步骤在存储库中的自述文件中也有描述):
克隆硬内核Linux存储库
git clone --depth 1 https://github.com/hardkernel/linux.git -b odroidc2-3.14.y
cd linux应用补丁程序,它允许您将aml视频驱动程序编译为一个模块(我从LibreELEC媒体_构建版开始执行此步骤)
patch -p1 < ../odroidC2-kernel/allow_amlvideodri_as_module.patch应用默认的Odroid C2配置
make odroidc2_defconfig现在修改配置
make menuconfig并设置以下值(按Y键选择,N键删除,M键选择它作为模块)
Device Drivers
Amlogic Device Drivers
ION Support
ION memory management support = Yes
Amlogic ion video support
videobuf2-ion video device support = M
Amlogic ion video devic support = no
V4L2 Video Support
Amlogic v4l video device support = M
Amlogic v4l video2 device support = no
Amlogic Camera Support
Amlogic Platform Capture Driver = no
Multimedia support = M编译内核
make -j5 LOCALVERSION=""LOCALVERSION参数只是为了避免内核名称中的"+“符号。编译成功后,安装模块、内核并重新启动系统。
sudo make modules_install
sudo cp -f arch/arm64/boot/Image arch/arm64/boot/dts/meson64_odroidc2.dtb /media/boot/
sudo sync
sudo reboot克隆media_build存储库并尝试构建它。
git clone https://git.linuxtv.org/media_build.git
cd media_build
./build构建命令可能失败。忽略此错误并继续执行以下步骤。下面的脚本也是受LibreELEC媒体_构建版启发的,它只将视频驱动程序包含到媒体模块中。
../odroidC2-kernel/add_video_driver_module.sh为了避免编译中可能出现的问题,请尝试禁用远程控制器支持和所有不需要的USB适配器。试着跑:
make menuconfig这可能会导致类似于以下错误的错误:
./Kconfig:694: syntax error
./Kconfig:693: unknown option "Enable"
./Kconfig:694: unknown option "which"您需要编辑文件v4l/Kconfig并与错误中打印的行对齐。这些线需要与前面的线对齐。然后,再次运行make menuconfig。可能,您需要多次执行此步骤。
如果您看到的是菜单而不是错误,则可以通过以下方式修改配置:
Remote Controller support = no
Multimedia support
Media USB Adapters
## Disable all driver you don't need ##应用以下修补程序
patch -p1 < ../odroidC2-kernel/warning.patch进行以下更改以避免错误并编译内核
sed -i 's/#define NEED_PM_RUNTIME_GET 1/\/\/#define NEED_PM_RUNTIME_GET 1/g' v4l/config-compat.h
make -j5可能,您需要在成功之前多次运行前一步( sed和make)。
编译后,安装模块并重新启动系统。
sudo make install
sudo reboot最后一步是将amlvideodri模块添加到/etc/modules中,使其在引导时加载。
sudo echo "amlvideodri" >> /etc/modules就这样。您现在可以享受您的DVB-T电视和HW加速视频在科迪.
https://unix.stackexchange.com/questions/417074
复制相似问题