Bug 17984 - Certain buttons don't work with Perl 5.16
: Certain buttons don't work with Perl 5.16
Status: RESOLVED DUPLICATE of bug 17985
Product: Logitech Media Server
Classification: Unclassified
Component: Misc
: 7.7.2
: PC Linux (other)
: -- normal with 2 votes (vote)
: ---
Assigned To: Unassigned bug - please assign me!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-06-26 15:19 UTC by Renophaston
Modified: 2012-07-05 00:35 UTC (History)
2 users (show)

See Also:
Category: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Renophaston 2012-06-26 15:19:44 UTC
After upgrading Perl to 5.16 on Arch Linux, certain buttons in various interfaces stopped working. For instance:
* Next/Previous/Pause from the web interface
* Next/Previous from the IR remote control
* Next/Previous from the Touch's screen

Most buttons work, and if I send for instance "$PLAYERID button jump_fwd" to the CLI via Telnet, it works, but the same command via the web using JSON ({"id":1, "method":"slim.request","params":["$PLAYERID",["button","jump_fwd"]]}) does NOT work.

I found that the buttons that were broken were sending empty strings in places where the working ones were sending undefs:

BROKEN:
[12-06-05 21:15:46.9474] Slim::Control::Request::dump (2374) Request: Command [$PLAYERID->button] from /024d0a29/slim/request|138||024d0a29  (Dispatchable)
[12-06-05 21:15:46.9493] Slim::Control::Request::dump (2376)    Param: [_orFunction] = []
[12-06-05 21:15:46.9511] Slim::Control::Request::dump (2376)    Param: [_buttoncode] = [jump_fwd]
[12-06-05 21:15:46.9529] Slim::Control::Request::dump (2376)    Param: [_time] = []

WORKING:
[12-06-05 21:16:21.4634] Slim::Control::Request::dump (2374) Request: Command [$PLAYERID->button] from CLI  (Dispatchable)
[12-06-05 21:16:21.4652] Slim::Control::Request::dump (2376)    Param: [_buttoncode] = [jump_fwd]
[12-06-05 21:16:21.4670] Slim::Control::Request::dump (2376)    Param: [_time] = undef
[12-06-05 21:16:21.4689] Slim::Control::Request::dump (2376)    Param: [_orFunction] = undef

So what I did was change the return line in getParam in Slim/Control/Request.pm from
* return $_[0]->{'_params'}->{ $_[1] };
to
* return ($_[0]->{'_params'}->{ $_[1] } ne '') ? $_[0]->{'_params'}->{ $_[1] } : undef;
and now everything seems to work perfectly, but I'm sure I'm treating a symptom rather than the disease.  Also I don't see anything in the perldelta that would explain this coming up now and not earlier, but I don't really know Perl.  The only other people I've seen with this problem are Arch users, but that might just be because Arch adopted Perl 5.16 earlier than others.  There's a thread about the problem here: http://forums.slimdevices.com/showthread.php?95408-perl-7-16 and the Arch package page is here: https://aur.archlinux.org/packages.php?ID=53691

Like I said, I've managed a fix, but this might pop up in other distros in the future (unless its an Arch quirk causing the problem), so I hope this is helpful.

Sorry if the formatting is all wonky; this is my first bug report.
Comment 1 Marco Schinkel 2012-07-03 09:54:04 UTC
*** This bug has been confirmed by popular vote. ***
Comment 2 Marco Schinkel 2012-07-03 09:55:59 UTC
Please fix the media server to make it work with 5.16.
Comment 3 Michael Herger 2012-07-05 00:35:14 UTC

*** This bug has been marked as a duplicate of bug 17985 ***