OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 11:15 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: How to read the input from the microphone?
PostPosted: Sat Apr 14, 2018 6:09 am 
Offline
Member
Member

Joined: Sat Mar 10, 2018 10:16 am
Posts: 296
Good day!
How do I read the input from the microphone? On osdev or on the forum, I found no instructions on how to make the support of the microphone. Please how do I do that?

_________________
https://github.com/VendelinSlezak/BleskOS


Top
 Profile  
 
 Post subject: Re: How to read the input from the microphone?
PostPosted: Sat Apr 14, 2018 6:30 am 
Offline
Member
Member

Joined: Thu May 17, 2007 1:27 pm
Posts: 999
You probably need a driver for Intel HD audio devices or for some USB audio class. (But I have no experience writing a driver for either of those.)

_________________
managarm: Microkernel-based OS capable of running a Wayland desktop (Discord: https://discord.gg/7WB6Ur3). My OS-dev projects: [mlibc: Portable C library for managarm, qword, Linux, Sigma, ...] [LAI: AML interpreter] [xbstrap: Build system for OS distributions].


Top
 Profile  
 
 Post subject: Re: How to read the input from the microphone?
PostPosted: Sat Apr 14, 2018 11:35 am 
Offline
Member
Member
User avatar

Joined: Wed Oct 27, 2010 4:53 pm
Posts: 1150
Location: Scotland
On older machines you can use AC97 (although it's hard to support), but any machine modern enough to be worth programming for will likely use the more civilised Intel HD Audio instead, so your starting point should be to read this page of the Wiki: https://wiki.osdev.org/Intel_High_Definition_Audio. You may also need to read up on PCI (to find out what kind of sound card your machine supports). For USB microphones it's a lot more work as you also need to write USB drivers.

_________________
Help the people of Laos by liking - https://www.facebook.com/TheSBInitiative/?ref=py_c

MSB-OS: http://www.magicschoolbook.com/computing/os-project - direct machine code programming


Top
 Profile  
 
 Post subject: Re: How to read the input from the microphone?
PostPosted: Sat Apr 14, 2018 4:02 pm 
Offline
Member
Member
User avatar

Joined: Sat Jan 15, 2005 12:00 am
Posts: 8561
Location: At his keyboard!
Hi,

Klakap wrote:
How do I read the input from the microphone?


Imagine that a computer is a tree of devices; with things like CPU and memory near the root node of the tree, and things like microphones at the end-nodes/leaves. Your question indicates that you're working from end nodes back to the root node; but it's better to work from the root node to the end nodes.

More specifically; it's better to do PCI bus enumeration, then choose a specific device in the list of unsupported devices that your software generated (e.g. maybe "vendor ID = 0x1002, device ID = 0xAA38", which corresponds to an "ATI RV710/730 HDMI Audio" device); then find the documentation for that specific PCI device and write a driver for it. While writing this driver you'll notice the device's documentation (hopefully) includes information about detecting and controlling attached devices (like speakers and microphones), so you'll naturally move one step closer to the end nodes in that part of the tree of devices.


Cheers,

Brendan

_________________
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.


Top
 Profile  
 
 Post subject: Re: How to read the input from the microphone?
PostPosted: Mon Apr 16, 2018 11:19 am 
Offline
Member
Member

Joined: Sat Mar 10, 2018 10:16 am
Posts: 296
Please how do I implement the PCI into my OS? On the page https://wiki.osdev.org/PCI I found no code that would have something to read PCI.

_________________
https://github.com/VendelinSlezak/BleskOS


Top
 Profile  
 
 Post subject: Re: How to read the input from the microphone?
PostPosted: Mon Apr 16, 2018 11:29 am 
Offline
Member
Member

Joined: Tue Apr 03, 2018 2:44 pm
Posts: 36
Klakap wrote:
Please how do I implement the PCI into my OS? On the page https://wiki.osdev.org/PCI I found no code that would have something to read PCI.


What are you having trouble with exactly? That page shows you exactly how to do PCI bus enumeration just like Brendan suggested. I mean there's even a function called pciConfigReadWord, which should answer "something to read PCI". The point of that article is to discover what devices are available. Then, like Brendan said, you can use the device id and vendor id to lookup the documentation for that specific thing, and then you make a driver for it.

_________________
Image is my operating system.

"...not because [it is] easy, but because [it is] hard; because that goal will serve to organize and measure the best of [my] energies and skills..."


Top
 Profile  
 
 Post subject: Re: How to read the input from the microphone?
PostPosted: Mon Apr 16, 2018 11:38 am 
Offline
Member
Member

Joined: Sat Mar 10, 2018 10:16 am
Posts: 296
Please how do I program the sysOutLong and sysInLong?

_________________
https://github.com/VendelinSlezak/BleskOS


Top
 Profile  
 
 Post subject: Re: How to read the input from the microphone?
PostPosted: Tue Apr 17, 2018 11:48 am 
Offline
Member
Member

Joined: Sat Mar 10, 2018 10:16 am
Posts: 296
I have already resolve this problem, but I don't know where it is Header Type. Please tell me from where should I read Header Type.
//edit: Ups, I already noticed where it is Header Type :oops: .

_________________
https://github.com/VendelinSlezak/BleskOS


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 88 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group