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?
How to read the input from the microphone?
Re: How to read the input from the microphone?
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].
- DavidCooper
- Member
- Posts: 1150
- Joined: Wed Oct 27, 2010 4:53 pm
- Location: Scotland
Re: How to read the input from the microphone?
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
MSB-OS: http://www.magicschoolbook.com/computing/os-project - direct machine code programming
Re: How to read the input from the microphone?
Hi,
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
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.Klakap wrote:How do I read the input from the microphone?
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.
Re: How to read the input from the microphone?
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.
Re: How to read the input from the microphone?
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.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.
Re: How to read the input from the microphone?
Please how do I program the sysOutLong and sysInLong?
Re: How to read the input from the microphone?
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 .
//edit: Ups, I already noticed where it is Header Type .