C H A P T E R  21

USB Device Test (usbtest)

usbtest Description

The usbtest verifies the proper functioning of the hardware of the USB subsystem. The test supports audio, keyboard, and printer devices. The usbtest for audio verifies the proper functioning of the hardware and software components of the USB audio subsystem. Specifically, the test tests the USB audio devices, USB microphones and speakers.

Note - usbtest tests the USB ports using various USB devices such as the USB key board, the USB printer, or the USB audio devices.

For keyboards, the test verifies whether the keyboard(s) attached to the USB bus are USB-compliant. The test flashes the LEDs of a compliant keyboard. The usbtest for printers verifies the proper functioning and integrity of the USB parallel port devices. The test data, either ASCII or a PostScript file, is sent to the printer through the USB bulk transfer. The test saves and restores the printer settings.

The usbtest options and subtest available depends on the peripheral device attached to the USB port.

usbtest Subtests

The following table lists the usbtest subtests for both the USB audio and printer devices.

TABLE 21-1 usbtest Subtests



USB Audio Devices


Supported in Connection test mode only. This subtest generates two seconds of sound output to the speakers. You must decide, by listening, if the test passed or failed.


Records and plays one second of random data at 8kHz sampling. This subtest reads random data from the USB microphone port and plays the music back to the USB speakers.


Plays a 30 second music file that is output to the speakers. You must decide, by listening, if the test passed or failed. Things to listen for are distortion or lack of music.

USB Printer Devices


Retrieves the IEEE 1284 ID string of the printer.


Prints strings of ASCII characters (from 0x32 to 0x7e), and can also print the postscript file usbpppdata.ps to the printer.

usbtest Options

To reach the following dialog box below, right-click on the test name in the System Map and select Test Parameter Options. If you do not see this test in the System Map, you might need to expand the collapsed groups, or your system might not include the device appropriate to this test. Refer to the SunVTS User's Guide for more details.

FIGURE 21-1 usbtest Test Parameter Options Dialog Box

Screenshot of the usbtest Test Parameter Options dialog box


TABLE 21-2 usbtest Opions



USB Audio Devices


Specifies the volume of 0 to 255. The default is 80.


Enables or disables the audio music test. The default is Enable.

USB Printer Devices


Specifies the path to the printer


Enables or disables the Printer subtest. This test requires a printer to be attached to the USB port.


Specifies the test data: ascii, postscript, or both.


Specifies, in seconds, the delay after the Printer subtest is performed

usbtest Test Modes

This test supports Connection and Functional test modes.

TABLE 21-3 usbtest Supported Test Modes

Test Mode



For a USB audio device, the test outputs two seconds of sound to the speakers

For a USB keyboard device, the test runs the full test.

For USB printer device, the test runs only the getdevid subtest.


For a USB audio device, the test performs Records and Plays subtest by default. You can enable Audio Music test.

For a USB keyboard device, the test runs the full test.

For a USB printer device, the getdevid subtest is enabled by default and the Printer subtest is disabled by default.

usbtest Command Line Syntax

/opt/SUNWvts/bin/usbtest -cvf -o dev=dev-name, getdevid=Enable|Disable, printer=Enable|Disable, data=ascii, postscript, delay=0-86400, M=Enable|Disable, O=speaker|headphone|line-out, V=0-255, MF=musicfilename

TABLE 21-4 usbtest Command-Line Syntax




Target device name. Thie test runs on the specified device name. The default device name is /dev/kbd.

USB Printer Devices


Enables or disables getdevid subtest. This option is available only for a USB printer device. This option is enabled by default.


Enables or disables the printer test. This option is disabled by default. This option requires a printer to be attached to the USB port.


Selects whether to send ASCII text or PostScript data to the printer.


Enables you to choose a delay between passes of the printer test.

USB Audio Devices


Enables or disables the music play test. The default is Enable.


Selects the output device that usbtest requires.


Music output volume. The default is 80.


Selects the music file. The default is music.au.