Saturday, December 16, 2017

Hmm. This is not easy.

One of the main issues arising from user testing on v0.1.1 was the fact that the LMS plug-in was not shutting down properly and thus locked LMS and prevented it from closing cleanly.

Looking into this in more detail, I found the that perl HTTP::Daemon was misbehaving and refusing to stop when asked politely. I changed to the Mojolicious Mojo::Server running as a deamon and this appeared to be much better behaved, facilitating clean LMS shutdowns.

In testing prior to release, however, it seems that's another issue raising it's head: the http daemon seems to be interfering with squeezebox connections to the LMS.

Now, the daemon is an essential part of the architecture as it listens out for commands from the skill and processes them, making requests to the LMS etc.

When the Mojo::Server is switched on, clients sometimes won't connect and, if they do, they appear and disappear from the LMS with alarming frequency. I've even had scenarios where a player is connected to an LMS and playing music but the LMS denies all knowledge of it's existence. Switching off the plugin (and hence the httpd proxy) returns operations to normal.

I now need to switch out Mojo::Server and go for another http daemon to ascertain if it's that particular implementation or something else that's causing the trouble.

In addition, it's now clear that there's another problem - I can't make HTTPS requests from within the plugin :-(

The plugin design relies on http requests from the skill to the proxy which then makes https requests back to the skill to determine what commands are required. In this way, all communications, apart from an init command, would take place over https.

However, it transpires that HTTPS support for the version of perl used in the LMS  requires the older Crypt::SSLeay library which is not included. Unfortunately, this library requires compiled dlls per platform and perl version. This introduces a significant layer of complexity for plugin distribution.

I've dropped back to http communications throughout which is far from ideal. This is yet another area that requires further work.

I must say, I'm finding it frustrating to work in perl. I think the main issue is that I'm trying to work inside the LMS runtime instance and that imposes limitations and restrictions.

It's going to be several more days if not weeks before I have something stable enough to release, I think.

 

Login Form

About Hab-Tunes

Hab-Tunes is an in-development skill for the Amazon Echo that allows voice control of Squeezebox devices. This site is intended to document the skill development and help give some idea of progress.

Follow Updates

Search #habtunes on twitter

Want to Help?

If you can contribute time, skills or ideas, find out how you can get involved.

Cron Job Starts