Thanks for yours fast responses.
I installed the default image and the audio works well.
But now, i have a new issue: my python script used to handle the power button doesn't work (it worked fine with the mainly image) and it is very boring because the power led on top of the case stay on even if the board is off.
Here is my script:
#!/usr/bin/python
import RPi.GPIO as GPIO
import time
import os,sys
import signal
#GPIO.setwarnings(False)
GPIO.setmode(GPIO.BOARD)
GPIO.setup(31,GPIO.OUT)
GPIO.setup(33,GPIO.IN)
GPIO.output(31,GPIO.LOW)
def shutdown_system(channels):
os.system("sync")
time.sleep(1)
os.system("shutdown -h now")
sys.exit()
GPIO.add_event_detect(33,GPIO.RISING,callback=shutdown_system)
while True:
time.sleep(1)
When i execute the script:
This channel is already in use, continuing anyway. Use GPIO.setwarnings(False) to disable warnings.This channel is already in use, continuing anyway. Use GPIO.setwarnings(False) to disable warnings.new gpio = 238
Traceback (most recent call last):
File "/usr/share/PiDesktop/python/restart.py", line 22, in <module>
GPIO.add_event_detect(33,GPIO.RISING,callback=shutdown_system)
RuntimeError: Failed to add edge detection
Pin 31 is really configured as an output and pin 33 as an input as showed below:
root@tinkerboard:/home/willy# gpio readall
+-----+-----+---------+------+---+--Tinker--+---+------+---------+-----+-----+
| CPU | wPi | Name | Mode | V | Physical | V | Mode | Name | wPi | CPU |
+-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+
| | | 3.3v | | | 1 || 2 | | | 5v | | |
| 252 | 8 | SDA.1 | | 1 | 3 || 4 | | | 5V | | |
| 253 | 9 | SCL.1 | | 1 | 5 || 6 | | | 0v | | |
| 17 | 7 | GPIO0C1 | IN | 0 | 7 || 8 | 1 | SERL | TxD1 | 15 | 161 |
| | | 0v | | | 9 || 10 | 1 | SERL | RxD1 | 16 | 160 |
| 164 | 0 | GPIO5B4 | IN | 1 | 11 || 12 | 0 | | GPIO6A0 | 1 | 184 |
| 166 | 2 | GPIO5B6 | SERL | 1 | 13 || 14 | | | 0v | | |
| 167 | 3 | GPIO5B7 | SERL | 1 | 15 || 16 | 1 | IN | GPIO5B2 | 4 | 162 |
| | | 3.3v | | | 17 || 18 | 1 | IN | GPIO5B3 | 5 | 163 |
| 257 | 12 | MOSI1 | | 0 | 19 || 20 | | | 0v | | |
| 256 | 13 | MISO1 | | 1 | 21 || 22 | 0 | IN | GPIO5C3 | 6 | 171 |
| 254 | 14 | SCLK1 | | 1 | 23 || 24 | 1 | | CE0 | 10 | 255 |
| | | 0v | | | 25 || 26 | 1 | | CE1 | 11 | 251 |
| 233 | 30 | SDA.2 | | 1 | 27 || 28 | 1 | | SCL.2 | 31 | 234 |
| 165 | 21 | GPIO5B5 | IN | 1 | 29 || 30 | | | 0v | | |
| 168 | 22 | GPIO5C0 | OUT | 0 | 31 || 32 | 1 | SERL | GPIO7C7 | 26 | 239 |
| 238 | 23 | GPIO7C6 | IN | 0 | 33 || 34 | | | 0v | | |
| 185 | 24 | GPIO6A1 | | 0 | 35 || 36 | 1 | SERL | GPIO7A7 | 27 | 223 |
| 224 | 25 | GPIO7B0 | SERL | 1 | 37 || 38 | 0 | | GPIO6A3 | 28 | 187 |
| | | 0v | | | 39 || 40 | 0 | | GPIO6A4 | 29 | 188 |
+-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+
| CPU | wPi | Name | Mode | V | Physical | V | Mode | Name | wPi | CPU |
+-----+-----+---------+------+---+--Tinker--+---+------+---------+-----+-----+
Here is a part of the kern.log file after executing the script:
Mar 6 15:12:19 localhost kernel: [ 611.528620] ------------[ cut here ]------------
Mar 6 15:12:19 localhost kernel: [ 611.528670] WARNING: CPU: 1 PID: 3450 at drivers/gpio/gpiolib.c:85 gpio_to_desc+0x68/0xbc()
Mar 6 15:12:19 localhost kernel: [ 611.528680] invalid GPIO 238
Mar 6 15:12:19 localhost kernel: [ 611.528688] Modules linked in: zram lz4_decompress lz4_compress 8723bs uas
Mar 6 15:12:19 localhost kernel: [ 611.528724] CPU: 1 PID: 3450 Comm: restart.py Not tainted 4.4.119-rockchip #4
Mar 6 15:12:19 localhost kernel: [ 611.528733] Hardware name: Rockchip (Device Tree)
Mar 6 15:12:19 localhost kernel: [ 611.528765] [<c0110104>] (unwind_backtrace) from [<c010bde8>] (show_stack+0x20/0x24)
Mar 6 15:12:19 localhost kernel: [ 611.528789] [<c010bde8>] (show_stack) from [<c05bcd70>] (dump_stack+0x84/0xa4)
Mar 6 15:12:19 localhost kernel: [ 611.528809] [<c05bcd70>] (dump_stack) from [<c011e104>] (warn_slowpath_common+0x98/0xc4)
Mar 6 15:12:19 localhost kernel: [ 611.528828] [<c011e104>] (warn_slowpath_common) from [<c011e170>] (warn_slowpath_fmt+0x40/0x48)
Mar 6 15:12:19 localhost kernel: [ 611.528847] [<c011e170>] (warn_slowpath_fmt) from [<c05f4bb8>] (gpio_to_desc+0x68/0xbc)
Mar 6 15:12:19 localhost kernel: [ 611.528867] [<c05f4bb8>] (gpio_to_desc) from [<c05f6d54>] (export_store+0x3c/0xe0)
Mar 6 15:12:19 localhost kernel: [ 611.528889] [<c05f6d54>] (export_store) from [<c0709d58>] (class_attr_store+0x28/0x34)
Mar 6 15:12:19 localhost kernel: [ 611.528909] [<c0709d58>] (class_attr_store) from [<c02abc34>] (sysfs_kf_write+0x48/0x54)
Mar 6 15:12:19 localhost kernel: [ 611.528927] [<c02abc34>] (sysfs_kf_write) from [<c02ab14c>] (kernfs_fop_write+0x150/0x19c)
Mar 6 15:12:19 localhost kernel: [ 611.528947] [<c02ab14c>] (kernfs_fop_write) from [<c023ed6c>] (__vfs_write+0x3c/0xe4)
Mar 6 15:12:19 localhost kernel: [ 611.528967] [<c023ed6c>] (__vfs_write) from [<c023f520>] (vfs_write+0xbc/0x144)
Mar 6 15:12:19 localhost kernel: [ 611.528986] [<c023f520>] (vfs_write) from [<c023fc60>] (SyS_write+0x50/0x88)
Mar 6 15:12:19 localhost kernel: [ 611.529006] [<c023fc60>] (SyS_write) from [<c0107600>] (ret_fast_syscall+0x0/0x48)
Mar 6 15:12:19 localhost kernel: [ 611.529046] ---[ end trace d2b3067e9760c78b ]---
Mar 6 15:12:19 localhost kernel: [ 611.529057] export_store: invalid GPIO 238
Do you have an idea of the problem or does i need to come back to the mainline image and wait for the audio fix to become available ?
Thanks,
Willy.