目次: ARM
エアガン的当てゲームを作り始めたとき(1月くらいかな?)から気になっていたのですが、ROCK 3C上でJavaを使って画面を描画すると妙に描画速度が遅いです。もうひとつ不思議なことに、マウスカーソルをぐりぐり動かすと描画が止まります。なんで?
最初はJava側の問題か?と思ったものの、秋葉原のTARGET-1に置いている機体はJava側のプログラムは全く同じなのに、描画速度がメチャ速いです(マウスカーソルを動かしても画面描画が止まらない)。ROCK 3C側(というかメインSoCであるRockchip RK3566)のグラフィック関連がどこかおかしいんでしょう。たぶん。
描画が遅い機体と速い機体で大きな違いがあるとするとaptでアップデートしたくらいです。描画速度が遅い機体を持ち帰ってきてアップデートしました。結果だけ先に言ってしまうと、描画速度はやや改善したものの全く同じにはなりませんでした。何が違うんだろう?
描画速度に効いていると思われるのは下記の2つです。
アップデート方法はapt-get updateとapt-get upgradeですが、下記のようにchanged its 'Origin' value from 'AAAA' to 'BBBB'エラーが出る場合があります。
Reading package lists... Done E: Repository 'https://radxa-repo.github.io/bullseye rockchip-bullseye InRelease' changed its 'Origin' value from 'rsdk-local rockchip-bullseye' to 'Radxa' E: Repository 'https://radxa-repo.github.io/bullseye rockchip-bullseye InRelease' changed its 'Label' value from 'rsdk-local rockchip-bullseye' to 'Freight' N: This must be accepted explicitly before updates for this repository can be applied. See apt-secure(8) manpage for details. E: Repository 'https://radxa-repo.github.io/bullseye bullseye InRelease' changed its 'Origin' value from 'rsdk-local bullseye' to 'Radxa' E: Repository 'https://radxa-repo.github.io/bullseye bullseye InRelease' changed its 'Label' value from 'rsdk-local bullseye' to 'Freight' N: This must be accepted explicitly before updates for this repository can be applied. See apt-secure(8) manpage for details. Reading package lists... Done Building dependency tree... Done Reading state information... Done Calculating upgrade... Done
これはリポジトリのReleaseファイルが変わっているが良いのか?と確認してくれているためで、今回は無視して良いので--allow-releaseinfo-changeを付けてapt-get updateすれば先に進みます。
# apt-get update --allow-releaseinfo-change (...略...) # apt-get dist-upgrade Hit:1 https://download.vscodium.com/debs vscodium InRelease Hit:2 https://deb.debian.org/debian bullseye InRelease Hit:3 https://deb.debian.org/debian bullseye-backports InRelease Hit:4 https://deb.debian.org/debian-security bullseye-security InRelease Hit:5 https://deb.debian.org/debian bullseye-updates InRelease Hit:6 https://radxa-repo.github.io/bullseye rockchip-bullseye InRelease Hit:7 https://radxa-repo.github.io/bullseye bullseye InRelease Reading package lists... Done Reading package lists... Done Building dependency tree... Done Reading state information... Done Calculating upgrade... Done The following NEW packages will be installed: librtui linux-headers-5.10.160-34-rk356x linux-image-5.10.160-34-rk356x r8125-dkms radxa-system-config-r8125-dkms The following packages will be upgraded: aic8800-firmware aic8800-sdio-dkms aicrf-test linux-headers-rock-3c linux-image-rock-3c radxa-firmware radxa-overlays-dkms radxa-system-config-aic8800-sdio-dkms radxa-system-config-bullseye radxa-system-config-common radxa-system-config-kernel-cmdline-ttyfiq0 radxa-system-config-rockchip radxa-udev rsetup rsetup-config-aic8800-ttys1 task-rock-3c
描画速度はやや改善したものの全く同じにはなりません。描画速度が速い機種と改善後の機種を比べると、
| 描画が速い機種 | 描画が遅い機種(改善後) | |
|---|---|---|
| マウスカーソル | ちらつく | ちらつかない |
| マウスカーソルを動かし続ける | 描画が止まらない | 描画が止まる |
| 描画速度 | 16ms〜32ms(たまに1フレームスキップ) | たまに16ms、ほぼ32ms〜64ms(ほぼ1フレームスキップ) |
うーん?何が違うんだろう?
この記事にコメントする
目次: Arduino
前回(2024年3月24日の日記参照)発注して燃えた(2024年4月3日の日記参照)PCBの設計を改修して発注しました。前回と同様にJLPCBにお願いしています。
JLPCBはドル決済なので円安だと支払いが増えて結構痛いんですよね……。円安がマシにならないかなーと思って1ヶ月くらい待ったんですが、特に良くなる傾向がなかったので諦めました。
この記事にコメントする
目次: Yocto
Yocto Scarthgap(5.0.1)のメモです。前回同様、コードを読んで依存関係を調べるのは大変時間が掛かるので、簡易的な調査手法として全ファイルを消してエラーを観察し、エラーの原因となるファイルを復活させて次ステップに進める手段を用います。
引き続きBitbakeを実行してエラーを見て、足りないファイルを元に戻していく方法で各パーツや設定の動作を見ます。
$ bitbake core-image-sato
ERROR: Unable to parse /home/katsuhiro/share/projects/oss/poky/bitbake/lib/bb/parse/parse_py/BBHandler.py
Traceback (most recent call last):
File "/home/katsuhiro/share/projects/oss/poky/bitbake/lib/bb/parse/parse_py/BBHandler.py", line 71, in inherit(files=['base'], fn='configuration INHERITs', lineno=0, d=<bb.data_smart.DataSmart object at 0x7f7a85863c50>, deferred=False):
if not os.path.exists(file):
> raise ParseError("Could not inherit file %s" % (file), fn, lineno)
bb.parse.ParseError: ParseError in configuration INHERITs: Could not inherit file classes/base.bbclass
なにやらclassesディレクトリと*.bbclassファイルが出てきました。これはクラス(Classes - The Yoct Project)といってレシピ間で処理を共有するための仕組みです。ドキュメントによると3種類あるそうです。
Yoctoのクラス(*.bbclassファイル)は全部meta/classes-globalかと思ったらそうでもなく、一部のクラスはmeta/classesディレクトリに配置されています。
エラーメッセージはmeta/classes/base.bbclassがないと言っていますが、ファイルの実際の在処はmeta/classes-global/base.bbclassです。どういうことでしょう?Bitbakeのソースコードを見ると、
# bitbake/lib/bb/parse/parse_py/BBHandler.py
def inherit(files, fn, lineno, d, deferred=False):
__inherit_cache = d.getVar('__inherit_cache', False) or []
#if "${" in files and not deferred:
# bb.warn("%s:%s has non deferred conditional inherit" % (fn, lineno))
files = d.expand(files).split()
#★★files配列には'base'だけが入っている★★
for file in files:
classtype = d.getVar("__bbclasstype", False) #★★classtype = global★★
origfile = file
#★★classes-global/base.bbclassがなければ、classes/base.bbclassを探す★★
for t in ["classes-" + classtype, "classes"]:
file = origfile
#★★パスと拡張子を連結★★
if not os.path.isabs(file) and not file.endswith(".bbclass"):
file = os.path.join(t, '%s.bbclass' % file)
if not os.path.isabs(file):
bbpath = d.getVar("BBPATH")
abs_fn, attempts = bb.utils.which(bbpath, file, history=True)
for af in attempts:
if af != abs_fn:
bb.parse.mark_dependency(d, af)
if abs_fn:
file = abs_fn
if os.path.exists(file):
break
#★★どちらもないと最後に探したパス名でエラーメッセージを出してくる★★
if not os.path.exists(file):
raise ParseError("Could not inherit file %s" % (file), fn, lineno) #★★エラーメッセージを発生させる行★★
Bitbakeはclasses-globalとclassesの両方を探し、どちらにも目当てのクラスがない場合は最後に探したパス名でエラーメッセージを出力します。従ってエラーメッセージのパスは必ずmeta/classesになります。
今回登場したファイル、ディレクトリは、
こんなとこ。次回はディストリビューションを見ます。
この記事にコメントする
目次: Yocto
Yocto Scarthgap(5.0.1)のメモです。Yoctoの使い方は以下の2手でした。
$ source oe-init-build-env $ bitbake core-image-sato
今回はBitbakeです。前回同様、コードを読んで依存関係を調べるのは大変時間が掛かるので、簡易的な調査手法として全ファイルを消してエラーを観察し、エラーの原因となるファイルを復活させて次ステップに進める手段を用います。
このbitbakeコマンドはPython 3で実装されていて、poky/bitbake/lib/bb/parse以下にあるスクリプトと連携して動作しています。bitbakeのエラー曰く、bblayers.confのBBLAYERS変数に列挙されているmetaなんとかディレクトリ下にconf/layer.confが必要です。
ここで出てくるmeta-なんとかディレクトリはOpenEmbeddedの概念でレイヤーと呼ばれます。レイヤー = レシピの集合体、レシピ = 何らかのソフトウェアをビルド、構成する方法を記述したものです。Yoctoは独自の単語が多いので、公式ドキュメントの用語集(Yocto Project Terms - The Yocto Project)が参考になります。
# build/conf/bblayers.conf BBLAYERS ?= " \ /home/katsuhiro/share/projects/oss/poky/meta \ /home/katsuhiro/share/projects/oss/poky/meta-poky \ /home/katsuhiro/share/projects/oss/poky/meta-yocto-bsp \ "
$ bitbake core-image-sato
ERROR: Unable to parse /home/katsuhiro/share/projects/oss/poky/bitbake/lib/bb/parse/__init__.py
Traceback (most recent call last):
File "/home/katsuhiro/share/projects/oss/poky/bitbake/lib/bb/parse/__init__.py", line 145, in resolve_file(fn='/home/katsuhiro/share/projects/oss/poky/meta-poky/conf/layer.conf', d=<bb.data_smart.DataSmart object at 0x7fb271c5bc10>):
if not os.path.isfile(fn):
> raise IOError(errno.ENOENT, "file %s not found" % fn)
FileNotFoundError: [Errno 2] file /home/katsuhiro/share/projects/oss/poky/meta-poky/conf/layer.conf not found
3つのレイヤーのうち、テンプレートディレクトリを持っているmeta-pokyにはmeta-poky/conf/layer.confが存在します(でないとoe-setup-builddirのチェックに引っかかるはず)。残りの2つmeta/conf/layer.confとmeta-yocto-bsp/conf/layer.confを元に戻して実行します。
ちなみにOpenEmbeddedのサイトで利用可能なレイヤーの一覧(OpenEmbedded Layer Index)を確認できます。便利ですね。
話がそれましたがmeta/conf/layer.confとmeta-yocto-bsp/conf/layer.confファイルを戻してbitbakeを実行すると、
$ bitbake core-image-sato
ERROR: Unable to parse /home/katsuhiro/share/projects/oss/poky/bitbake/lib/bb/parse/ast.py
Traceback (most recent call last):
File "/home/katsuhiro/share/projects/oss/poky/bitbake/lib/bb/parse/ast.py", line 290, in PyLibNode.eval(data=<bb.data_smart.DataSmart object at 0x7f4f4d45bf50>):
try:
> bb.utils._context[self.namespace] = __import__(self.namespace)
toimport = getattr(bb.utils._context[self.namespace], "BBIMPORTS", [])
ModuleNotFoundError: No module named 'oe'
エラーを見るとmeta/lib/oeが無いと言っているのでこれも元に戻しましょう。oeはたぶんOpenEmbedded(※)の略ですね。
(※)bitbakeはOpenEmbeddedのビルドツールで、PokyはOpenEmbeddedのリファレンス(reference distribution)とされています。YoctoはPokyを開発しているプロジェクト名です。Yocto, Poky, OpenEmbeddedの関係はbitbakeのヘルプとかYoctoのヘルプで説明されています(1 Overview - Bitbake dev documentation、Technical Overview - The Yocto Project)。
次のエラーを見るとbitbake.confがないと言われます。
$ bitbake core-image-sato
ERROR: Unable to parse /home/katsuhiro/share/projects/oss/poky/bitbake/lib/bb/parse/__init__.py
Traceback (most recent call last):
File "/home/katsuhiro/share/projects/oss/poky/bitbake/lib/bb/parse/__init__.py", line 139, in resolve_file(fn='conf/bitbake.conf', d=<bb.data_smart.DataSmart object at 0x7faff2cc38d0>):
if not newfn:
> raise IOError(errno.ENOENT, "file %s not found in %s" % (fn, bbpath))
fn = newfn
FileNotFoundError: [Errno 2] file conf/bitbake.conf not found in /home/katsuhiro/share/projects/oss/poky/meta-poky:/home/katsuhiro/share/projects/oss/poky/build:/home/katsuhiro/share/projects/oss/poky/meta:/home/katsuhiro/share/projects/oss/poky/meta-yocto-bsp
指摘された通りmeta/conf/bitbake.confを元に戻します。他のレイヤー(metaなんとかディレクトリ)にはbitbake.confがありません。1個しかないものなのかな?bitbake.confは他の*.confを大量にrequire/includeしていて同じく見つからないエラーになりますので、*.confファイルも元に戻します。
今回登場したファイル、ディレクトリは、
こんなところです。次回はクラスを見ます。
この記事にコメントする
目次: Yocto
Yocto Scarthgap(5.0.1)のメモです。Yoctoの使い方は以下の2手でした。
$ source oe-init-build-env $ bitbake core-image-sato
テンプレートディレクトリを元にしてビルドディレクトリ(正確にはbuild/confディレクトリ)を作成します。Yoctoのドキュメント(Creating a Custom Template Configuration Directory - The Yocto Project)によると、テンプレートディレクトリのパスはTEMPLATECONF環境変数で指定できるとあります。
もし何も設定しないと.templateconfファイル内に書かれた設定をデフォルトの設定として使います。内容はこんな感じです。
$ less .templateconf
# Template settings
TEMPLATECONF=${TEMPLATECONF:-meta-poky/conf/templates/default}
テンプレートディレクトリの中にあるファイルはこんな感じ。
$ ls meta-poky/conf/templates/default/ bblayers.conf.sample conf-summary.txt local.conf.sample.extended conf-notes.txt local.conf.sample site.conf.sample
テンプレートファイルからビルドディレクトリを作成する際は、単なるコピーではなく##OEROOT##のような変数をパスに展開した内容がコピーされます。下記はOEROOTの展開例です。
$ diff -u meta-poky/conf/templates/default/bblayers.conf.sample build/conf/bblayers.conf
--- meta-poky/conf/templates/default/bblayers.conf.sample 2024-05-30 13:17:58.926938821 +0900
+++ build/conf/bblayers.conf 2024-05-31 14:58:51.741378271 +0900
@@ -6,7 +6,7 @@
BBFILES ?= ""
BBLAYERS ?= " \
- ##OEROOT##/meta \
- ##OEROOT##/meta-poky \
- ##OEROOT##/meta-yocto-bsp \
+ /home/katsuhiro/share/projects/oss/poky/meta \
+ /home/katsuhiro/share/projects/oss/poky/meta-poky \
+ /home/katsuhiro/share/projects/oss/poky/meta-yocto-bsp \
"
ぱっと見だとテンプレートディレクトリの場所はどこでも良さそうですがそんなことはありません。テンプレートがpoky/meta-poky/conf/templates/defaultだとしたら、
poky/meta-poky/conf/templates/ の2つ上のディレクトリの下のconf/layer.confすなわち、 poky/meta-poky/conf/layer.conf が必要です。
一言で言えばテンプレートがあるディレクトリの2つ上(Yoctoを例にすればmeta-poky)にconf/layer.confが存在しないエラーですが、そんな制約知らんわー……。
ちなみにテンプレートディレクトリを作成する場合は手で作成するのではなく、bitbake-layers save-build-confコマンドを使用するそうです(ドキュメント参照)。
セットアップディレクトリによって、ビルドディレクトリbuildが生成され、BBPATHとBUILDDIRがビルドディレクトリを指すようになります。ビルドディレクトリ下には、テンプレートディレクトリからbuild/confディレクトリが生成されます。ファイルの中身を見ると、
#### build/conf/bblayers.conf
# POKY_BBLAYERS_CONF_VERSION is increased each time build/conf/bblayers.conf
# changes incompatibly
POKY_BBLAYERS_CONF_VERSION = "2"
BBPATH = "${TOPDIR}"
BBFILES ?= ""
BBLAYERS ?= " \
/home/katsuhiro/share/projects/oss/poky/meta \
/home/katsuhiro/share/projects/oss/poky/meta-poky \
/home/katsuhiro/share/projects/oss/poky/meta-yocto-bsp \
"
#### build/conf/conf-notes.txt
### Shell environment set up for builds. ###
You can now run 'bitbake <target>'
Common targets are:
core-image-minimal
core-image-full-cmdline
core-image-sato
core-image-weston
meta-toolchain
meta-ide-support
You can also run generated qemu images with a command like 'runqemu qemux86-64'.
Other commonly useful commands are:
- 'devtool' and 'recipetool' handle common recipe tasks
- 'bitbake-layers' handles common layer tasks
- 'oe-pkgdata-util' handles common target package tasks
#### build/conf/conf-summary.txt
This is the default build configuration for the Poky reference distribution.
#### build/conf/local.conf
(設定項目がたくさんある、ここでは省略)
#### build/conf/templateconf.cfg
meta-poky/conf/templates/default
セットアップスクリプトの時点でもシステムの複雑さの片鱗が見え隠れしています。まともにコードで追うのを諦めて正解でした。そんなことしていたら日が暮れてしまいます。今回登場したファイル、ディレクトリは、
こんなもんでしょうか。次回はいよいよbitbakeに突入です。
この記事にコメントする
| < | 2024 | > | ||||
| << | < | 06 | > | >> | ||
| 日 | 月 | 火 | 水 | 木 | 金 | 土 |
| - | - | - | - | - | - | 1 |
| 2 | 3 | 4 | 5 | 6 | 7 | 8 |
| 9 | 10 | 11 | 12 | 13 | 14 | 15 |
| 16 | 17 | 18 | 19 | 20 | 21 | 22 |
| 23 | 24 | 25 | 26 | 27 | 28 | 29 |
| 30 | - | - | - | - | - | - |
wiki
Linux JM
Java API
2002年
2003年
2004年
2005年
2006年
2007年
2008年
2009年
2010年
2011年
2012年
2013年
2014年
2015年
2016年
2017年
2018年
2019年
2020年
2021年
2022年
2023年
2024年
2025年
過去日記について
アクセス統計
サーバ一覧
サイトの情報合計:
本日: