utsushi / utsushi

Community Code Base now lives at
https://gitlab.com/utsushi/utsushi/
GNU General Public License v3.0
22 stars 10 forks source link

utsushi doesn't detect any devices #36

Open teamblubee opened 7 years ago

teamblubee commented 7 years ago

I made a few edits see PR: https://github.com/utsushi/utsushi/pull/35

The issue now is that utsushi still doesn't see the attached device even though it shows up in dmesg

ugen0.4: <EPSON EPSON L360 Series> at usbus0
ulpt0 on uhub0
ulpt0: <USB Printer> on usbus0
ulpt0: using bi-directional mode

running ldd on the binary returns these results

ldd /usr/local/bin/utsushi 
/usr/local/bin/utsushi:
    libutsushi.so.0 => /usr/local/lib/utsushi/libutsushi.so.0 (0x80082f000)
    libflt-all.so.0 => /usr/local/lib/utsushi/libflt-all.so.0 (0x800b84000)
    libcnx-usb.so.0 => /usr/local/lib/utsushi/libcnx-usb.so.0 (0x800e74000)
    libcnx-hexdump.so.0 => /usr/local/lib/utsushi/libcnx-hexdump.so.0 (0x80109e000)
    libltdl.so.7 => /usr/local/lib/libltdl.so.7 (0x8012a4000)
    libjpeg.so.8 => /usr/local/lib/libjpeg.so.8 (0x8014ad000)
    libusb.so.3 => /usr/lib/libusb.so.3 (0x80171a000)
    libboost_filesystem.so.1.65.1 => /usr/local/lib/libboost_filesystem.so.1.65.1 (0x80192f000)
    libboost_system.so.1.65.1 => /usr/local/lib/libboost_system.so.1.65.1 (0x801b48000)
    libboost_program_options.so.1.65.1 => /usr/local/lib/libboost_program_options.so.1.65.1 (0x801d4c000)
    libintl.so.8 => /usr/local/lib/libintl.so.8 (0x801fb9000)
    libudev.so.0 => /usr/local/lib/libudev.so.0 (0x8021c4000)
    libtiff.so.5 => /usr/local/lib/libtiff.so.5 (0x8023cc000)
    libc++.so.1 => /usr/lib/libc++.so.1 (0x802635000)
    libcxxrt.so.1 => /lib/libcxxrt.so.1 (0x8028fc000)
    libm.so.5 => /lib/libm.so.5 (0x802b1a000)
    libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x802d45000)
    libc.so.7 => /lib/libc.so.7 (0x802f5b000)
    libthr.so.3 => /lib/libthr.so.3 (0x803322000)
    libdevinfo.so.6 => /usr/lib/libdevinfo.so.6 (0x80354a000)
    libprocstat.so.1 => /usr/lib/libprocstat.so.1 (0x80374c000)
    liblzma.so.5 => /usr/lib/liblzma.so.5 (0x803956000)
    libjbig.so.2 => /usr/local/lib/libjbig.so.2 (0x803b7f000)
    libz.so.6 => /lib/libz.so.6 (0x803d8c000)
    libelf.so.2 => /lib/libelf.so.2 (0x803fa5000)
    libkvm.so.7 => /lib/libkvm.so.7 (0x8041bd000)
    libutil.so.9 => /lib/libutil.so.9 (0x8043cb000)

I build the program and these are the libs that it installed

