Bug 13621 - Enable RAWI on Squeezebox hardware
: Enable RAWI on Squeezebox hardware
Status: RESOLVED WORKSFORME
Product: SB 2/3
Classification: Unclassified
Component: Slimproto
: unspecified
: All All
: -- enhancement (vote)
: ---
Assigned To: Unassigned bug - please assign me!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-08-23 22:06 UTC by Manoj Kasichainula
Modified: 2009-08-24 07:18 UTC (History)
1 user (show)

See Also:
Category: Feature


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Manoj Kasichainula 2009-08-23 22:06:23 UTC
I just figured I'd make a more "official" feature request for what's in:

http://forums.slimdevices.com/showthread.php?t=63872

If the hardware supports it, I'd like to be able to get the raw infrared codes ouf of Squeezebox hardware. It looks like this was once supported with "RAWI" in SlimProto, but that command isn't sent anymore by devices (or at least the newer ones I have, a SB3 and Boom).

With this, I could build better LIRC support and not require another infrared receiver in front of my TV. I have something that works now, but it's harder to configure out of the box because it doesn't work with existing lircd.conf syntax. I'd like to just receive the packets and shove them directly into lircd (or even have the squeezebox itself do it, though that's probably a much larger change). I worry about the lag from going squeezebox -> squeezecenter -> lircd -> app but I hope it won't be much worse than current squeezebox lag which is fine for me.

Thanks.
Comment 1 James Richardson 2009-08-24 06:03:11 UTC
Felix: Is this possible?
Comment 2 Felix Mueller 2009-08-24 07:18:46 UTC
James: Yes, it is. It is disabled by default because it can generate quite some traffic. But it can be enable from a SC plugin just fine. See IR Blaster plugin - switchIRRepeaterStatus().

First a plugin needs to register a callback function to receive RAWI data then it needs to tell the player to actually send them. That is achieved by sending a 'ilrn' command with one parameter about how many packets one would like to receive (max. 255).

sub switchIRRepeaterStatus {
  my $class = shift;
  my $client = shift;
  my $status = shift;
	
  if( $status eq "on") {
    # Check if function is available
    if( UNIVERSAL::can( "Slim::Networking::Slimproto","setCallbackRAWI")) {
      Slim::Networking::Slimproto::setCallbackRAWI( \&RAWICallbackIRRepeat);
    }
  }
  if( $status eq "off") {
    # Check if function is available
    if( UNIVERSAL::can( "Slim::Networking::Slimproto","clearCallbackRAWI")) {
      Slim::Networking::Slimproto::clearCallbackRAWI( \&RAWICallbackIRRepeat);
    }
  }
  if( ( $status eq "on") || ( $status eq "more")) {
    # Ask SB2/SB3 or Transporter to send 10 ir codes (containing x samples)
    my $num_codes = pack( 'C', 10);
    $client->sendFrame( 'ilrn', \$num_codes);
  }
}