added files

This commit is contained in:
Jeremy Kidwell 2022-10-01 13:43:36 +01:00
parent 225404d81d
commit b9d17b6712
8 changed files with 227 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

View File

@ -0,0 +1,49 @@
begin
remote = Apple_A1156
button = KEY_UP
repeat = 0
prog = squeezelite
config = volup
end
begin
remote = Apple_A1156
button = KEY_DOWN
repeat = 0
prog = squeezelite
config = voldown
end
begin
remote = Apple_A1156
button = KEY_LEFT
repeat = 0
prog = squeezelite
config = rew
end
begin
remote = Apple_A1156
button = KEY_RIGHT
repeat = 0
prog = squeezelite
config = fwd
end
# the A1156 lircd.conf maps ">||" (center button) to KEY_PAUSE
begin
remote = Apple_A1156
button = KEY_PAUSE
repeat = 0
prog = squeezelite
config = pause
end
# The "menu" key does power
begin
remote = Apple_A1156
button = KEY_ESC
repeat = 0
prog = squeezelite
config = power
end

View File

@ -0,0 +1,56 @@
begin
remote = Apple_A1294
button = KEY_UP
repeat = 0
prog = squeezelite
config = volup
end
begin
remote = Apple_A1294
button = KEY_DOWN
repeat = 0
prog = squeezelite
config = voldown
end
begin
remote = Apple_A1294
button = KEY_LEFT
repeat = 0
prog = squeezelite
config = rew
end
begin
remote = Apple_A1294
button = KEY_RIGHT
repeat = 0
prog = squeezelite
config = fwd
end
begin
remote = Apple_A1294
button = KEY_OK
repeat = 0
prog = squeezelite
config = pause
end
# The "menu" key does power
begin
remote = Apple_A1294
button = KEY_ESC
repeat = 0
prog = squeezelite
config = power
end
begin
remote = Apple_A1294
button = KEY_PLAY
repeat = 0
prog = squeezelite
config = play
end

View File

@ -0,0 +1,30 @@
Note: I've taken this, with thanks from @hartzell. All notes below are theirs:
# Setup
This describes getting a silver apple remote (A1294) working with a headless piCorePlayer. It requires `v5.0.0`, which includes fixes for how `squeezelite` is called so that it finds the `~tc/.lircrc` file.
I'm using it with an IQaudio DAC+ with a 3-pin header soldered into the appropriate holes.
LIRC has a git repository, [lirc git repo][lirc-git], but unfortunately its web-based git browser isn't working. If you clone the repo, you'll find a [configuration document][lirc-config] that's interesting reading.
The [LIRC project web site][lirc] includes a database of `lircd.conf` files for various remotes that includes entries for the silver and white apple remotes. **BUT**, they're for an older version of LIRC and don't work with the piCorePlayer version. I found functional versions on the net for the [A1294][lirc-a1294] and the [A1156][lirc-1156] (*untested).
[Squeezelite][squeezelite] uses the [lirc_client][lirc-client] API to interact with LIRC. It compares events that it receives with a set of cmds from the "squeezeplayer" remote and then from a table populated from a `.lircrc` file. When piCorePlayer has LIRC installed and you've uploaded a custom `lircrc` file, squeezeplayer is run with the `-i /home/tc/.lircrc` option.
# Debugging
1. use `sudo mode2 -d /dev/lirc0` to see the raw events coming from LIRC. This is the lowest-ish level and will confirm that you have the kernel bits in place and the hardware wired up correctly.
2. use `irw` to dump the higher level events (e.g. `KEY_OK`), which confirms that you have a `lircd.conf` file that works for your device.
3. enable ir debug (or sdebug?) output in the piCorePlayer squeezelite page and watch the log file (e.g. ssh into the pi at `tc` and `tail -f /var/log/pcp_squeezelite.log`) to see what squeezelite is doing with the events.
[lirc]: http://www.lirc.org/
[lirc-git]: http://www.lirc.org/git.html
[lirc-client]: http://www.lirc.org/html/lirc_client.html
[lirc-config]: file:///Users/hartzell/tmp/lirc/doc/html-source/configuration-guide.html
[squeezelite]: https://github.com/ralph-irving/squeezelite
[squeezelite-ir]: https://github.com/ralph-irving/squeezelite/blob/master/ir.c#L137-L180
[pcp-lirc]: https://github.com/ralph-irving/tcz-lirc
[lirc-a1294]: https://github.com/osmc/osmc/blob/master/package/remote-osmc/files/etc/lirc/apple-silver-A1294-lircd.conf
[lirc-a1156]: https://github.com/osmc/osmc/blob/master/package/remote-osmc/files/etc/lirc/apple-white-A1156-lircd.conf

View File

@ -0,0 +1,40 @@
# hacked by Jeremy Kidwell
#
# brand: Apple
# model no. of remote control: A1156
# devices being controlled by this remote: new (late 2006) MacBook
#
# This config files are for non-Apple receivers only.
# Use the lircd.conf.macmini file when you are using the Apple receiver.
#
begin remote
name Apple_A1156
bits 8
flags SPACE_ENC
eps 30
aeps 100
header 9065 4484
one 574 1668
zero 574 547
ptrail 567
repeat 9031 2242
pre_data_bits 16
pre_data 0x77E1
post_data_bits 8
post_data 0xC5
gap 37600
toggle_bit 0
ignore_mask 0x80ff
begin codes
KEY_PAUSE 0x20
KEY_VOLUMEDOWN 0xB0
KEY_VOLUMEUP 0xD0
KEY_NEXT 0xE0
KEY_PREVIOUS 0x10
end codes
end remote

View File

@ -0,0 +1,52 @@
#
# I found this via searching the Intertubes, here:
# https://github.com/osmc/osmc/blob/master/package/remote-osmc/files/etc/lirc/apple-silver-A1294-lircd.conf
#
# See also:
# https://github.com/osmc/osmc/blob/master/package/remote-osmc/files/etc/lirc/apple-white-A1156-lircd.conf
#####
# Please make this file available to others
# by sending it to <lirc@bartelmus.de>
#
# this config file was automatically generated
# using lirc-0.9.0(default) on Tue Jun 2 22:56:05 2015
#
# contributed by DBMandrake
#
# brand: Apple
# model no. of remote control: A1294 (silver)
# devices being controlled by this remote:
#
begin remote
name Apple_A1294
bits 8
flags SPACE_ENC|CONST_LENGTH
eps 30
aeps 100
header 9140 4510
one 633 1666
zero 633 537
ptrail 631
repeat 9137 2220
pre_data_bits 16
pre_data 0x77E1
post_data_bits 8
post_data 0x2C
gap 108756
toggle_bit_mask 0x0
ignore_mask 0x80ff
begin codes
KEY_UP 0x50
KEY_DOWN 0x30
KEY_LEFT 0x90
KEY_RIGHT 0x60
KEY_OK 0x3A 0xA0
KEY_ESC 0xC0
KEY_PLAY 0xFA 0xA0
end codes
end remote

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

Binary file not shown.