[comp.sys.hp] xcd with HP-IB

awhitton@bwdlh128.BNR.CA (Alan Whitton) (04/12/91)

Greetings:

Someone at HP has most graciously got me a binary copy of XCD which
"should" work with my HP-IB CD-ROM player. Well it doesn't . Does
anyone have the source for this? If so please contact me.

Currently my set up is:
HP-UX xxx 7.05 A 9000/360 xxx

CD-ROM Device:
crwxrwxrwx   1 root     other      4 0x070200 Apr 10 16:07 /dev/rdsk/cdrom

Yet when I run xcd it complains about how the cd player is neither scsi
nor HP-IB:

CD device (/dev/rdsk/cdrom) is not SCSI or HPIB.

Please help!

Alan Whitton
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
BNR Ottawa                   Disclaimer: "This is only my opinion"
BITNET: awhitton@bnr.ca  OR  UUCP: ...uunet!bnrgate!forum!awhitton

ken@hpcupt3.cup.hp.com (Kenneth M. Sumrall) (04/15/91)

>Someone at HP has most graciously got me a binary copy of XCD which
>"should" work with my HP-IB CD-ROM player. Well it doesn't . Does
>anyone have the source for this? If so please contact me.
>
>CD-ROM Device:
>crwxrwxrwx   1 root     other      4 0x070200 Apr 10 16:07 /dev/rdsk/cdrom
>
>CD device (/dev/rdsk/cdrom) is not SCSI or HPIB.
>
>Please help!
>
It "should" work, and it "does" work with an HP-IB CD-ROM drive.
The user "should" use the correct device file.

You must run the CD-ROM drive off of an HP-IB DIL device file, not
the CS-80 device file.  Here is a man page I made for xcd, which
also describes the device file you need.

| Ken Sumrall                          |     Internet: ken%hpda@hplabs.hp.com |
| HP California Language Labs          |           UUCP:  ...!hplabs!hpda!ken |
|    "I'd stomp desert dope heads for some gas in my moped!" - Bill the Cat   |
|              "What a stupid world" -Calvin (speaking to Hobbes)             |

#---------------------------------- cut here ----------------------------------
# This is a shell archive.  Remove anything before this line,
# then unpack it by saving it in a file and typing "sh file".
#
# Wrapped by Kenneth M. Sumrall <ken@hpcupt3> on Sun Apr 14 22:19:40 1991
#
# This archive contains:
#	xcd.1	
#
# Error checking via wc(1) will be performed.
# Error checking via sum(1) will be performed.

LANG=""; export LANG
PATH=/bin:/usr/bin:$PATH; export PATH

if sum -r </dev/null >/dev/null 2>&1
then
	sumopt='-r'
else
	sumopt=''
fi

echo x - xcd.1
cat >xcd.1 <<'@EOF'
.TH XCD 1 EXPERIMENTAL
.CM 1
.SH "NAME"
xcd \- Control playback of audio CD's in CD-ROM drive
.SH "SYNOPSIS"
.B xcd
[
.I device_file
]
.SH "DESCRIPTION"
.I Xcd
is an X11 based tool that controls the playback of audio CD's in a
Hewlett-Packard CD-ROM drive.  If \fBxcd\fR is invoked with no
arguments, it attempts to control the CD-ROM drive referenced by
the device file \fI/dev/rscsi\fR.  If another device file should be
used, it should be given as the first argument on the command line.

The device file for the HP-IB CD-ROM drive is created as follows:
.nf
     mknod /dev/file_name c 21 0xSC1fBA
     where SC is the select code of the HP-IB interface
     and BA is the bus address of the CD-ROM drive.
     BA must be in the range 0-7.
.fi

The device file for the SCSI CD-ROM drive is created as follows:
.nf
     mknod /dev/file_name c 47 0xSCBA00
     where SC is the select code of the SCSI interface
     and BA is the interrupt level set on the CD-ROM drive.
     BA must be in the range 0-6.
.fi

After the \fIxcd\fR window pops up, it takes a few moments for it to
read the table of contents off of the disk.  During this time, the
buttons are inactive.  When \fIxcd\fR has finished reading the table
of contents, it adds a control panel showing the number of tracks on the
disk.  It there is not a CD in the drive when \fIxcd\fR starts up,
there is no delay.

