Home of the Squeezebox™ & Transporter® network music players.
Results 1 to 8 of 8

Thread: IR Programming

  1. #1
    Senior Member chill's Avatar
    Join Date
    Mar 2007
    Posts
    1,222

    IR Programming

    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?

  2. #2
    Senior Member Jeff07971's Avatar
    Join Date
    Aug 2011
    Location
    London, England
    Posts
    1,378
    Quote Originally Posted by chill View Post
    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?
    Simply program lirc to send KEY_U while mute is pressed

    Jeff
    Players: SliMP3,Squeezebox3 x3,Receiver,SqueezeLite-X,PiCorePlayer x3
    Server: LMS Version: Latest Nightly on Centos 7.6 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

  3. #3
    Senior Member chill's Avatar
    Join Date
    Mar 2007
    Posts
    1,222
    Quote Originally Posted by Jeff07971 View Post
    Simply program lirc to send KEY_U while mute is pressed

    Jeff
    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.

  4. #4
    Senior Member Jeff07971's Avatar
    Join Date
    Aug 2011
    Location
    London, England
    Posts
    1,378
    Quote Originally Posted by chill View Post
    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.
    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.csv
    Last 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 7.6 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

  5. #5
    Senior Member chill's Avatar
    Join Date
    Mar 2007
    Posts
    1,222
    Quote Originally Posted by Jeff07971 View Post
    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 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
    So I assumed that if I just wanted to add KEY_U to the end of the codes list, then the remote would have to be outputting codes with the same number of bits, same header etc. Since the Squeezebox remote seems to be based on JVC remotes, I was looking for the JVC remote that most closely matches the format of the Squeezebox 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.

  6. #6
    Senior Member chill's Avatar
    Join Date
    Mar 2007
    Posts
    1,222
    Quote Originally Posted by chill View Post
    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.
    I've just seen your edit, and that's what you said, so I'm on the right path.

  7. #7
    Senior Member Jeff07971's Avatar
    Join Date
    Aug 2011
    Location
    London, England
    Posts
    1,378
    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

    Jeff
    Players: SliMP3,Squeezebox3 x3,Receiver,SqueezeLite-X,PiCorePlayer x3
    Server: LMS Version: Latest Nightly on Centos 7.6 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

  8. #8
    Senior Member chill's Avatar
    Join Date
    Mar 2007
    Posts
    1,222
    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
    Coincidence? I doubt it, not with a name that includes 'Slim'. In addition, the mute key outputs a signal, although the lircd.conf file doesn't know what to do with that signal initially.

    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
    Clearly the last two bytes (16 bits) are common. And then I noticed a couple of lines in the header section of the original lircd.conf file:
    Code:
      pre_data_bits   16
      pre_data       0x7689
    So in fact the Squeezebox remote is sending 32-bit codes after all, but the first 16 bits are always 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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •