Date: Tue, 22 Aug 2000 22:44:21 +0400 (MSD) From: dimmy the wild <diwil@dataart.com> To: freebsd-hackers@freebsd.org, freebsd-multimedia@freebsd.org Subject: fm 801 sound Message-ID: <XFMail.000822224421.diwil@dataart.com>
next in thread | raw e-mail | index | archive | help
This message is in MIME format --_=XFMail.1.4.0.FreeBSD:000822224421:1773=_ Content-Type: text/plain; charset=KOI8-R Fellows, Ok, this is a working edition of the fm801 chip driver attached. It tested with play, rvplayer, x11amp. I've found no probs so far. Can anyone put it on the cvs tree? Put it to /usr/src/sys/dev/sound/pci/fms.c To add it to the kernel you have to add the line dev/sound/pci/fms.c optional pcm to the file /usr/src/sys/conf/files and rebuild the kernel... Also the driver is designed to be compiled as a module. Note, that the current edition works only with latest snapshot of the system. To make it working with 4.1 you'll have to apply the following path: ---------------------------------------------------- --- fms.c Tue Aug 22 22:37:07 2000 +++ fms-4.1.c Tue Aug 22 22:39:28 2000 @@ -115,19 +115,10 @@ static int fm801ch_setup(pcm_channel *c); */ -static u_int32_t fmts[] = { - AFMT_U8, - AFMT_STEREO | AFMT_U8, - AFMT_S16_LE, - AFMT_STEREO | AFMT_S16_LE, /* - AFMT_STEREO | (AFMT_S16_LE | AFMT_S16_BE | AFMT_U16_LE | AFMT_U16_BE), - (AFMT_S16_LE | AFMT_S16_BE | AFMT_U16_LE | AFMT_U16_BE), */ - 0 -}; - static pcmchan_caps fm801ch_caps = { 4000, 48000, - fmts, 0 + AFMT_STEREO | AFMT_U8 | AFMT_S16_LE, + AFMT_STEREO | AFMT_U8 | AFMT_S16_LE }; static pcm_channel fm801_chantemplate = { ----------------------------------------------------- Thanks, Dmitry. -- ********************************************************************** ("`-''-/").___..--''"`-._ (\ Dimmy the Wild UA1ACZ `6_ 6 ) `-. ( ).`-.__.`) DataArt Enterprises, Inc. (_Y_.)' ._ ) `._ `. ``-..-' Serpukhovskaja street, 10 _..`--'_..-_/ /--'_.' ,' Saint Petersburg, Russia (il),-'' (li),' ((!.-' +7 (812) 3261780, 5552490 ********************************************************************** --_=XFMail.1.4.0.FreeBSD:000822224421:1773=_ Content-Disposition: attachment; filename="fms.c" Content-Transfer-Encoding: base64 Content-Type: application/octet-stream; name=fms.c; SizeOnDisk=19735 LyoKICogQ29weXJpZ2h0IChjKSAyMDAwIERtaXRyeSBEaWNreSBkaXdpbEBkYXRhYXJ0LmNvbQog KiBBbGwgcmlnaHRzIHJlc2VydmVkLgogKgogKiBSZWRpc3RyaWJ1dGlvbiBhbmQgdXNlIGluIHNv dXJjZSBhbmQgYmluYXJ5IGZvcm1zLCB3aXRoIG9yIHdpdGhvdXQKICogbW9kaWZpY2F0aW9uLCBh cmUgcGVybWl0dGVkIHByb3ZpZGVkIHRoYXQgdGhlIGZvbGxvd2luZyBjb25kaXRpb25zCiAqIGFy ZSBtZXQ6CiAqIDEuIFJlZGlzdHJpYnV0aW9ucyBvZiBzb3VyY2UgY29kZSBtdXN0IHJldGFpbiB0 aGUgYWJvdmUgY29weXJpZ2h0CiAqICAgIG5vdGljZSwgdGhpcyBsaXN0IG9mIGNvbmRpdGlvbnMg YW5kIHRoZSBmb2xsb3dpbmcgZGlzY2xhaW1lci4KICogMi4gUmVkaXN0cmlidXRpb25zIGluIGJp bmFyeSBmb3JtIG11c3QgcmVwcm9kdWNlIHRoZSBhYm92ZSBjb3B5cmlnaHQKICogICAgbm90aWNl LCB0aGlzIGxpc3Qgb2YgY29uZGl0aW9ucyBhbmQgdGhlIGZvbGxvd2luZyBkaXNjbGFpbWVyIGlu IHRoZQogKiAgICBkb2N1bWVudGF0aW9uIGFuZC9vciBvdGhlciBtYXRlcmlhbHMgcHJvdmlkZWQg d2l0aCB0aGUgZGlzdHJpYnV0aW9uLgogKgogKiBUSElTIFNPRlRXQVJFIElTIFBST1ZJREVEIEJZ IFRIRSBBVVRIT1IgQU5EIENPTlRSSUJVVE9SUyBgQVMgSVMnJyBBTkQKICogQU5ZIEVYUFJFU1Mg T1IgSU1QTElFRCBXQVJSQU5USUVTLCBJTkNMV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9WRU5ET1JfRk9SVEVNRURJQQkweDEzMTkKI2RlZmlu ZSBQQ0lfREVWSUNFX0ZPUlRFTUVESUExCTB4MDgwMTEzMTkKI2RlZmluZSBQQ0lfREVWSUNFX0ZP UlRFTUVESUEyCTB4MDgwMjEzMTkJLyogPz8/IGhhdmUgbm8gaWRlYSB3aGF0J3MgdGhpcy4uLiAq LwoKI2RlZmluZSBGTV9QQ01fVk9MVU1FICAgICAgICAgICAweDAwCiNkZWZpbmUgRk1fRk1fVk9M VU1FICAgICAgICAgICAgMHgwMgojZGVmaW5lIEZNX0kyU19WT0xVTUUgICAgICAgICAgIDB4MDQK I2RlZmluZSBGTV9SRUNPUkRfU09VUkNFICAgICAgICAweDA2CgojZGVmaW5lIEZNX1BMQVlfQ1RM ICAgICAgICAgICAgIDB4MDgKI2RlZmluZSAgRk1fUExBWV9SQVRFX01BU0sgICAgICAgICAgICAg IDB4MGYwMAojZGVmaW5lICBGTV9QTEFZX0JVRjFfTEFTVCAgICAgICAgICAgICAgMHgwMDAxCiNk ZWZpbmUgIEZNX1BMQVlfQlVGMl9MQVNUICAgICAgICAgICAgICAweDAwMDIKI2RlZmluZSAgRk1f UExBWV9TVEFSVCAgICAgICAgICAgICAgICAgIDB4MDAyMAojZGVmaW5lICBGTV9QTEFZX1BBVVNF ICAgICAgICAgICAgICAgICAgMHgwMDQwCiNkZWZpbmUgIEZNX1BMQVlfU1RPUE5PVyAgICAgICAg ICAgICAgICAweDAwODAKI2RlZmluZSAgRk1fUExBWV8xNkJJVCAgICAgICAgICAgICAgICAgIDB4 NDAwMAojZGVmaW5lICBGTV9QTEFZX1NURVJFTyAgICAgICAgICAgICAgICAgMHg4MDAwCgojZGVm aW5lIEZNX1BMQVlfRE1BTEVOICAgICAgICAgIDB4MGEKI2RlZmluZSBGTV9QTEFZX0RNQUJVRjEg ICAgICAgICAweDBjCiNkZWZpbmUgRk1fUExBWV9ETUFCVUYyICAgICAgICAgMHgxMAoKCiNkZWZp bmUgRk1fUkVDX0NUTCAgICAgICAgICAgICAgMHgxNAojZGVmaW5lICBGTV9SRUNfUkFURV9NQVNL ICAgICAgICAgICAgICAgMHgwZjAwCiNkZWZpbmUgIEZNX1JFQ19CVUYxX0xBU1QgICAgICAgICAg ICAgICAweDAwMDEKI2RlZmluZSAgRk1fUkVDX0JVRjJfTEFTVCAgICAgICAgICAgICAgIDB4MDAw MgojZGVmaW5lICBGTV9SRUNfU1RBUlQgICAgICAgICAgICAgICAgICAgMHgwMDIwCiNkZWZpbmUg IEZNX1JFQ19QQVVTRSAgICAgICAgICAgICAgICAgICAweDAwNDAKI2RlZmluZSAgRk1fUkVDX1NU T1BOT1cgICAgICAgICAgICAgICAgIDB4MDA4MAojZGVmaW5lICBGTV9SRUNfMTZCSVQgICAgICAg ICAgICAgICAgICAgMHg0MDAwCiNkZWZpbmUgIEZNX1JFQ19TVEVSRU8gICAgICAgICAgICAgICAg ICAweDgwMDAKCgojZGVmaW5lIEZNX1JFQ19ETUFMRU4gICAgICAgICAgIDB4MTYKI2RlZmluZSBG TV9SRUNfRE1BQlVGMSAgICAgICAgICAweDE4CiNkZWZpbmUgRk1fUkVDX0RNQUJVRjIgICAgICAg ICAgMHgxYwoKI2RlZmluZSBGTV9DT0RFQ19DVEwgICAgICAgICAgICAweDIyCiNkZWZpbmUgRk1f Vk9MVU1FICAgICAgICAgICAgICAgMHgyNgojZGVmaW5lICBGTV9WT0xVTUVfTVVURSAgICAgICAg ICAgICAgICAgMHg4MDAwCgojZGVmaW5lIEZNX0NPREVDX0NNRCAgICAgICAgICAgIDB4MmEKI2Rl ZmluZSAgRk1fQ09ERUNfQ01EX1JFQUQgICAgICAgICAgICAgIDB4MDA4MAojZGVmaW5lICBGTV9D T0RFQ19DTURfVkFMSUQgICAgICAgICAgICAgMHgwMTAwCiNkZWZpbmUgIEZNX0NPREVDX0NNRF9C VVNZICAgICAgICAgICAgICAweDAyMDAKCiNkZWZpbmUgRk1fQ09ERUNfREFUQSAgICAgICAgICAg MHgyYwoKI2RlZmluZSBGTV9JT19DVEwgICAgICAgICAgICAgICAweDUyCiNkZWZpbmUgRk1fQ0FS RF9DVEwgICAgICAgICAgICAgMHg1NAoKI2RlZmluZSBGTV9JTlRNQVNLICAgICAgICAgICAgICAw eDU2CiNkZWZpbmUgIEZNX0lOVE1BU0tfUExBWSAgICAgICAgICAgICAgICAweDAwMDEKI2RlZmlu ZSAgRk1fSU5UTUFTS19SRUMgICAgICAgICAgICAgICAgIDB4MDAwMgojZGVmaW5lICBGTV9JTlRN QVNLX1ZPTCAgICAgICAgICAgICAgICAgMHgwMDQwCiNkZWZpbmUgIEZNX0lOVE1BU0tfTVBVICAg ICAgICAgICAgICAgICAweDAwODAKCiNkZWZpbmUgRk1fSU5UU1RBVFVTICAgICAgICAgICAgMHg1 YQojZGVmaW5lICBGTV9JTlRTVEFUVVNfUExBWSAgICAgICAgICAgICAgMHgwMTAwCiNkZWZpbmUg IEZNX0lOVFNUQVRVU19SRUMgICAgICAgICAgICAgICAweDAyMDAKI2RlZmluZSAgRk1fSU5UU1RB VFVTX1ZPTCAgICAgICAgICAgICAgIDB4NDAwMAojZGVmaW5lICBGTV9JTlRTVEFUVVNfTVBVICAg ICAgICAgICAgICAgMHg4MDAwCgojZGVmaW5lIEZNODAxX0JVRkZTSVpFIDEwMjQqNAkvKiBPdGhl ciB2YWx1ZXMgZG8gbm90IHdvcmshISEgKi8KCi8qIGRlYnVnIHB1cnBvc2VzICovCiNkZWZpbmUg RFBSSU5UCSBpZigwKSBwcmludGYKCgovKiBjaGFubmVsIGludGVyZmFjZSAqLwpzdGF0aWMgdm9p ZCAqZm04MDFjaF9pbml0KHZvaWQgKmRldmluZm8sIHNuZF9kYnVmICpiLCBwY21fY2hhbm5lbCAq YywgaW50IGRpcik7CnN0YXRpYyBpbnQgZm04MDFjaF9zZXRkaXIodm9pZCAqZGF0YSwgaW50IGRp cik7CnN0YXRpYyBpbnQgZm04MDFjaF9zZXRmb3JtYXQodm9pZCAqZGF0YSw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TX1JFU19JUlEsIGZtODAxLT5pcnFpZCwgZm04MDEtPmlycSk7CglmcmVlKGZtODAxLCBNX0RF VkJVRik7CglyZXR1cm4gMDsJCn0KCnN0YXRpYyBkZXZpY2VfbWV0aG9kX3QgZm04MDFfbWV0aG9k c1tdID0gewoJLyogRGV2aWNlIGludGVyZmFjZSAqLwoJREVWTUVUSE9EKGRldmljZV9wcm9iZSwJ CWZtODAxX3BjaV9wcm9iZSksCglERVZNRVRIT0QoZGV2aWNlX2F0dGFjaCwJZm04MDFfcGNpX2F0 dGFjaCksCglERVZNRVRIT0QoZGV2aWNlX2RldGFjaCwJZm04MDFfcGNpX2RldGFjaCksCgl7IDAs IDB9Cn07CgpzdGF0aWMgZHJpdmVyX3QgZm04MDFfZHJpdmVyID0gewoJInBjbSIsCglmbTgwMV9t ZXRob2RzLAoJc2l6ZW9mKHNuZGRldl9pbmZvKSwKfTsKCnN0YXRpYyBkZXZjbGFzc190IHBjbV9k ZXZjbGFzczsKCkRSSVZFUl9NT0RVTEUoZm04MDEsIHBjaSwgZm04MDFfZHJpdmVyLCBwY21fZGV2 Y2xhc3MsMCwgMCk7Cg== --_=XFMail.1.4.0.FreeBSD:000822224421:1773=_-- End of MIME message To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-multimedia" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XFMail.000822224421.diwil>