分类 默认分类 下的文章

build H2+ v1.3.1 firmware to support both ak4951 and wm8731

portapack-mayhem/firmware/application/portapack.cpp

static const portapack::cpld::Config& portapack_cpld_config() {

return (portapack_model() == PortaPackModel::R2_20170522)
    ? portapack::cpld::rev_20170522::config
    : portapack::cpld::**rev_20170522**::config
    ;

}

Backlight* backlight() {

return (portapack_model() == PortaPackModel::R2_20170522)
    ? static_cast<portapack::Backlight*>(&backlight_cat4004)
    : static_cast<portapack::Backlight*>(&backlight_**cat4004**);

}

inside ** is change
one fw so easy to support wm8731 and ak4951 auto detect

emuelec evtest the keypad

ark@rgb10:~$ evtest
No device specified, trying to scan all of /dev/input/event*
Not running as root, no devices may be available.
Available devices:
/dev/input/event0: rk8xx_pwrkey
/dev/input/event1: rockchip,rk817-codec Headphones
/dev/input/event2: odroidgo2_joypad
Select the device event number [0-2]: 2
Input driver version is 1.0.1
Input device ID: bus 0x19 vendor 0x1 product 0x1 version 0x101
Input device name: "odroidgo2_joypad"
Supported events:
Event type 0 (EV_SYN)
Event type 1 (EV_KEY)

Event code 304 (BTN_SOUTH)
Event code 305 (BTN_EAST)
Event code 307 (BTN_NORTH)
Event code 308 (BTN_WEST)
Event code 310 (BTN_TL)
Event code 311 (BTN_TR)
Event code 312 (BTN_TL2)
Event code 313 (BTN_TR2)
Event code 544 (BTN_DPAD_UP)
Event code 545 (BTN_DPAD_DOWN)
Event code 546 (BTN_DPAD_LEFT)
Event code 547 (BTN_DPAD_RIGHT)
Event code 704 (BTN_TRIGGER_HAPPY1)
Event code 705 (BTN_TRIGGER_HAPPY2)
Event code 706 (BTN_TRIGGER_HAPPY3)
Event code 707 (BTN_TRIGGER_HAPPY4)
Event code 708 (BTN_TRIGGER_HAPPY5)
Event code 709 (BTN_TRIGGER_HAPPY6)

Event type 3 (EV_ABS)

Event code 0 (ABS_X)
  Value      0
  Min     -900
  Max      899
  Fuzz      32
  Flat      32
Event code 1 (ABS_Y)
  Value      0
  Min     -900
  Max      899
  Fuzz      32
  Flat      32

