Return to BSD News archive
Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!news.cs.su.oz.au!metro!munnari.OZ.AU!spool.mu.edu!howland.reston.ans.net!agate!news.ucdavis.edu!quadrophenia.ucdavis.edu!ccjason From: ccjason@quadrophenia.ucdavis.edu (Jason Gabler) Newsgroups: comp.unix.bsd.freebsd.misc Subject: [BUG] IOCTL/CDIO bad audio status report? Date: 17 Dec 1995 11:11:15 GMT Organization: University of California, Davis Lines: 52 Message-ID: <4b0tsj$7rp@mark.ucdavis.edu> NNTP-Posting-Host: quadrophenia.ucdavis.edu X-Newsreader: TIN [version 1.2 PL2] I've been doing extensive ioctl programming for cd-rom player hardware. All of the ioctl calls I have use so far (e.g. play, track status, eject, et. al. have worked beautifully. So I am assuming I do infact know what I am doing :) However, one call that I thought would be simple, do a CDIOCREADSUBCHANNEL and read the audio_status. Here's my little function: int get_cd_status() { struct ioc_read_subchannel sub_chan_info; ioctl(fd, CDIOCREADSUBCHANNEL, (char *)&sub_chan_info); return((int)sub_chan_info.data->header.audio_status); } sub_chan_info.data->header.audio_status is actually a "u_char", so I might be missing something here. But... this call ALWAYS returns 0xc4 hmmmm... here's the sub struct in sys/cdio.h struct cd_sub_channel_header { u_char :8; u_char audio_status; #define CD_AS_AUDIO_INVALID 0x00 #define CD_AS_PLAY_IN_PROGRESS 0x11 #define CD_AS_PLAY_PAUSED 0x12 #define CD_AS_PLAY_COMPLETED 0x13 #define CD_AS_PLAY_ERROR 0x14 #define CD_AS_NO_STATUS 0x15 u_char data_len[2]; }; *Any* ideas? -- Vale, jason .,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,., ` Jason Gabler jygabler@ucdavis.edu ` ' campus office: 916-752-9215 home office: 415-752-1969 ' ' Distributed Computing Analysis & Support, Information Technology, UCD' '----------------------------------------------------------------------` ` <http://quadrophnia.ucdavis.edu> Kerberos/Security Telecommuting ' ' X Windows BSD Dist.-Environments ISDN E-mail Integrity ` `'`'`'`'`'`'`'`'`'`'`'`'`'`'`'`'`'`'`'`'`'`'`'`'`'`'`'`'`'`'`'`'`'`'`'`'