etc/sane.d/dll.d/utsushi
%%ETCDIR%%/combo.conf
include/utsushi/array.hpp
include/utsushi/buffer.hpp
include/utsushi/condition-variable.hpp
include/utsushi/connexion.hpp
include/utsushi/constraint.hpp
include/utsushi/context.hpp
include/utsushi/cstdint.hpp
include/utsushi/descriptor.hpp
include/utsushi/device-info.hpp
include/utsushi/device.hpp
include/utsushi/exception.hpp
include/utsushi/filter.hpp
include/utsushi/format.hpp
include/utsushi/functional.hpp
include/utsushi/i18n.hpp
include/utsushi/iobase.hpp
include/utsushi/key.hpp
include/utsushi/log.hpp
include/utsushi/media.hpp
include/utsushi/memory.hpp
include/utsushi/monitor.hpp
include/utsushi/mutex.hpp
include/utsushi/octet.hpp
include/utsushi/option.hpp
include/utsushi/pattern/decorator.hpp
include/utsushi/preset.hpp
include/utsushi/pump.hpp
include/utsushi/quantity.hpp
include/utsushi/range.hpp
include/utsushi/regex.hpp
include/utsushi/run-time.hpp
include/utsushi/scanner.hpp
include/utsushi/signal.hpp
include/utsushi/store.hpp
include/utsushi/stream.hpp
include/utsushi/string.hpp
include/utsushi/tag.hpp
include/utsushi/thread.hpp
include/utsushi/toggle.hpp
include/utsushi/type-traits.hpp
include/utsushi/value.hpp
lib/sane/libsane-utsushi.so
lib/sane/libsane-utsushi.so.1
lib/sane/libsane-utsushi.so.1.0.25
lib/utsushi/libcnx-hexdump.so
lib/utsushi/libcnx-hexdump.so.0
lib/utsushi/libcnx-hexdump.so.0.0.0
lib/utsushi/libcnx-usb.so
lib/utsushi/libcnx-usb.so.0
lib/utsushi/libcnx-usb.so.0.0.0
lib/utsushi/libdrv-combo.so
lib/utsushi/libdrv-combo.so.0
lib/utsushi/libdrv-combo.so.0.0.0
lib/utsushi/libdrv-esci.so
lib/utsushi/libdrv-esci.so.0
lib/utsushi/libdrv-esci.so.0.0.0
lib/utsushi/libflt-all.so
lib/utsushi/libflt-all.so.0
lib/utsushi/libflt-all.so.0.0.0
lib/utsushi/libutsushi-gtkmm.so
lib/utsushi/libutsushi-gtkmm.so.0
lib/utsushi/libutsushi-gtkmm.so.0.0.0
lib/utsushi/libutsushi.so
lib/utsushi/libutsushi.so.0
lib/utsushi/libutsushi.so.0.0.0
lib/utsushi/sane/libsane-utsushi.so
lib/utsushi/sane/libsane-utsushi.so.1
lib/utsushi/sane/libsane-utsushi.so.1.0.25
libexec/utsushi/doc-locate
libexec/utsushi/esci-interpreter
libexec/utsushi/get-text-orientation
libexec/utsushi/utsushi-help
libexec/utsushi/utsushi-list
libexec/utsushi/utsushi-main
libexec/utsushi/utsushi-scan
libexec/utsushi/utsushi-scan-cli
libexec/utsushi/utsushi-scan-gtkmm
libexec/utsushi/utsushi-version
share/locale/de/LC_MESSAGES/utsushi.mo
share/locale/en/LC_MESSAGES/utsushi.mo
share/locale/es/LC_MESSAGES/utsushi.mo
share/locale/es_MX/LC_MESSAGES/utsushi.mo
share/locale/fr/LC_MESSAGES/utsushi.mo
share/locale/it/LC_MESSAGES/utsushi.mo
share/locale/ja/LC_MESSAGES/utsushi.mo
share/locale/ko/LC_MESSAGES/utsushi.mo
share/locale/nl/LC_MESSAGES/utsushi.mo
share/locale/pt/LC_MESSAGES/utsushi.mo
share/locale/pt_BR/LC_MESSAGES/utsushi.mo
share/locale/ru/LC_MESSAGES/utsushi.mo
share/locale/zh_CN/LC_MESSAGES/utsushi.mo
share/locale/zh_TW/LC_MESSAGES/utsushi.mo
%%DATADIR%%/drivers/esci/DS-1610.dat
%%DATADIR%%/drivers/esci/DS-1630.dat
%%DATADIR%%/drivers/esci/DS-1660W.dat
%%DATADIR%%/drivers/esci/DS-310.dat
%%DATADIR%%/drivers/esci/DS-320.dat
%%DATADIR%%/drivers/esci/DS-360W.dat
%%DATADIR%%/drivers/esci/DS-40.dat
%%DATADIR%%/drivers/esci/DS-50000.dat
%%DATADIR%%/drivers/esci/DS-510.dat
%%DATADIR%%/drivers/esci/DS-520.dat
%%DATADIR%%/drivers/esci/DS-530.dat
%%DATADIR%%/drivers/esci/DS-535.dat
%%DATADIR%%/drivers/esci/DS-5500.dat
%%DATADIR%%/drivers/esci/DS-560.dat
%%DATADIR%%/drivers/esci/DS-570W.dat
%%DATADIR%%/drivers/esci/DS-575W.dat
%%DATADIR%%/drivers/esci/DS-60000.dat
%%DATADIR%%/drivers/esci/DS-6500.dat
%%DATADIR%%/drivers/esci/DS-70000.dat
%%DATADIR%%/drivers/esci/DS-7500.dat
%%DATADIR%%/drivers/esci/DS-760.dat
%%DATADIR%%/drivers/esci/DS-770.dat
%%DATADIR%%/drivers/esci/DS-775.dat
%%DATADIR%%/drivers/esci/DS-860.dat
%%DATADIR%%/drivers/esci/ES-200.dat
%%DATADIR%%/drivers/esci/ES-300W.dat
%%DATADIR%%/drivers/esci/ES-400.dat
%%DATADIR%%/drivers/esci/ES-500W.dat
%%DATADIR%%/drivers/esci/PX-M7050.dat
%%DATADIR%%/drivers/esci/PX-M7050FX.dat
%%DATADIR%%/drivers/esci/PX-M860F.dat
%%DATADIR%%/drivers/esci/WF-6590.dat
%%DATADIR%%/gtkmm/about.xml
%%DATADIR%%/gtkmm/dialog.glade
%%DATADIR%%/gtkmm/dialog.rc
ugen0.4: <EPSON EPSON L360 Series> at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON (2mA)

  bLength = 0x0012 
  bDescriptorType = 0x0001 
  bcdUSB = 0x0200 
  bDeviceClass = 0x0000  <Probed by interface class>
  bDeviceSubClass = 0x0000 
  bDeviceProtocol = 0x0000 
  bMaxPacketSize0 = 0x0008 
  idVendor = 0x04b8 
  idProduct = 0x08d1 
  bcdDevice = 0x0100 
  iManufacturer = 0x0001  <EPSON>
  iProduct = 0x0002  <EPSON L360 Series>
  iSerialNumber = 0x0003  <56474C4B3033333303>
  bNumConfigurations = 0x0001 

