I'm hoping someone can summarise how to make an infrared remote control perform a specified function on a Squeezebox player.
My scenario:
I've just bought a 'oneforall' 4-in-1 remote control. The TV and satellite receiver setup were easy, using the standard codes for the brands. My amplifier (a home-build using a Hypex DLCP) was easily set up on the 'AMP' button using the remote's learning function, as was my RPi (running pCP and LIRC) on the 'DVD' button. But there are some functions that I'd like to programme that are not present on either of my Squeezebox remotes, so my oneforall can't 'learn' them.
As an example, I'd like to programme the mute key to set the playback volume to zero. I've done this previously using a button press on one of the RPi's GPIO pins, so I know that the ["mixer","volume","0"] command does what I need.
So I think there are two steps:
1) Find out what code is transmitted by the mute key when my remote is set to 'DVD'. I can vary this somewhat by selecting different DVD brands, but I can't assign a specific code to the mute key, so I believe the correct approach is to first detect the code that's transmitted, then
2) tell LMS to set ["mixer","volume","0"] in response to that code.
I'm pretty sure there's info on step 2 available in this forum, so I'll dig that out, but is there an easy way to get LMS to tell me what code it detected when I pressed the mute key?
Results 1 to 8 of 8
Thread: IR Programming
-
2019-03-13, 08:27 #1
IR Programming
-
2019-03-13, 09:23 #2Players: SliMP3,Squeezebox3 x3,Receiver,SqueezeLite-X,PiCorePlayer x3
Server: LMS Version: Latest Nightly on Centos 8.0 VM on ESXi 6.5.0U3 on Dell T320
Plugins: AutoRescan/BBCiPlayer/PowerSave/PowerSwitchIII/Squeezecloud/Spotty/Player Groups
Remotes: iPeng9/Orangesqueeze/PC/Jivelite/SqueezeLite-X
Music: 522GB,1.5K albums with 25K songs by 5K artists mostly FLACs
Want a webapp ? See http://forums.slimdevices.com/showth...Webapp-for-LMS
-
2019-03-13, 09:48 #3
Thank you - so KEY_U = mute, the equivalent of ["mixer","volume","0"] ?
I'm currently experimenting with irrecord on the RPi, to find out which code is sent by the mute key, and I've found that the default device on the DVD button sends codes in a slightly different format from the squeezebox remote (20 bits versus 16, different header etc). So having now learnt that the Squeezebox remote uses JVC codes, I'm working through the list of JVC DVD devices on the oneforall to find one that a) uses a similar format to the Squeezebox remote and b) outputs something when the mute key is pressed. The first JVC code, 0623, seems to operate most functions, but unfortunately has nothing programmed on the mute key.
-
2019-03-13, 09:55 #4
I'm not sure I get what you trying to do with changing codes (JVC) you can program irrecord to respond to virtually any code type.
I use SB3, Justboom, SONY, and "MX Box" remotes and then program lirc to send the command I want the button to do.
According to Ralphy's jivekeys.csv KEY_U or "u" is Mute and silences the output, not sure how it does it.
https://github.com/ralph-irving/tcz-...r/jivekeys.csv
Jeff
Edit: Realised I wasn't clear on the 'codes' part. Just select a code set that uses all the buttons you wish to and then use lirc to map the keys to the command you want in jivekey.csvLast edited by Jeff07971; 2019-03-13 at 10:06.
Players: SliMP3,Squeezebox3 x3,Receiver,SqueezeLite-X,PiCorePlayer x3
Server: LMS Version: Latest Nightly on Centos 8.0 VM on ESXi 6.5.0U3 on Dell T320
Plugins: AutoRescan/BBCiPlayer/PowerSave/PowerSwitchIII/Squeezecloud/Spotty/Player Groups
Remotes: iPeng9/Orangesqueeze/PC/Jivelite/SqueezeLite-X
Music: 522GB,1.5K albums with 25K songs by 5K artists mostly FLACs
Want a webapp ? See http://forums.slimdevices.com/showth...Webapp-for-LMS
-
2019-03-13, 10:11 #5
I was hoping to just add one key to the existing lircd.conf file. That file is configured for the original Squeezebox remote:
Code:begin remote name Slim_Devices_Squeezebox3 bits 16 flags SPACE_ENC|CONST_LENGTH eps 30 aeps 100 header 9100 4416 one 649 1593 zero 647 473 ptrail 649 pre_data_bits 16 pre_data 0x7689 gap 107995 min_repeat 1 suppress_repeat 6 toggle_bit_mask 0x0 begin codes KEY_VOLUMEDOWN 0x00FF KEY_VOLUMEUP 0x807F KEY_REWIND 0xC03F KEY_FORWARD 0xA05F KEY_PAUSE 0x20DF KEY_PLAY 0x10EF KEY_POWER 0x40BF end codes end remote
I think the alternative is to completely replace the lircd.conf file with one that suits the data format and key codes of my remote, and I think that's what I'll end up doing. But the secondary problem is that some device codes in the oneforall don't output any signal for some buttons - for instance the '0623' code (one of the JVC DVD codes) doesn't output anything when the mute key is pressed.
So I'll start with a oneforall device setting that produces output on all the keys I want, and then I'll record the IR codes for those keys and map them to the functions I want in LMS.
-
2019-03-13, 10:12 #6
-
2019-03-13, 10:19 #7
Ah yes I see what you are trying to do !
I tried that and never got it to work properly for an unkown reason.
In the end I just used irrecord to do make a whole new conf file which worked fine
JeffPlayers: SliMP3,Squeezebox3 x3,Receiver,SqueezeLite-X,PiCorePlayer x3
Server: LMS Version: Latest Nightly on Centos 8.0 VM on ESXi 6.5.0U3 on Dell T320
Plugins: AutoRescan/BBCiPlayer/PowerSave/PowerSwitchIII/Squeezecloud/Spotty/Player Groups
Remotes: iPeng9/Orangesqueeze/PC/Jivelite/SqueezeLite-X
Music: 522GB,1.5K albums with 25K songs by 5K artists mostly FLACs
Want a webapp ? See http://forums.slimdevices.com/showth...Webapp-for-LMS
-
2019-03-13, 16:26 #8
A couple of points for completeness, in case anyone visits this thread in the future.
1) I'm running pCP without Jivelite, so KEY_U doesn't work - it's a Jivelite-specific key mapping. For running headless, the equivalent is KEY_MUTE.
2) In the list of DVD remotes that came with the oneforall remote, there's a brand 'Slim Art', with a single device code of 0770. Setting the remote up to use this device code instantly gave all of the commands defined in the default lircd.conf file:
Code:KEY_VOLUMEDOWN 0x00FF KEY_VOLUMEUP 0x807F KEY_REWIND 0xC03F KEY_FORWARD 0xA05F KEY_PAUSE 0x20DF KEY_PLAY 0x10EF KEY_POWER 0x40BF
So I went through the whole irrecord procedure, and found that the Slim Art remote is outputting 32-bit codes. I thought it odd that a 32-bit remote was successfully sending 16-bit codes, so I took a closer look at the original lircd.conf file and compared the codes (above) with those captured from the 32-bit Slim Art configuration:
Code:KEY_VOLUMEDOWN 0x768900FF KEY_VOLUMEUP 0x7689807F KEY_REWIND 0x7689C03F KEY_FORWARD 0x7689A05F KEY_PAUSE 0x768920DF KEY_PLAY 0x768910EF KEY_POWER 0x768940BF KEY_MUTE 0x00FF10EF
Code:pre_data_bits 16 pre_data 0x7689
The mute key is different though, so I simply commented out the 'pre_data_bits' and 'pre_data' lines in the original file, changed the 'bits' to 32, inserted 0x7689 in front of each code, and added KEY_MUTE=0x00FF10EF.
Bingo - the oneforall now has a mute function*. I'll now see if I can find any other useful functions that Squeezelite already recognises (i.e. which I can implement without having to mess with the .lircrc file).
*EDIT: And of course, the benefit of using the 'Slim Art' device setting and just tweaking the original lircd.conf, rather than creating a whole new one, is that the original Squeezebox remotes still work.Last edited by chill; 2019-03-13 at 16:55.