На самом деле звук на платах с Allwinner A20, по идее, поддерживается ещё с ядра 4.4. Только вот поддерживается ли оно на конкретной плате — это зависит исключительно от активности мейнтейнеров конкретной платы. Вот мне не повезло: изменения относительно моей платы вносятся только по случаю глобальных перемен, не массовая она. Не то, что Banana Pi или Cubieboard’ы.

Короче, для решения моей проблемы надо всего ничего, — поправить devicetree. Для начала нужны исходники ядра, их можно (и логично) взять с kernel.org. Качайте позднюю редакцию той же основной версии, что и у ядра, установленного в ОС. Так для Debian’овского 4.9.0-3-armmp, я возьму 4.9.34. Распакуйте это, отредактируйте devicetree вашей платы, скомпилируйте и загружайте плату с ним.

Листинг подготовки devicetree:

aliech@fomalhaut:/mnt/build$ wget https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.9.34.tar.xz
--2017-06-25 03:37:01--  https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.9.34.tar.xz
Распознаётся cdn.kernel.org (cdn.kernel.org)… 151.101.84.69
Подключение к cdn.kernel.org (cdn.kernel.org)|151.101.84.69|:443... соединение установлено.
HTTP-запрос отправлен. Ожидание ответа… 200 OK
Длина: 93162840 (89M) [application/x-xz]
Сохранение в: «linux-4.9.34.tar.xz»

linux-4.9.34.tar.xz 100%[===================>]  88,85M  5,46MB/s    in 17s     

2017-06-25 03:37:18 (5,34 MB/s) - «linux-4.9.34.tar.xz» сохранён [93162840/93162840]

aliech@fomalhaut:/mnt/build$ tar xf linux-4.9.34.tar.xz 
aliech@fomalhaut:/mnt/build$ cd linux-4.9.34/
aliech@fomalhaut:/mnt/build/linux-4.9.34$ vim arch/arm/boot/dts/sun7i-a20-bananapro.dts 
aliech@fomalhaut:/mnt/build/linux-4.9.34$ make sunxi_defconfig
  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/kconfig/conf.o
  SHIPPED scripts/kconfig/zconf.tab.c
  SHIPPED scripts/kconfig/zconf.lex.c
  SHIPPED scripts/kconfig/zconf.hash.c
  HOSTCC  scripts/kconfig/zconf.tab.o
  HOSTLD  scripts/kconfig/conf