Properties:
Testing ... (interrupt to exit)
Event: time 1611323493.496528, type 1 (EV_KEY), code 545 (BTN_DPAD_DOWN), value 1
Event: time 1611323493.496528, -------------- SYN_REPORT ------------
Event: time 1611323493.616278, type 1 (EV_KEY), code 545 (BTN_DPAD_DOWN), value 0
Event: time 1611323493.616278, -------------- SYN_REPORT ------------
Event: time 1611323496.080396, type 1 (EV_KEY), code 544 (BTN_DPAD_UP), value 1
Event: time 1611323496.080396, -------------- SYN_REPORT ------------
Event: time 1611323496.228346, type 1 (EV_KEY), code 544 (BTN_DPAD_UP), value 0
Event: time 1611323496.228346, -------------- SYN_REPORT ------------
Event: time 1611323496.732352, type 1 (EV_KEY), code 546 (BTN_DPAD_LEFT), value 1
Event: time 1611323496.732352, -------------- SYN_REPORT ------------
Event: time 1611323496.860450, type 1 (EV_KEY), code 546 (BTN_DPAD_LEFT), value 0
Event: time 1611323496.860450, -------------- SYN_REPORT ------------
Event: time 1611323497.264413, type 1 (EV_KEY), code 547 (BTN_DPAD_RIGHT), value 1
Event: time 1611323497.264413, -------------- SYN_REPORT ------------
Event: time 1611323497.372320, type 1 (EV_KEY), code 547 (BTN_DPAD_RIGHT), value 0
Event: time 1611323497.372320, -------------- SYN_REPORT ------------
Event: time 1611323497.696433, type 1 (EV_KEY), code 545 (BTN_DPAD_DOWN), value 1
Event: time 1611323497.696433, -------------- SYN_REPORT ------------
Event: time 1611323497.808297, type 1 (EV_KEY), code 545 (BTN_DPAD_DOWN), value 0
Event: time 1611323497.808297, -------------- SYN_REPORT ------------
Event: time 1611323498.416461, type 1 (EV_KEY), code 544 (BTN_DPAD_UP), value 1
Event: time 1611323498.416461, -------------- SYN_REPORT ------------
Event: time 1611323498.540424, type 1 (EV_KEY), code 544 (BTN_DPAD_UP), value 0
Event: time 1611323498.540424, -------------- SYN_REPORT ------------
Event: time 1611323498.940350, type 1 (EV_KEY), code 546 (BTN_DPAD_LEFT), value 1
Event: time 1611323498.940350, -------------- SYN_REPORT ------------
Event: time 1611323499.028463, type 1 (EV_KEY), code 546 (BTN_DPAD_LEFT), value 0
Event: time 1611323499.028463, -------------- SYN_REPORT ------------
Event: time 1611323499.636405, type 1 (EV_KEY), code 545 (BTN_DPAD_DOWN), value 1
Event: time 1611323499.636405, -------------- SYN_REPORT ------------
Event: time 1611323499.760405, type 1 (EV_KEY), code 545 (BTN_DPAD_DOWN), value 0
Event: time 1611323499.760405, -------------- SYN_REPORT ------------
Event: time 1611323500.084310, type 1 (EV_KEY), code 545 (BTN_DPAD_DOWN), value 1
Event: time 1611323500.084310, -------------- SYN_REPORT ------------
Event: time 1611323500.512354, type 1 (EV_KEY), code 545 (BTN_DPAD_DOWN), value 0
Event: time 1611323500.512354, -------------- SYN_REPORT ------------
Event: time 1611323500.724398, type 1 (EV_KEY), code 546 (BTN_DPAD_LEFT), value 1
Event: time 1611323500.724398, -------------- SYN_REPORT ------------
Event: time 1611323501.132367, type 1 (EV_KEY), code 546 (BTN_DPAD_LEFT), value 0
Event: time 1611323501.132367, -------------- SYN_REPORT ------------
Event: time 1611323501.388362, type 1 (EV_KEY), code 547 (BTN_DPAD_RIGHT), value 1
Event: time 1611323501.388362, -------------- SYN_REPORT ------------
Event: time 1611323501.732448, type 1 (EV_KEY), code 547 (BTN_DPAD_RIGHT), value 0
Event: time 1611323501.732448, -------------- SYN_REPORT ------------
Event: time 1611323502.112278, type 1 (EV_KEY), code 544 (BTN_DPAD_UP), value 1
Event: time 1611323502.112278, -------------- SYN_REPORT ------------
Event: time 1611323502.376336, type 1 (EV_KEY), code 544 (BTN_DPAD_UP), value 0
Event: time 1611323502.376336, -------------- SYN_REPORT ------------
Event: time 1611323502.668349, type 1 (EV_KEY), code 546 (BTN_DPAD_LEFT), value 1
Event: time 1611323502.668349, -------------- SYN_REPORT ------------
Event: time 1611323502.888432, type 1 (EV_KEY), code 546 (BTN_DPAD_LEFT), value 0
Event: time 1611323502.888432, -------------- SYN_REPORT ------------
Event: time 1611323503.160290, type 1 (EV_KEY), code 547 (BTN_DPAD_RIGHT), value 1
Event: time 1611323503.160290, -------------- SYN_REPORT ------------
Event: time 1611323503.328259, type 1 (EV_KEY), code 547 (BTN_DP

在 emuelec-autostart.service 里, 执行了/storage/.config/autostart.sh

在autostart.sh的结尾, 又执行了 /storage/.config/custom_start.sh

最后一步, 通过 emustation.service, 把/usr/bin/emulationstation启动起来

通过ScreenScraper自动下载游戏说明和截图
首先到 https://www.screenscraper.fr/ 注册一个帐号, 需要邮箱验证

在EmuELEC界面上, 通过 SCRAPE 菜单, 填充帐号和口令, 依次选择
Scrape From: SCREENSCRAPER
Image Source: SCREENSHOT(游戏运行画面), TITLE SCREENSHOT(游戏开始画面), MIX (游戏运行截图+游戏盒子合并在一起的一张图)
Box Source: NONE (游戏包装, 2d或3d, 因为色深为24bit, 文件size会比较大, 都是200~400K大小, 如果用列表展示, 就不需要下载这个)
Logo Source: WHEEL
Scrape Ratings: YES
Scrape Videos: NO
然后点击Scrape Now, 选择要下载的集合, 选择处理冲突的方式, 建议自动.

系统就会在后台自动下载, 因为来源在国外所以速度会比较慢.

修改时区
系统默认时区为墨西哥, 界面上没有修改时区的地方, 需要命令行登录后修改 /emuelec/configs/emuelec.conf , 里面有timezone配置. 改为

1
system.timezone=Asia/Shanghai
连发键的设置Autofire, Turbo Button, Duty Cycle
这个其实是RetroArch的配置, 和以往的连发键设置不太一样, RetroArch用的是开关触发的机制, 有三处相关的设置
Settings->Input->Turbo Period, 连发键开启时, 在连发当中每次按下的时间长度(多少帧)
Settings->Input->Duty Cycle, 连发键开启时, 在连发当中按下的时间占空比
Settings->Input->User/Port[1,2,3,4] Binds->User/Port[1,2,3,4] Turbo, 开启连发的键

使用方法是, 按住需要连发的按键后, 按一下开启连发的键, 这个按住的键就开启连发了. 这个开启连发的效果只在按住时有效, 松开按键后连发的效果就消失, 需要再来一遍.

输入设备按键测试
查看所有输入设备, 列出各设备对应的event编号

1
cat /proc/bus/input/devices
输入设备测试

1
2
3
4

手柄测试, 需要对应上面命令输出的js编号

jstest --event /dev/input/js0

通用的输入事件测试, 需要对应上面命令产生的event编号

evtest /dev/input/event3
对于乐视尚酷版手柄, 无法设置select键的问题: 这个手柄在输入设备里会产生两个设备, 分别是

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
I: Bus=0003 Vendor=0101 Product=1d79 Version=0110
N: Name="MY-POWER LeWGP-201"
P: Phys=usb-xhci-hcd.0.auto-1.4/input0
S: Sysfs=/devices/c9000000.dwc3/xhci-hcd.0.auto/usb1/1-1/1-1.4/1-1.4:1.0/0003:0101:1D79.0003/input/input4
U: Uniq=
H: Handlers=js0 event4
B: PROP=0
B: EV=1b
B: KEY=7fff0000 0 0 0 0 0 0 0 0 0
B: ABS=3063f
B: MSC=10

I: Bus=0003 Vendor=0101 Product=1d79 Version=0110
N: Name="MY-POWER LeWGP-201"
P: Phys=usb-xhci-hcd.0.auto-1.4/input1
S: Sysfs=/devices/c9000000.dwc3/xhci-hcd.0.auto/usb1/1-1/1-1.4/1-1.4:1.1/0003:0101:1D79.0004/input/input5
U: Uniq=
H: Handlers=kbd event5
B: PROP=0
B: EV=1f
B: KEY=3007f 0 0 0 0 483ffff 17aff32d bf544446 0 0 1 120c13 b17c000 267bfa d941dfed 9e1680 4400 0 10000002
B: REL=40
B: ABS=1 0
B: MSC=10
其中js0:event4设备可以响应除了back键和底下一排三个键以外其他所有按键, 而kbd:event5设备则正好相反. 可以通过evremap将event5的按键映射到event4

1
2

Enable 'BACK' key on LeWGP-201 gamepad

evremap /dev/input/by-id/usb-MY-POWER_LeWGP-201-event-if01 /dev/input/by-id/usb-MY-POWER_LeWGP-201-event-joystick
将其添加到 /storage/.config/custom_start.sh 文件中, 将来开机就会自动生效.

另外对于乐视尚酷版手柄在连接后每隔几秒钟会断开一秒(断开时可以看到手柄上方4个灯一起闪, 连接好以后应该是只亮一个灯的)的问题, 这个通过dmesg看并无硬件通断事件, 如果连接头连接在usbhub上就容易有这个问题, 在R3300L上, 通过otg口连接到盒子的microusb口, 就不会出现断开的问题了. 推断是因为乐视这个接收头对电压的要求较高, usbhub的电压不足以使其稳定工作所致.

pistar 4.1.2 Oled Display Close not boot problem sloved

admin->live log

I: 2020-12-23 08:49:41.579 Loaded 162513 IDs to lookup table - /usr/local/etc/DMRIds.dat
I: 2020-12-23 08:49:41.580 DMR RF Parameters
I: 2020-12-23 08:49:41.580 Id: 3116449
I: 2020-12-23 08:49:41.580 Color Code: 1
I: 2020-12-23 08:49:41.580 Self Only: no
I: 2020-12-23 08:49:41.580 Embedded LC Only: no
I: 2020-12-23 08:49:41.580 Dump Talker Alias Data: yes
I: 2020-12-23 08:49:41.580 Prefixes: 0
I: 2020-12-23 08:49:41.580 Call Hang: 3s
I: 2020-12-23 08:49:41.580 TX Hang: 4s
I: 2020-12-23 08:49:41.580 Mode Hang: 20s
I: 2020-12-23 08:49:41.581 OVCM: off
I: 2020-12-23 08:49:41.581 DMR Roaming Beacons Type: off
I: 2020-12-23 08:49:41.582 Started the DMR Id lookup reload thread
I: 2020-12-23 08:49:41.726 Interfaces Info
I: 2020-12-23 08:49:41.728 IPv4: lo:127.0.0.1
I: 2020-12-23 08:49:41.728 IPv4: wlan0:192.168.83.123
I: 2020-12-23 08:49:41.728 Default interface is : wlan0
I: 2020-12-23 08:49:41.728 IP to show: wlan0:192.168.83.123
M: 2020-12-23 08:49:41.728 MMDVMHost-20200503_Pi-Star_v4 is running
M: 2020-12-23 08:50:12.114 Unknown packet from the master
M: 2020-12-23 08:50:12.114 0000: 4D 53 54 4E 41 43 00 2F 8D A1 MSTNAC./..
M: 2020-12-23 08:50:22.149 Unknown packet from the master
M: 2020-12-23 08:50:22.149 0000: 4D 53 54 4E 41 43 00 2F 8D A1 MSTNAC./..
M: 2020-12-23 08:50:32.171 Unknown packet from the master
M: 2020-12-23 08:50:32.171 0000: 4D 53 54 4E 41 43 00 2F 8D A1 MSTNAC./..
E: 2020-12-23 08:50:51.988 DMR, Connection to the master has timed out, retrying connection
M: 2020-12-23 08:50:51.988 DMR, Closing DMR Network
M: 2020-12-23 08:50:51.988 DMR, Opening DMR Network
M: 2020-12-23 08:51:22.712 DMR, Logged into the master successfully
M: 2020-12-23 08:52:41.672 Closing the MMDVM
I: 2020-12-23 08:52:42.616 Stopped the DMR Id lookup reload thread
M: 2020-12-23 08:52:42.616 DMR, Closing DMR Network
I: 2020-12-23 08:52:42.617 MMDVMHost-20200503_Pi-Star_v4 exited on receipt of SIGTERM

problem is Unknown packet from the master

go to http://pi-star/admin/expert/ssh_access.php

so run
sudo pistar-mmdvmhshatflash hs_hat
to update fw to 1.5.2 problem sloved.
after update:
Radio Info
Trx Listening DMR
Tx 432.330000 MHz
Rx 432.330000 MHz
FW HS_Hat:v1.5.2
TCXO 14.7456 MHz

mmdvm_hs rev1.7 i2c setting

1605368051282.jpg
1605368211632.jpg

1.update i2c fw for mmdvm_hs not dual(later)
hs_i2c.rar MMDVM_HS_Hat-v1.5.2 20201108 14.7456MHz

wget https://www.mmdvm.club/usr/uploads/2020/11/3000050055.rar
7z 3000050055.rar
killall MMDVMHost
sudo stm32flash -v -w hs_i2c.bin -g 0x0 -R -i 20,-21,21:-20,21 /dev/ttyAMA0
MMDVMHost /etc/mmdvmhost
2.change mmdvmhost file

nano /etc/mmdvmhost change to follow

Port=/dev/i2c-1
Protocol=i2c

Address=0x22

3.ctrl+o save change
4.view log
M: 2020-11-14 20:25:03.300 MMDVMHost-20200809-OSTAR is running
M: 2020-11-14 20:25:03.310 YSF, received network data from BD4RBX to DG-ID 0 at BI7XXX
M: 2020-11-14 20:25:11.407 YSF, received network end of transmission from BD4RBX to DG-ID 0, 8.2 seconds, 0% packet loss, BER: 0.0%
M: 2020-11-14 20:25:11.974 YSF, received network data from BG6GCL to DG-ID 0 at BI7XXX
M: 2020-11-14 20:25:22.570 YSF, received network end of transmission from BG6GCL to DG-ID 0, 10.7 seconds, 0% packet loss, BER: 0.0%
M: 2020-11-14 20:25:24.738 YSF, received network data from BH5HTC to DG-ID 0 at BI7XXX
E: 2020-11-14 20:25:24.875 No reply from the modem for some time, resetting it
M: 2020-11-14 20:25:24.876 Closing the MMDVM
M: 2020-11-14 20:25:26.876 Opening the MMDVM
E: 2020-11-14 20:25:34.830 Unable to read the firmware version after six attempts
M: 2020-11-14 20:25:35.394 Opening the MMDVM
I: 2020-11-14 20:26:08.275 This software is for use on amateur radio networks only,
I: 2020-11-14 20:26:08.275 it is to be used for educational purposes only. Its use on
I: 2020-11-14 20:26:08.276 commercial networks is strictly prohibited.
I: 2020-11-14 20:26:08.277 Copyright(C) 2015-2020 by Jonathan Naylor, G4KLX and others
M: 2020-11-14 20:26:08.277 MMDVMHost-20200809-OSTAR is starting
M: 2020-11-14 20:26:08.278 Built 18:32:20 May 16 2020 (GitID #0000000)
I: 2020-11-14 20:26:08.279 General Parameters
I: 2020-11-14 20:26:08.280 Callsign: BG7IYN
I: 2020-11-14 20:26:08.280 Id: 123456
I: 2020-11-14 20:26:08.281 Duplex: no
I: 2020-11-14 20:26:08.282 Timeout: 180s
I: 2020-11-14 20:26:08.283 D-Star: disabled
I: 2020-11-14 20:26:08.283 DMR: disabled
I: 2020-11-14 20:26:08.284 YSF: enabled
I: 2020-11-14 20:26:08.285 P25: disabled
I: 2020-11-14 20:26:08.286 NXDN: disabled
I: 2020-11-14 20:26:08.286 POCSAG: disabled
I: 2020-11-14 20:26:08.287 FM: disabled
I: 2020-11-14 20:26:08.288 Modem Parameters
I: 2020-11-14 20:26:08.288 Port: /dev/i2c-0
I: 2020-11-14 20:26:08.289 Protocol: i2c
I: 2020-11-14 20:26:08.290 i2c Address: 22
I: 2020-11-14 20:26:08.291 RX Invert: no
I: 2020-11-14 20:26:08.291 TX Invert: yes
I: 2020-11-14 20:26:08.292 PTT Invert: no
I: 2020-11-14 20:26:08.293 TX Delay: 100ms
I: 2020-11-14 20:26:08.293 RX Offset: 0Hz
I: 2020-11-14 20:26:08.294 TX Offset: 0Hz
I: 2020-11-14 20:26:08.295 RX DC Offset: 0
I: 2020-11-14 20:26:08.295 TX DC Offset: 0
I: 2020-11-14 20:26:08.296 RF Level: 100.0%
I: 2020-11-14 20:26:08.297 DMR Delay: 0 (0.0ms)
I: 2020-11-14 20:26:08.298 RX Level: 50.0%
I: 2020-11-14 20:26:08.298 CW Id TX Level: 50.0%
I: 2020-11-14 20:26:08.299 D-Star TX Level: 50.0%
I: 2020-11-14 20:26:08.300 DMR TX Level: 50.0%
I: 2020-11-14 20:26:08.301 YSF TX Level: 50.0%
I: 2020-11-14 20:26:08.301 P25 TX Level: 50.0%
I: 2020-11-14 20:26:08.302 NXDN TX Level: 50.0%
I: 2020-11-14 20:26:08.303 POCSAG TX Level: 50.0%
I: 2020-11-14 20:26:08.303 FM TX Level: 50.0%
I: 2020-11-14 20:26:08.304 TX Frequency: 434500000Hz (434500000Hz)
I: 2020-11-14 20:26:08.305 Use COS as Lockout: no
M: 2020-11-14 20:26:08.306 Opening the MMDVM
E: 2020-11-14 20:26:12.132 Invalid length received from the modem - 255 (need add i2c pullup)
E: 2020-11-14 20:26:15.906 Invalid length received from the modem - 255 (need add i2c pullup)
E: 2020-11-14 20:26:19.681 Invalid length received from the modem - 255 (need add i2c pullup)
E: 2020-11-14 20:26:21.192 Unable to read the firmware version after six attempts

M: 2020-11-14 20:21:00.794 Opening the MMDVM
I: 2020-11-14 20:21:08.276 MMDVM protocol version: 1, description: MMDVM_HS_Hat-v1.5.2 20201108 14.7456MHz ADF7021 FW by CA6JAU GitID #0000000
I: 2020-11-14 20:21:08.312 Display Parameters
I: 2020-11-14 20:21:08.313 Type: None
W: 2020-11-14 20:21:08.314 No valid display found, disabling
I: 2020-11-14 20:21:08.314 System Fusion Network Parameters
I: 2020-11-14 20:21:08.315 Local Address: 127.0.0.1
I: 2020-11-14 20:21:08.316 Local Port: 3200
I: 2020-11-14 20:21:08.317 Gateway Address: 127.0.0.1
I: 2020-11-14 20:21:08.318 Gateway Port: 4200
I: 2020-11-14 20:21:08.318 Mode Hang: 3s
M: 2020-11-14 20:21:08.319 Opening YSF network connection