I am getting several errors while running Janos. I'm not sure what happens, but either my play 3 isn't supported and the system crashes whenever I add it to a group, or there is something wrong with the grouping itself.
Steps to recreate on my system:
1. have no groups
2. open Janos
3. See my play 5, but not my play 3
4. See error 1. in the console.
5. add the play 3 to the group (with different controller)
6. see error 2 and a crash.
7. Janos doesn't start anymore
8. remove play 3 from group (other controller again)
9. Janos starts again.
My system:
* ubuntu 12.10 with OpenJDK 7
* Newest Janos (0.5.2) from sourcefourge
* Play 3, Play 5 and Bridge
Error 1: (among a lot of other output by the way, can paste more, but this seems the only real error. It does repeat itself once in a while)
JANOS: 29587 [SonosControllerThread] ERROR net.sf.janos.control.SonosController - Couldn't add zoneurn:schemas-upnp-org:device:ZonePlayer:1 Sonos PLAY:3 Sonos PLAY:3 S3
java.lang.NullPointerException
at net.sf.janos.control.AbstractService.<init>(AbstractService.java:55)
at net.sf.janos.control.AudioInService.<init>(AudioInService.java:38)
at net.sf.janos.control.ZonePlayer.<init>(ZonePlayer.java:82)
at net.sf.janos.control.SonosController.addZonePlayer(SonosController.java:230)
at net.sf.janos.control.SonosController.access$000(SonosController.java:57)
at net.sf.janos.control.SonosController$DiscoveryHandler$3.run(SonosController.java:113)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
error 2: i'm not sure what the real culprint is, but these are the dying words:
JANOS: 11715 [SonosControllerThread] INFO net.sf.janos.control.ContentDirectoryService - ContentDirectory Event: ContainerUpdateIDs=Q:0,3
java.lang.NullPointerException
at net.sf.janos.ui.ZoneGroupVolumeControl$GetVolumeFromHWOperator.operate(ZoneGroupVolumeControl.java:321)
at net.sf.janos.ui.ZoneGroupVolumeControl$subZoneOperator.iterate(ZoneGroupVolumeControl.java:298)
at net.sf.janos.ui.ZoneGroupVolumeControl$GetVolumeFromHWOperator.iterate(ZoneGroupVolumeControl.java:315)
at net.sf.janos.ui.ZoneGroupVolumeControl$1.getVolume(ZoneGroupVolumeControl.java:106)
at net.sf.janos.ui.VolumeControl.<init>(VolumeControl.java:77)
at net.sf.janos.ui.ZoneGroupVolumeControl$1.<init>(ZoneGroupVolumeControl.java:84)
at net.sf.janos.ui.ZoneGroupVolumeControl.<init>(ZoneGroupVolumeControl.java:82)
at net.sf.janos.ui.ZoneControl.<init>(ZoneControl.java:68)
at net.sf.janos.ui.ZoneControlList.addZone(ZoneControlList.java:186)
at net.sf.janos.ui.ZoneControlList.changeZone(ZoneControlList.java:281)
at net.sf.janos.ui.ZoneControlList$3.run(ZoneControlList.java:160)
at org.eclipse.swt.widgets.RunnableLock.run(Unknown Source)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Unknown Source)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Unknown Source)
at org.eclipse.swt.widgets.Display.readAndDispatch(Unknown Source)
at net.sf.janos.ui.SonosControllerShell.start(SonosControllerShell.java:53)
at net.sf.janos.Janos.run(Janos.java:96)
at net.sf.janos.Janos.main(Janos.java:67)
java.lang.NullPointerException
at net.sf.janos.ui.ZoneGroupVolumeControl$AddListenersOperator.operate(ZoneGroupVolumeControl.java:376)
at net.sf.janos.ui.ZoneGroupVolumeControl$subZoneOperator.iterate(ZoneGroupVolumeControl.java:298)
at net.sf.janos.ui.ZoneGroupVolumeControl.<init>(ZoneGroupVolumeControl.java:176)
at net.sf.janos.ui.ZoneControl.<init>(ZoneControl.java:68)
at net.sf.janos.ui.ZoneControlList.addZone(ZoneControlList.java:186)
at net.sf.janos.ui.ZoneControlList.changeZone(ZoneControlList.java:281)
at net.sf.janos.ui.ZoneControlList$3.run(ZoneControlList.java:160)
at org.eclipse.swt.widgets.RunnableLock.run(Unknown Source)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Unknown Source)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Unknown Source)
at org.eclipse.swt.widgets.Display.readAndDispatch(Unknown Source)
at net.sf.janos.ui.SonosControllerShell.start(SonosControllerShell.java:53)
at net.sf.janos.Janos.run(Janos.java:96)
at net.sf.janos.Janos.main(Janos.java:67)
(Janos:7840): Gtk-CRITICAL **: IA__gtk_widget_map: assertion `gtk_widget_get_visible (widget)' failed
JANOS: 11886 [main] FATAL net.sf.janos.Janos - Error running Janos
org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.NullPointerException)
at org.eclipse.swt.SWT.error(Unknown Source)
at org.eclipse.swt.SWT.error(Unknown Source)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Unknown Source)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Unknown Source)
at org.eclipse.swt.widgets.Display.readAndDispatch(Unknown Source)
at net.sf.janos.ui.SonosControllerShell.start(SonosControllerShell.java:53)
at net.sf.janos.Janos.run(Janos.java:96)
at net.sf.janos.Janos.main(Janos.java:67)
Caused by: java.lang.NullPointerException
at net.sf.janos.ui.ZoneControlList.addZone(ZoneControlList.java:225)
at net.sf.janos.ui.ZoneControlList.changeZone(ZoneControlList.java:281)
at net.sf.janos.ui.ZoneControlList$3.run(ZoneControlList.java:160)
at org.eclipse.swt.widgets.RunnableLock.run(Unknown Source)
... 6 more
Same error here (error 1).
Using Java 7 on Ubuntu 12.04, with 1 Sonos bridge and 1 Sonos Play 3.
jim@toaster:~$ java -version
java version "1.7.0_21"
Java(TM) SE Runtime Environment (build 1.7.0_21-b11)
Java HotSpot(TM) Server VM (build 23.21-b01, mixed mode)
0.5.2 Janos version:
jim@toaster:~$ /home/jim/Janos-0.5.2-linux/janos.sh >& janos.log &
The UI stays stuck on "Searching For Zone Players" and repeatedly logs the "Couldn't add" ERROR message:
jim@toaster:~$ grep ERROR janos.log | head -5
JANOS: 58 [SonosControllerThread] ERROR net.sf.janos.control.SonosController - Couldn't add zoneurn:schemas-upnp-org:device:ZonePlayer:1 Sonos PLAY:3 Sonos PLAY:3 S3
JANOS: 2124 [SonosControllerThread] ERROR net.sf.janos.control.SonosController - Couldn't add zoneurn:schemas-upnp-org:device:ZonePlayer:1 Sonos PLAY:3 Sonos PLAY:3 S3
JANOS: 2206 [SonosControllerThread] ERROR net.sf.janos.control.SonosController - Couldn't add zoneurn:schemas-upnp-org:device:ZonePlayer:1 Sonos PLAY:3 Sonos PLAY:3 S3
JANOS: 4859 [SonosControllerThread] ERROR net.sf.janos.control.SonosController - Couldn't add zoneurn:schemas-upnp-org:device:ZonePlayer:1 Sonos PLAY:3 Sonos PLAY:3 S3
JANOS: 10055 [SonosControllerThread] ERROR net.sf.janos.control.SonosController - Couldn't add zoneurn:schemas-upnp-org:device:ZonePlayer:1 Sonos PLAY:3 Sonos PLAY:3 S3
The full stack trace logged is the same NullPointerException:
JANOS: 58 [SonosControllerThread] ERROR net.sf.janos.control.SonosController - Couldn't add zoneurn:schemas-upnp-org:device:ZonePlayer:1 Sonos PLAY:3 Sonos PLAY:3 S3
java.lang.NullPointerException
at net.sf.janos.control.AbstractService.<init>(AbstractService.java:55)
at net.sf.janos.control.AudioInService.<init>(AudioInService.java:38)
at net.sf.janos.control.ZonePlayer.<init>(ZonePlayer.java:82)
at net.sf.janos.control.SonosController.addZonePlayer(SonosController.java:230)
at net.sf.janos.control.SonosController.access$000(SonosController.java:57)
at net.sf.janos.control.SonosController$DiscoveryHandler$3.run(SonosController.java:113)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)</init></init></init>
I'd be glad to help, I have lots of Java software experience.
I haven't done anything on this project for quite some time - I moved to a much smaller house and didn't have much need for Sonos so it's not really a priority for me any more.
If you'd like to help out or even take over I'd be happy to set you up
Thanks for the quick update! I might have some time to help out, I'll try to figure things out and send any questions I have along.
It looks like the ZonePlayer is constructed with a UPNPRootDevice that doesn't have a service named like ZonePlayerConstants.SONOS_SERVICE_AUDIO_IN.
New log statement at ZonePlayer.java line 84:
logs:
JANOS: 48 [SonosControllerThread] INFO net.sf.janos.control.ZonePlayer - urn:schemas-upnp-org:service:AudioIn:1 from urn:schemas-upnp-org:device:ZonePlayer:1 is null
just before the ERROR:
JANOS: 53 [SonosControllerThread] ERROR net.sf.janos.control.SonosController - Couldn't add zoneurn:schemas-upnp-org:device:ZonePlayer:1 Sonos PLAY:3 Sonos PLAY:3 S3
I'm not sure what all that means, I think I'd have to research Sonos and UPNP a little more.
just had a read of this. I don't have a play:3 - do they have a "line in"? perhaps that's the problem - it may just need to be skipped for some devices
I've just given you everything permissions. I'm at work now so I can't really spend too much time with explanation but basically this was written before there was good upnp support in java so a lot of it is hard coded rather than written in a flexible manner. Sonos adhere to the upnp standards quite well, and there's lots of stuff on the Sonos "Unsupported" forum about how things work. I'm happy to offer advice so hit me up with any questions :)
Thanks for the suggestions, David. The following patch making AudioIn an
optional service for the ZonePlayer works for me and my Play 3 / Bridge setup.
The controller UI seems to work well, thanks for letting us benefit from your
hard work (same goes for the other project contributors)!
Is there a better way to handle this case in the code?
I don't know if making ZonePlayer.audioIn nullable could blow something else up
that I haven't used in the UI yet.
Index: net/sf/janos/control/ZonePlayer.java
--- net/sf/janos/control/ZonePlayer.java (revision 122)
+++ net/sf/janos/control/ZonePlayer.java (working copy)
@@ -20,8 +20,11 @@
import java.net.MalformedURLException;
import java.net.URL;
import java.net.UnknownHostException;
+import java.util.ArrayList;
+import java.util.List;
import net.sbbi.upnp.devices.UPNPRootDevice;
+import net.sbbi.upnp.services.UPNPService;
import net.sbbi.upnp.messages.UPNPResponseException;
import net.sf.janos.model.Entry;
import net.sf.janos.model.SeekTargetFactory;
@@ -29,6 +32,9 @@
import org.xml.sax.SAXException;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
/**
@@ -37,6 +43,7 @@
public class ZonePlayer {
private final UPNPRootDevice dev;
@@ -60,7 +67,7 @@
if (!dev.getDeviceType().equals(ZonePlayerConstants.SONOS_DEVICE_TYPE)) {
throw new IllegalArgumentException("dev must be a sonos device, not "
+ dev.getDeviceType());
@@ -77,10 +84,31 @@
.getChildDevice(ZonePlayerConstants.MEDIA_SERVER_DEVICE_TYPE));
this.mediaRenderer = new MediaRendererDevice(dev
.getChildDevice(ZonePlayerConstants.MEDIA_RENDERER_DEVICE_TYPE));
+
this.alarm = new AlarmClockService(dev
.getService(ZonePlayerConstants.SONOS_SERVICE_ALARM_CLOCK));
+
+
this.deviceProperties = new DevicePropertiesService(dev
.getService(ZonePlayerConstants.SONOS_SERVICE_DEVICE_PROPERTIES));
this.systemProperties = new SystemPropertiesService(dev
@@ -95,7 +123,10 @@
this.mediaServer.dispose();
this.mediaRenderer.dispose();
this.alarm.dispose();
this.deviceProperties.dispose();
this.systemProperties.dispose();
this.zoneGroupTopology.dispose();