daliserver
daliserver copied to clipboard
daliserver in VM not working
Hi,
I tried to setup daliserver in a ubuntu 14.04 guest on a windows 10 host with virtualbox. The USB device filter for the VM is configured properly to access Lunatone DALI USB through guest system.
When trying to start daliserver with "/etc/init.d/daliserver start", following gets written to "/var/log/daliserver.log":
[2016-00-04 13:17:10] INFO Starting daliserver
[2016-00-04 13:17:15] **ERROR** Error setting configuration: Other error
[2016-00-04 13:17:50] **ERROR** Error reattaching interface: Not found
Any hints how I can solve this?
Can you recompile daliserver with debug messages and run it from the console, please?
$ ./configure --enable-debug
$ make clean && make
$ src/daliserver -d debug
This should give a better view of what's going on.
/tmp/daliserver# src/daliserver -d debug
[2016-00-07 09:37:40] Parsing options
DALI USB multiplexer (daliserver)
Copyright (c) 2011 onitake All rights reserved.
[2016-00-07 09:37:40] INFO Starting daliserver
[2016-00-07 09:37:40] Initializing dispatch queue
[2016-00-07 09:37:40] Initializing USB connection
[2016-00-07 09:37:40] Trying to find DALI USB device at -1:-1
[2016-00-07 09:37:40] Ignoring USB device [VID=0x1d6b PID=0x0002]
[2016-00-07 09:37:40] Input endpoint: 0x81
[2016-00-07 09:37:40] Output endpoint: 0x02
[2016-00-07 09:37:45] **ERROR** Error setting configuration: Other error
[2016-00-07 09:38:20] **ERROR** Error reattaching interface: Not found
Speicherzugriffsfehler (Speicherabzug geschrieben)
Does the message at the end mean that daliserver crashed? Ouch. I'll need to look into this. If you could run daliserver in gdb and post the backtrace, that would help.
Also, to find out why it doesn't work on your machine, it would be nice if you could mail me or create a gist with the output of lsusb -v with the adapter plugged in.
Speicherzugriffsfehler means segfault. I'm going to provide you the backtrace as soon as I have access to the related VM
lsusb -v https://gist.github.com/rnixx/a9b41f94b379b85940ae
gdb src/daliserver https://gist.github.com/rnixx/f18755ed80f8fe6344c0
Interesting that lsusb was unable to fetch the manufacturer, product and serial number strings from the device.
When running lsusb on a non-VM linux, iManufacturer, iProduct, and iSerial are empty
Are you root when you run lsusb -v?
no
You need to be root for it to be able to fetch strings from devices (because this involves actually making requests to the device, rather than just reading from information already stored by the kernel).
Actually I don't think that reading these strings count that much related to the issue, since daliserver has been started as root. But I can update lsusb output anyway. Need to go now, more ASAP
As root on my local machine I get manufacturer, product and serial
Bus 001 Device 071: ID 17b5:0020 Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 1.10 bDeviceClass 0 (Defined at Interface level) bDeviceSubClass 0 bDeviceProtocol 0 bMaxPacketSize0 64 idVendor 0x17b5 idProduct 0x0020 bcdDevice 1.10 iManufacturer 1 Lunatone iProduct 2 DALI USB iSerial 3 00018FC4 bNumConfigurations 1
As root in the virtual machine I get the error
Bus 002 Device 003: ID 17b5:0020 Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 1.10 bDeviceClass 0 (Defined at Interface level) bDeviceSubClass 0 bDeviceProtocol 0 bMaxPacketSize0 64 idVendor 0x17b5 idProduct 0x0020 bcdDevice 1.10 iManufacturer 1 (error) iProduct 2 (error) iSerial 3 (error) bNumConfigurations 1
I suspected that the segfault might happen in libusb_free_config_descriptor, and I think I just found out why. I'm calling it twice on error. Will send a patch shortly.
As for the reason why it's not working for your adapter, I'm not sure. We're trying to using open configuration value 1, and it fails for an unknown reason. Did you test daliserver in a non-VM environment? It should work in kvm/qemu, though, I'm using that myself. Perhaps a comparison with my own adapter's USB descriptor helps. I'll post anything I find.
Patch is up (b171483). Also, I added a check in 5d860e1 to avoid reattaching the device to the kernel if it was not detached.
@rnixx, can you test if it works now?
@onitake, will give it at try tomorrow. thanks
Sorry for the late reply. We are still not able to get daliserver running in the VM. Daliserver stops with "Error setting configuration: Other error". The problem might be somewhere deeper in the system, since lsusb is also not able to read the device correctly. I'm quite busy ATM with daily business, but will give it another try as soon as I can.
Ok. Since I do not get this error when I run daliserver in KVM (with USB passthrough), I don't really know how to help without more information.
Did my patch at least fix the segmentation fault?
yes, no segfault any more, thx!