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

Thread: IR Programming

Hybrid View

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

    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,393
    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 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

  3. #3
    Senior Member chill's Avatar
    Join Date
    Mar 2007
    Posts
    1,347
    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,393
    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 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

  5. #5
    Senior Member chill's Avatar
    Join Date
    Mar 2007
    Posts
    1,347
    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,347
    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.

Posting Permissions

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