Maybe some files are missing, could you assist?

teamblubee commented 7 years ago

built with logging enabled and I got these errors:

utsushi.conf
[devices]
dev1.udi = esci:usb:04b8:0155
dev2.udi = esci:gt-s650:usb:04b8:013c
dev3.udi = sane:usb:04b8:0155
dev4.udi = sane:gt-s650:usb:04b8:013c

running gdb and getting a backtrace from the seg fault

Type "apropos word" to search for commands related to "word"...
Reading symbols from utsushi...(no debugging symbols found)...done.
(gdb) r
Starting program: /usr/local/bin/utsushi 
process 68117 is executing new program: /bin/sh
process 68117 is executing new program: /usr/local/libexec/utsushi/utsushi-scan
process 68117 is executing new program: /bin/sh
process 68117 is executing new program: /usr/local/libexec/utsushi/utsushi-scan-gtkmm
2017-Oct-24 21:06:20.484126[0x80ee16000]: some device not found. delete combo::?adf=esci:usb:04b8:0155&fb=esci:gt-s650:usb:04b8:013c
2017-Oct-24 21:06:20.486145[0x80ee16000]: some device not found. delete combo::?adf=esci:usb:04b8:0156&fb=esci:gt-s650:usb:04b8:013c
2017-Oct-24 21:06:20.486476[0x80ee16000]: some device not found. delete combo::?adf=esci:usb:04b8:0157&fb=esci:gt-s650:usb:04b8:013c
2017-Oct-24 21:06:20.486789[0x80ee16000]: some device not found. delete combo::?adf=esci:usb:04b8:0155&fb=esci:gt-s650:usb:04b8:013d
2017-Oct-24 21:06:20.487096[0x80ee16000]: some device not found. delete combo::?adf=esci:usb:04b8:0156&fb=esci:gt-s650:usb:04b8:013d
2017-Oct-24 21:06:20.487425[0x80ee16000]: some device not found. delete combo::?adf=esci:usb:04b8:0157&fb=esci:gt-s650:usb:04b8:013d
2017-Oct-24 21:06:28.092281[0x80ee16000]: looking for preloaded 'esci' driver
2017-Oct-24 21:06:28.092412[0x80ee16000]: looking for 'esci' driver in '/usr/local/lib/utsushi'
2017-Oct-24 21:06:28.334757[0x80ee16000]: using '/usr/local/lib/utsushi/libdrv-esci'

