Wednesday 19 September 2018

The weird and wonderful world of the WS1361 sound level meter USB driver

WS1361 / HY1361 sound level meter

When I had the need to build an applause-o-meter, I thought I'd go the easy route and buy a cheap sound pressure meter with an USB interface. What could possibly go wrong?
It is bigger than it looks here

About the meter

As seen so often, the identical meter appears under several manufacturer labels:
  • Hongyan / Hong Yan HY1361
  • Wensn WS1361
  • Unmarked HY 1361 (My device)
There is also a model with an Card slot on the market (WS1361C / HY13611). I didn't need recording, but I'll crack the device open some time to see if I can fit a SD-module.

I don't know any details about these meters:

  • Benetech GM1356 digital usb noise level meter
  • CHEER GM1356 digital usb noise level meter
  • Sinokit SK1356 
These look like the WS1361 with the exception that they have no card slot. The WS1361 card slot is sealed with the QC label. Please let me know if you have one of these meters. They might run the same protocol.
Then again, the Tondaj SL-814 also looks similar, but runs a serial protocol on what looks like a USB-Port. But it needs a cable with a prolific pl2303 chip to connect to usb. So a similar appearance can be misleading.


The tripod mount is a nice touch, especially since the case does creak when not handled carefully. Apart from better scaling on the LCD bar graph, I can't see any reason why I should change the ranges from the 30-130db setting. Neither the resolution on the PC, nor on the LCD changes like we're used to see on multimeters.

USB Driver issues

After ordering the meter, I did a little research and prepared for the worst: No signed drivers, proprietary protocol.... a nightmare.
Things could have been so easy if the meter had presented itself as a serial interface.

The device manufacturer's web site might be this one. With installation instructions here. And a software download page here.
The instructions include disabling driver signature enforcement. Not such a great idea.
So I decided to have a closer look.

USB Details

Ok, so the important bits are:
Vendor ID: 16C0
Product ID: 05DC

This Vendor ID is registered to voti.nl. Further research on shows, that the product ID had been reserved as "shared ID for use with libusb". Not a great choice for a consumer product. But then again not really a problem.

The same VID/PID seems widely used for the USBasp Atmel programmer (ISP).
That also explains why the .inf file in the driver is called usbasp.inf and why the .cat file's signature does not match the .inf file. Probably because whe whole driver set has been "borrowed" from there and modified.

New drivers?

While the sound meter's driver, as well as older drivers I found relied on libusb-32, the later versions available for the USBasp use libusbK in a version from 2015. Unfortunately the .inf is also not signed there.

Different approach - Zadig

So what it all boils down to is, that the above Vendor/Product ID pair needs to be associated with a generic usb driver. The driver disc that came with the meter had libusb-win32 on it.
There is another option beside having a signed driver. This is well known to everyone who tried using an RTL-SDR receiver on windows. - Zadig.
There are numerous versions of this floating around. Get the latest version from the Zadig web site.
Zadig
On my system, the WS1631 is instantly recognized. As the SoundLink software appears to rely on libusb-win32, choose that as the target driver for the WS1361. Zadig installs the driver without any complaints.

Success

And sure enough, the SoundLink software is happy with that:
SoundPCLink Software
As with many cheap Chinese instruments, the software ist very limited in it's abilities. So based on the fact that it uses libusb-win32, it should be possible to write my own code. There are some hints in the links below.

Intersting WS1361 links:






Friday 14 September 2018

How to remove unwanted drivers from Windows 10

Remove unwanted USB device drivers (Win7 to Win10)

Why would you want to remove drivers from the Windows driver store?

I need to remove drivers on two occasions:

  • When I screwed up designing my own USB devices with v-usb
  • When experimenting with SDR (software defined radio) receivers

Locate the offending driver

Microsoft documents the process here. You need an elevated shell (admin shell). Both CMS and PowerShell are ok.
Type:
pnputil -e
This will list the drivers in the driver store.
The output should look like this:

Excerpt of pnputil's output.

Remove the driver from the Windows driver store

If (for argument's sake), this was the offending driver:

Veröffentlichter Name:            oem123.inf

Treiberpaketanbieter:   SDRplay Ltd
Klasse:                     Audio, Video und Gamecontroller
Treiberversion und -datum:   08/26/2017 5.22.11.11
Name des Signaturgebers:               Microsoft Windows Hardware Compatibility Publisher

The driver can be removed, using it's oemXYZ.inf identifier:

pnputil -d oem123.inf

This will remove the driver package from the driver store. If the device is busy, you can try the -f option to force the removal.

Reinstall driver

When you re-connect the device, it will prompt for a driver.

This procedure always worked for me when I need to start over with odd USB devices.