The control panel has several buttons.  Their use is described below:
.PP
.TP 8
.B PLAY
Start playing the CD in the player.
.PP
.TP 8
.B PAUSE
Temporarily stop playing the music in the player.  Click on this button
again to start where the music stopped.
.PP
.TP 8
.B STOP
Stop playing the CD.  If you click on this twice after the CD has stopped,
\fIxcd\fR terminates.
.PP
.TP 8
.B EJECT
Eject the CD on models that support this feature.
.PP
.TP 8
.B SHUFFLE
Randomly order the selected tracks when the \fBPLAY\fR button is pressed.
Click \fBSHUFFLE\fR again to turn this feature off.
.PP
.TP 8
.B REPEAT
Start playing the CD again when the last track is finished.
Click this button again to turn this feature off.
.PP
.TP 8
.B MARK
Press the left mouse button to remember the current position in
the song.  Then, to go back to that position, press the right mouse button.
To clear the mark, first \fBSTOP\fR the CD, then click the left mouse
button on the \fBMARK\fR button.
.PP
While the CD is playing, the current track number, current index number
and the time are displayed on the control panel.  Clicking the left mouse
button on the track number will go down one track.  Likewise, clicking
the right mouse button on the track number will go up one track.  Clicking
the middle mouse button on the track number will go back to the beginning
of the current track.  The same mouse clicks are used in the box to
the right of the current track number to control the current index.
.PP
Above the time display is a label stating what the time means.  Clicking on
this label changes the time display between four modes.  They are,
"Track Time Remaining", "Track Time", "Program Time Remaining", and
"Program Time".  Underneath the time display is a sliding bar which
graphically displays the amount of time played on the track or program
so far.  Clicking the mouse button in this window will skip
to that relative position in the song or program, depending on what
time display mode is active.
.PP
Clicking on the \fBDISPLAY\fR button will close the control panel, and
bring up a mini control panel with just the track, index and time
display just described.
.PP
The \fBPROGRAM\fR button brings up the programming screen.  In this screen
you can type in the disk title, artist's name, and track titles.  After
you have entered all of these names, pressing the \fBSTORE\fR button
will store this information in the file \fB.cdinfo\fR in you home directory.
The next time you insert a CD into the CD-ROM drive, this information will
be automatically loaded and displayed.  The long text bar below the track
and time display will show the current track title, disc title,
or artist name.  To change what is displayed in this box, click on the 
label that identifies that box.
.PP
Clicking on the track numbers identifying each track on the bottom of the
display will program the order in which the tracks are played.  The left
mouse button will add that track to the play order, and the right mouse
button will remove that track from the play order.  The play order is
displayed just beneath the \fBPLAY\fR button up top.  The \fBRESET\fR
button removes all track entries from the play order, and the
\fBSELECT ALL\fR button adds all tracks to the play order.
.PP
The following buttons have these affects.
.PP
.TP 8
.B LOAD FTS\fR
Still needs to be documented.
.PP
.TP 8
.B SPLIT
Still needs to be documented.
.PP
.TP 8
.B CUSTOM
Still needs to be documented.
.SH X DEFAULTS
.PP
.TP 8
.B ButtonFont
Specifies the font used for the control buttons.  Default: hp8.10x20
.PP
.TP 8
.B ButtonFGColor
Specifies the foreground color of the buttons.  Default: White
.PP
.TP 8
.B ButtonBGColor
Specifies the foreground color of the buttons.  Default: firebrick
.PP
.TP 8
.B Text1Font
Specifies which font to use for the larger font.  Default: hp8.10x20
.PP
.TP 8
.B Text1FGColor
Specifies the foreground color of the larger font.  Default: White
.PP
.TP 8
.B Text1BGColor
Specifies the background color of the larger font:  Default: Black
.PP
.TP 8
.B Text2Font
Specifies which font to use for the smaller font.  Default: hp8.8x16
.PP
.TP 8
.B Text2FGColor
Specifies the foreground color of the smaller font.  Default: White
.PP
.TP 8
.B Text2BGColor
Specifies the background color of the smaller font:  Default: Black
.PP
.TP 8
.B LabelFont
Specifies the font used to label text areas.  Default: hp8.8x16
.PP
.TP 8
.B LabelFGColor
Specifies the foreground color of the label font.  Default: White
.PP
.TP 8
.B LabelBGColor
Specifies the background color of the label font.  Default: firebrick
.PP
.TP 8
.B DisplayFont
Specifies the font used to display track and time information.
Default: fqxb-25
.PP
.TP 8
.B DisplayFGColor
Specifies the foreground color of the track and time display.
Default: Green
.PP
.TP 8
.B DisplayBGColor
Specifies the foreground color of the track and time display.
Default: Black
.PP
.TP 8
.B ReverseVideo
Reverses colors on monochrome displays if set to On.
Default: Off
.PP
.TP 8
.B Background
Specifies the background color of the entire control panel.
Default: DimGrey
.PP
.TP 8
.B Border
Specifies the color of the button borders.
Default: White
.PP
.TP 8
.B XPos
Specifies the initial X position of the control panel.
.PP
.TP 8
.B YPos
Specifies the initial Y position of the control panel.
.PP
.TP 8
.B MiniXPos
Specifies the initial X position of the mini control panel.
.PP
.TP 8
.B MiniYPos
Specifies the initial Y position of the mini control panel.
.PP
.TP 8
.B GlobalPauseKeySym
Specifies which keyboard key will cause the CD to pause, when that
keyboard key is pressed.  This key will cause the CD to pause even if
the mouse is not in the \fIxcd\fR window.  This is specified as a
hexadecimal number pulled from the file \fI/usr/include/X11/keysymdef.h\fR.
For example, on the HP 46021A keyboard, if the upper right unmarked key
on the keypad is to be used for the pause feature, then looking in the
file \fI/usr/include/X11/keysymdef.h\fR shows that the key XK_KP_F4 is
associated with hexadecimal value 0xFF94.
Default: None