Program received signal SIGSEGV, Segmentation fault.
0x00000008065a3dd4 in udev_list_entry_get_next () from /usr/local/lib/libudev.so.0
(gdb) bt
#0  0x00000008065a3dd4 in udev_list_entry_get_next () from /usr/local/lib/libudev.so.0
#1  0x00000008015ffd5f in udev_::device::device(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned short, unsigned short, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) ()
   from /usr/local/lib/utsushi/libutsushi.so.0
#2  0x00000008015a4638 in utsushi::device_info::create(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) () from /usr/local/lib/utsushi/libutsushi.so.0
#3  0x0000000801b5b599 in libcnx_usb_LTX_factory () from /usr/local/lib/utsushi/libcnx-usb.so.0
#4  0x0000000801588026 in utsushi::connexion::create(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, bool) ()
   from /usr/local/lib/utsushi/libutsushi.so.0
#5  0x000000080fb7479e in libdrv_esci_LTX_scanner_factory () from /usr/local/lib/utsushi/libdrv-esci.so
#6  0x00000008015ca228 in utsushi::scanner::create(utsushi::scanner::info const&) () from /usr/local/lib/utsushi/libutsushi.so.0
#7  0x00000008008b0ad8 in utsushi::gtkmm::chooser::create_device(std::__1::set<utsushi::scanner::info, std::__1::less<utsushi::scanner::info>, std::__1::allocator<utsushi::scanner::info> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)
    () from /usr/local/lib/utsushi/libutsushi-gtkmm.so.0
#8  0x00000008008b0798 in utsushi::gtkmm::chooser::on_changed() () from /usr/local/lib/utsushi/libutsushi-gtkmm.so.0
---Type <return> to continue, or q <return> to quit---
#9  0x0000000800ec1784 in Gtk::ComboBox_Class::changed_callback(_GtkComboBox*) () from /usr/local/lib/libgtkmm-2.4.so.1
#10 0x0000000804e519d3 in ?? () from /usr/local/lib/libgobject-2.0.so.0
#11 0x0000000804e66301 in g_signal_emit_valist () from /usr/local/lib/libgobject-2.0.so.0
#12 0x0000000804e66c24 in g_signal_emit () from /usr/local/lib/libgobject-2.0.so.0
#13 0x00000008032c7496 in ?? () from /usr/local/lib/libgtk-x11-2.0.so.0
#14 0x00000008032c7634 in gtk_combo_box_set_active_iter () from /usr/local/lib/libgtk-x11-2.0.so.0
#15 0x00000008032ce1fb in ?? () from /usr/local/lib/libgtk-x11-2.0.so.0
#16 0x0000000804e517eb in g_closure_invoke () from /usr/local/lib/libgobject-2.0.so.0
#17 0x0000000804e6594e in ?? () from /usr/local/lib/libgobject-2.0.so.0
#18 0x0000000804e665b6 in g_signal_emit_valist () from /usr/local/lib/libgobject-2.0.so.0
#19 0x0000000804e66c24 in g_signal_emit () from /usr/local/lib/libgobject-2.0.so.0
#20 0x00000008034792d9 in gtk_widget_activate () from /usr/local/lib/libgtk-x11-2.0.so.0
#21 0x0000000803367feb in gtk_menu_shell_activate_item () from /usr/local/lib/libgtk-x11-2.0.so.0
#22 0x0000000803368cf4 in ?? () from /usr/local/lib/libgtk-x11-2.0.so.0
#23 0x000000080335659f in _gtk_marshal_BOOLEAN__BOXED () from /usr/local/lib/libgtk-x11-2.0.so.0
#24 0x0000000804e517eb in g_closure_invoke () from /usr/local/lib/libgobject-2.0.so.0
---Type <return> to continue, or q <return> to quit---
#25 0x0000000804e65a93 in ?? () from /usr/local/lib/libgobject-2.0.so.0
#26 0x0000000804e66602 in g_signal_emit_valist () from /usr/local/lib/libgobject-2.0.so.0
#27 0x0000000804e66c24 in g_signal_emit () from /usr/local/lib/libgobject-2.0.so.0
#28 0x00000008034790f1 in ?? () from /usr/local/lib/libgtk-x11-2.0.so.0
#29 0x00000008033546d2 in gtk_propagate_event () from /usr/local/lib/libgtk-x11-2.0.so.0
#30 0x000000080335435c in gtk_main_do_event () from /usr/local/lib/libgtk-x11-2.0.so.0
#31 0x000000080388f241 in ?? () from /usr/local/lib/libgdk-x11-2.0.so.0
#32 0x00000008050d803b in g_main_context_dispatch () from /usr/local/lib/libglib-2.0.so.0
#33 0x00000008050d8364 in ?? () from /usr/local/lib/libglib-2.0.so.0
#34 0x00000008050d868f in g_main_loop_run () from /usr/local/lib/libglib-2.0.so.0
#35 0x0000000803353ccf in gtk_main () from /usr/local/lib/libgtk-x11-2.0.so.0
#36 0x0000000800eeb245 in Gtk::Main::run(Gtk::Window&) () from /usr/local/lib/libgtkmm-2.4.so.1
#37 0x00000000004066ef in ?? ()
#38 0x0000000000405e5f in ?? ()