#
# configuration written to .config
#
aliech@fomalhaut:/mnt/build/linux-4.9.34$ make dtbs
  CHK     include/config/kernel.release
  CHK     include/generated/uapi/linux/version.h
  CHK     include/generated/utsrelease.h
  HOSTCC  scripts/basic/fixdep
  GEN     include/generated/mach-types.h
  CC      kernel/bounds.s
  CHK     include/generated/bounds.h
  CHK     include/generated/timeconst.h
  UPD     include/generated/timeconst.h
  CC      arch/arm/kernel/asm-offsets.s
  CHK     include/generated/asm-offsets.h
  UPD     include/generated/asm-offsets.h
  CALL    scripts/checksyscalls.sh
  HOSTCC  scripts/dtc/dtc.o
  HOSTCC  scripts/dtc/flattree.o
  HOSTCC  scripts/dtc/fstree.o
  HOSTCC  scripts/dtc/data.o
  HOSTCC  scripts/dtc/livetree.o
  HOSTCC  scripts/dtc/treesource.o
  HOSTCC  scripts/dtc/srcpos.o
  HOSTCC  scripts/dtc/checks.o
  HOSTCC  scripts/dtc/util.o
  SHIPPED scripts/dtc/dtc-lexer.lex.c
  SHIPPED scripts/dtc/dtc-parser.tab.h
  HOSTCC  scripts/dtc/dtc-lexer.lex.o
  SHIPPED scripts/dtc/dtc-parser.tab.c
  HOSTCC  scripts/dtc/dtc-parser.tab.o
  HOSTLD  scripts/dtc/dtc
  CC      scripts/mod/empty.o
  HOSTCC  scripts/mod/mk_elfconfig
  MKELF   scripts/mod/elfconfig.h
  HOSTCC  scripts/mod/modpost.o
  CC      scripts/mod/devicetable-offsets.s
  GEN     scripts/mod/devicetable-offsets.h
  HOSTCC  scripts/mod/file2alias.o
  HOSTCC  scripts/mod/sumversion.o
  HOSTLD  scripts/mod/modpost
  HOSTCC  scripts/kallsyms
  HOSTCC  scripts/conmakehash
  HOSTCC  scripts/sortextable
  DTC     arch/arm/boot/dts/sun4i-a10-a1000.dtb
  DTC     arch/arm/boot/dts/sun4i-a10-ba10-tvbox.dtb
  DTC     arch/arm/boot/dts/sun4i-a10-chuwi-v7-cw0825.dtb
  DTC     arch/arm/boot/dts/sun4i-a10-cubieboard.dtb
  DTC     arch/arm/boot/dts/sun4i-a10-dserve-dsrv9703c.dtb
  DTC     arch/arm/boot/dts/sun4i-a10-gemei-g9.dtb
  DTC     arch/arm/boot/dts/sun4i-a10-hackberry.dtb
  DTC     arch/arm/boot/dts/sun4i-a10-hyundai-a7hd.dtb
  DTC     arch/arm/boot/dts/sun4i-a10-inet1.dtb
  DTC     arch/arm/boot/dts/sun4i-a10-inet97fv2.dtb
  DTC     arch/arm/boot/dts/sun4i-a10-inet9f-rev03.dtb
  DTC     arch/arm/boot/dts/sun4i-a10-itead-iteaduino-plus.dtb
  DTC     arch/arm/boot/dts/sun4i-a10-jesurun-q5.dtb
  DTC     arch/arm/boot/dts/sun4i-a10-marsboard.dtb
  DTC     arch/arm/boot/dts/sun4i-a10-mini-xplus.dtb
  DTC     arch/arm/boot/dts/sun4i-a10-mk802.dtb
  DTC     arch/arm/boot/dts/sun4i-a10-mk802ii.dtb
  DTC     arch/arm/boot/dts/sun4i-a10-olinuxino-lime.dtb
  DTC     arch/arm/boot/dts/sun4i-a10-pcduino.dtb
  DTC     arch/arm/boot/dts/sun4i-a10-pcduino2.dtb
  DTC     arch/arm/boot/dts/sun4i-a10-pov-protab2-ips9.dtb
  DTC     arch/arm/boot/dts/sun5i-a10s-auxtek-t003.dtb
  DTC     arch/arm/boot/dts/sun5i-a10s-auxtek-t004.dtb
  DTC     arch/arm/boot/dts/sun5i-a10s-mk802.dtb
  DTC     arch/arm/boot/dts/sun5i-a10s-olinuxino-micro.dtb
  DTC     arch/arm/boot/dts/sun5i-a10s-r7-tv-dongle.dtb
  DTC     arch/arm/boot/dts/sun5i-a10s-wobo-i5.dtb
  DTC     arch/arm/boot/dts/sun5i-a13-difrnce-dit4350.dtb
  DTC     arch/arm/boot/dts/sun5i-a13-empire-electronix-d709.dtb
  DTC     arch/arm/boot/dts/sun5i-a13-empire-electronix-m712.dtb
  DTC     arch/arm/boot/dts/sun5i-a13-hsg-h702.dtb
  DTC     arch/arm/boot/dts/sun5i-a13-inet-98v-rev2.dtb
  DTC     arch/arm/boot/dts/sun5i-a13-olinuxino.dtb
  DTC     arch/arm/boot/dts/sun5i-a13-olinuxino-micro.dtb
  DTC     arch/arm/boot/dts/sun5i-a13-q8-tablet.dtb
  DTC     arch/arm/boot/dts/sun5i-a13-utoo-p66.dtb
  DTC     arch/arm/boot/dts/sun5i-gr8-evb.dtb
  DTC     arch/arm/boot/dts/sun5i-r8-chip.dtb
  DTC     arch/arm/boot/dts/sun6i-a31-app4-evb1.dtb
  DTC     arch/arm/boot/dts/sun6i-a31-colombus.dtb
  DTC     arch/arm/boot/dts/sun6i-a31-hummingbird.dtb
  DTC     arch/arm/boot/dts/sun6i-a31-i7.dtb
  DTC     arch/arm/boot/dts/sun6i-a31-m9.dtb
  DTC     arch/arm/boot/dts/sun6i-a31-mele-a1000g-quad.dtb
  DTC     arch/arm/boot/dts/sun6i-a31s-colorfly-e708-q1.dtb
  DTC     arch/arm/boot/dts/sun6i-a31s-cs908.dtb
  DTC     arch/arm/boot/dts/sun6i-a31s-inet-q972.dtb
  DTC     arch/arm/boot/dts/sun6i-a31s-primo81.dtb
  DTC     arch/arm/boot/dts/sun6i-a31s-sina31s.dtb
  DTC     arch/arm/boot/dts/sun6i-a31s-sinovoip-bpi-m2.dtb
  DTC     arch/arm/boot/dts/sun6i-a31s-yones-toptech-bs1078-v2.dtb
  DTC     arch/arm/boot/dts/sun7i-a20-bananapi.dtb
  DTC     arch/arm/boot/dts/sun7i-a20-bananapi-m1-plus.dtb
  DTC     arch/arm/boot/dts/sun7i-a20-bananapro.dtb
  DTC     arch/arm/boot/dts/sun7i-a20-cubieboard2.dtb
  DTC     arch/arm/boot/dts/sun7i-a20-cubietruck.dtb
  DTC     arch/arm/boot/dts/sun7i-a20-hummingbird.dtb
  DTC     arch/arm/boot/dts/sun7i-a20-itead-ibox.dtb
  DTC     arch/arm/boot/dts/sun7i-a20-i12-tvbox.dtb
  DTC     arch/arm/boot/dts/sun7i-a20-icnova-swac.dtb
  DTC     arch/arm/boot/dts/sun7i-a20-lamobo-r1.dtb
  DTC     arch/arm/boot/dts/sun7i-a20-m3.dtb
  DTC     arch/arm/boot/dts/sun7i-a20-mk808c.dtb
  DTC     arch/arm/boot/dts/sun7i-a20-olimex-som-evb.dtb
  DTC     arch/arm/boot/dts/sun7i-a20-olinuxino-lime.dtb
  DTC     arch/arm/boot/dts/sun7i-a20-olinuxino-lime2.dtb
  DTC     arch/arm/boot/dts/sun7i-a20-olinuxino-lime2-emmc.dtb
  DTC     arch/arm/boot/dts/sun7i-a20-olinuxino-micro.dtb
  DTC     arch/arm/boot/dts/sun7i-a20-orangepi.dtb
  DTC     arch/arm/boot/dts/sun7i-a20-orangepi-mini.dtb
  DTC     arch/arm/boot/dts/sun7i-a20-pcduino3.dtb
  DTC     arch/arm/boot/dts/sun7i-a20-pcduino3-nano.dtb
  DTC     arch/arm/boot/dts/sun7i-a20-wexler-tab7200.dtb
  DTC     arch/arm/boot/dts/sun7i-a20-wits-pro-a20-dkt.dtb
  DTC     arch/arm/boot/dts/sun8i-a23-evb.dtb
  DTC     arch/arm/boot/dts/sun8i-a23-gt90h-v4.dtb
  DTC     arch/arm/boot/dts/sun8i-a23-inet86dz.dtb
  DTC     arch/arm/boot/dts/sun8i-a23-ippo-q8h-v5.dtb
  DTC     arch/arm/boot/dts/sun8i-a23-ippo-q8h-v1.2.dtb
  DTC     arch/arm/boot/dts/sun8i-a23-polaroid-mid2407pxe03.dtb
  DTC     arch/arm/boot/dts/sun8i-a23-polaroid-mid2809pxe04.dtb
  DTC     arch/arm/boot/dts/sun8i-a23-q8-tablet.dtb
  DTC     arch/arm/boot/dts/sun8i-a33-et-q8-v1.6.dtb
  DTC     arch/arm/boot/dts/sun8i-a33-ga10h-v1.1.dtb
  DTC     arch/arm/boot/dts/sun8i-a33-inet-d978-rev2.dtb
  DTC     arch/arm/boot/dts/sun8i-a33-ippo-q8h-v1.2.dtb
  DTC     arch/arm/boot/dts/sun8i-a33-olinuxino.dtb
  DTC     arch/arm/boot/dts/sun8i-a33-q8-tablet.dtb
  DTC     arch/arm/boot/dts/sun8i-a33-sinlinx-sina33.dtb
  DTC     arch/arm/boot/dts/sun8i-a83t-allwinner-h8homlet-v2.dtb
  DTC     arch/arm/boot/dts/sun8i-a83t-cubietruck-plus.dtb
  DTC     arch/arm/boot/dts/sun8i-h3-bananapi-m2-plus.dtb
  DTC     arch/arm/boot/dts/sun8i-h3-nanopi-neo.dtb
  DTC     arch/arm/boot/dts/sun8i-h3-orangepi-2.dtb
  DTC     arch/arm/boot/dts/sun8i-h3-orangepi-lite.dtb
  DTC     arch/arm/boot/dts/sun8i-h3-orangepi-one.dtb
  DTC     arch/arm/boot/dts/sun8i-h3-orangepi-pc.dtb
  DTC     arch/arm/boot/dts/sun8i-h3-orangepi-pc-plus.dtb
  DTC     arch/arm/boot/dts/sun8i-h3-orangepi-plus.dtb
  DTC     arch/arm/boot/dts/sun8i-h3-orangepi-plus2e.dtb
  DTC     arch/arm/boot/dts/sun8i-r16-parrot.dtb
  DTC     arch/arm/boot/dts/sun9i-a80-optimus.dtb
  DTC     arch/arm/boot/dts/sun9i-a80-cubieboard4.dtb
aliech@fomalhaut:/mnt/build/linux-4.9.34$ cp arch/arm/boot/dts/sun7i-a20-bananapro.dtb /boot/
aliech@fomalhaut:/mnt/build/linux-4.9.34$ sudo cp arch/arm/boot/dts/sun7i-a20-bananapro.dtb /boot/

В devicetree было добавлено включение кодека:

&codec {
	status = "okay";
};

Осталось лишь отредактировать скрипты загрузки. В моём случае я вношу изменения в скрипты составления загрузочных профилей uboot’а.

Добавить комментарий

Ваш e-mail не будет опубликован. Обязательные поля помечены *

+ 29 = 35