.SH FILES
.PD 0
.TP 27
.SM /dev/rscsi
Default CD-ROM device file.
.TP
.SM $HOME/.cdinfo
Contains title and artist information.

.SH BUGS
\fIXcd\fR requires a color display to run.
If \fIxcd\fR is run on an SCSI device, it must be suid to root
to assume control of the SCSI device.

.SH AUTHOR
.TP
\fIXcd\fR was written by John Marvin <jsm@hpfcls.fc.hp.com>.

@EOF
set `sum $sumopt <xcd.1`; if test $1 -ne 50161
then
	echo ERROR: xcd.1 checksum is $1 should be 50161
fi
set `wc -lwc <xcd.1`
if test $1$2$3 != 25513537795
then
	echo ERROR: wc results of xcd.1 are $* should be 255 1353 7795
fi

chmod 644 xcd.1

exit 0

campbelr@hpcuhe.cup.hp.com (Bob Campbell) (04/16/91)

> Someone at HP has most graciously got me a binary copy of XCD which
> "should" work with my HP-IB CD-ROM player. Well it doesn't . Does
> anyone have the source for this? If so please contact me.

If you have a copy of the xcd program I am familiar with, then the
short answer is "No!"  The author wasn't all that excited when it
was released internally.  A future copy may be available through
the usual "no support" methods, but it isn't for me to say.

Xcd as it now exists is not the most stable of programs.  In use on
a 350 it is restarted often, can sometimes hang and once (possibly due
to a bad CD-ROM drive) was involved with a system panic with root disc
corruption.

If you still want to use xcd, please contact me if you have questions.  
I assume that the author will post when and if he wants to get involved.
---------------------------------------------------------------------------
Bob Campbell                Some times I wish that I could stop you from
campbelr@hpda.cup.hp.com    talking, when I hear the silly things you say.
Hewlett Packard                                    - Elvis Costello

munir@hpfcmgw.HP.COM (Munir Mallal) (04/16/91)

> crwxrwxrwx   1 root     other      4 0x070200 Apr 10 16:07 /dev/rdsk/cdrom

Try:                                21 0x070200

also, I believe the program wants to be suid Root, since it likes to do
special ioctls.

Good Luck.