Have any suggestions?

paddy-hack commented 7 years ago

Let me try to summarize that a bit.

However, libudev tries to communicate with a udevd service that is normally running on Linux systems. Both are part of udev (which itself has been included in systemd). I have little to no experience with FreeBSD (or any other BSD) but I don't think there is a BSD port of udev. A quick search led me to this forum post which seems to indicate I'm right about that.

If that's so, you will need to provide an alternative implementation of the device_info interface that uses devd (or whatever is available on FreeBSD) to obtain the information that the device_info needs. If I were you, I'd ask around in BSD circles for a C interface to the bits and pieces device_info needs. Come to think of it, there may be something of use in the libusb sources as that supports OS X, NetBSD/OpenBSD.

Basically, you'd need to provide alternative implementations of lib/udev.[ch]pp and make lib/device-info.cpp use those when appropriate via a preprocessor macro. I can help with the lib/device-info.cpp integration and review your code, but you will have to write the (Free)BSD versions of lib/udev.[ch]pp (let's call them lib/bsddev.[ch]pp).

teamblubee commented 6 years ago

Hi, thank you for applying my commit, I do not mind one bit.

Initially I didn't know that udev was so tightly integrated with the Linux kernel. There are some stub code in FreeBSD but not enough to make the USB drivers work and that's why I was getting some crashed.

FreeBSD has a devd system that allows communication through Unix sockets and so I started monitoring the devd socket, plugged in the USB printer/scanner Epson L360 and this comes up:

nc -U /var/run/devd.pipe
!system=DEVFS subsystem=CDEV type=CREATE cdev=usb/0.2.0
!system=DEVFS subsystem=CDEV type=CREATE cdev=ugen0.2
!system=DEVFS subsystem=CDEV type=CREATE cdev=usb/0.2.1
!system=DEVFS subsystem=CDEV type=CREATE cdev=usb/0.2.2
!system=DEVFS subsystem=CDEV type=CREATE cdev=usb/0.2.3
!system=DEVFS subsystem=CDEV type=CREATE cdev=usb/0.2.4
!system=USB subsystem=DEVICE type=ATTACH ugen=ugen0.2 cdev=ugen0.2 vendor=0x04b8 product=0x08d1 devclass=0x00 devsubclass=0x00 sernum="56474C4B3033333303" release=0x0100 mode=host port=5 parent=ugen0.1
!system=USB subsystem=INTERFACE type=ATTACH ugen=ugen0.2 cdev=ugen0.2 vendor=0x04b8 product=0x08d1 devclass=0x00 devsubclass=0x00 sernum="56474C4B3033333303" release=0x0100 mode=host interface=0 endpoints=2 intclass=0xff intsubclass=0xff intprotocol=0xff
!system=USB subsystem=INTERFACE type=ATTACH ugen=ugen0.2 cdev=ugen0.2 vendor=0x04b8 product=0x08d1 devclass=0x00 devsubclass=0x00 sernum="56474C4B3033333303" release=0x0100 mode=host interface=1 endpoints=2 intclass=0x07 intsubclass=0x01 intprotocol=0x02
? at bus=0 hubaddr=1 port=5 devaddr=2 interface=0 ugen=ugen0.2 vendor=0x04b8 product=0x08d1 devclass=0x00 devsubclass=0x00 devproto=0x00 sernum="56474C4B3033333303" release=0x0100 mode=host intclass=0xff intsubclass=0xff intprotocol=0xff on uhub0
? at bus=0 hubaddr=1 port=5 devaddr=2 interface=1 ugen=ugen0.2 vendor=0x04b8 product=0x08d1 devclass=0x00 devsubclass=0x00 devproto=0x00 sernum="56474C4B3033333303" release=0x0100 mode=host intclass=0x07 intsubclass=0x01 intprotocol=0x02 on uhub0
? at bus=0 hubaddr=1 port=5 devaddr=2 interface=0 ugen=ugen0.2 vendor=0x04b8 product=0x08d1 devclass=0x00 devsubclass=0x00 devproto=0x00 sernum="56474C4B3033333303" release=0x0100 mode=host intclass=0xff intsubclass=0xff intprotocol=0xff on uhub0
!system=DEVFS subsystem=CDEV type=CREATE cdev=ulpt0
!system=DEVFS subsystem=CDEV type=CREATE cdev=unlpt0
+ulpt0 at bus=0 hubaddr=1 port=5 devaddr=2 interface=1 ugen=ugen0.2 vendor=0x04b8 product=0x08d1 devclass=0x00 devsubclass=0x00 devproto=0x00 sernum="56474C4B3033333303" release=0x0100 mode=host intclass=0x07 intsubclass=0x01 intprotocol=0x02 on uhub0
? at bus=0 hubaddr=1 port=9 devaddr=5 interface=0 ugen=ugen0.5 vendor=0x04f2 product=0xb5a7 devclass=0xef devsubclass=0x02 devproto=0x01 sernum="" release=0x3601 mode=host intclass=0x0e intsubclass=0x01 intprotocol=0x00 on uhub0
? at bus=0 hubaddr=1 port=9 devaddr=5 interface=1 ugen=ugen0.5 vendor=0x04f2 product=0xb5a7 devclass=0xef devsubclass=0x02 devproto=0x01 sernum="" release=0x3601 mode=host intclass=0x0e intsubclass=0x02 intprotocol=0x00 on uhub0
!system=USB subsystem=DEVICE type=DETACH ugen=ugen0.2 cdev=ugen0.2 vendor=0x04b8 product=0x08d1 devclass=0x00 devsubclass=0x00 sernum="56474C4B3033333303" release=0x0100 mode=host port=5 parent=ugen0.1
!system=USB subsystem=INTERFACE type=DETACH ugen=ugen0.2 cdev=ugen0.2 vendor=0x04b8 product=0x08d1 devclass=0x00 devsubclass=0x00 sernum="56474C4B3033333303" release=0x0100 mode=host interface=0 endpoints=2 intclass=0xff intsubclass=0xff intprotocol=0xff
!system=USB subsystem=INTERFACE type=DETACH ugen=ugen0.2 cdev=ugen0.2 vendor=0x04b8 product=0x08d1 devclass=0x00 devsubclass=0x00 sernum="56474C4B3033333303" release=0x0100 mode=host interface=1 endpoints=2 intclass=0x07 intsubclass=0x01 intprotocol=0x02
!system=DEVFS subsystem=CDEV type=DESTROY cdev=ugen0.2
!system=DEVFS subsystem=CDEV type=DESTROY cdev=usb/0.2.0
!system=DEVFS subsystem=CDEV type=DESTROY cdev=ulpt0
!system=DEVFS subsystem=CDEV type=DESTROY cdev=unlpt0
-ulpt0 at   on uhub0
!system=DEVFS subsystem=CDEV type=DESTROY cdev=usb/0.2.4
!system=DEVFS subsystem=CDEV type=DESTROY cdev=usb/0.2.3
!system=DEVFS subsystem=CDEV type=DESTROY cdev=usb/0.2.2
!system=DEVFS subsystem=CDEV type=DESTROY cdev=usb/0.2.1

As you can see the device is recognized, there's serial numbers and all types of information.

If this is the correct info, then I can work on updating the monitor.cpp class to use devd on FreeBSD.

This printer already prints on FreeBSD, what would be the next steps to use the information from devd to have XSane see the device?

Will I be able to work with the driver source code or can some shims be provided if not?

paddy-hack commented 6 years ago

Apologies for the delayed response.

Given the above, I started making a stub for the code you would have to unstub but then I came across https://github.com/jiixyj/libudev-fbsd. Perhaps you could give that a try. It provides a libudev API but implements it on top of devd (and evdev IIUC).

teamblubee commented 6 years ago

That looks interesting but I'd prefer to write the code based on devd since that would be easier to maintain in the long run.

The output above showed what information devd provides when the device is plugged in. What stub code were you going to write? I can provide the implementation in a way that shouldn't change on this side.