Linking audio to a kernel

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
atmb4u
Posts: 12
Joined: Tue Oct 16, 2007 7:17 am
Location: ""CEC""

Linking audio to a kernel

Post by atmb4u »

I am a newbbie in this site. Im onto an OS level project. We need to link the audio to the kernel.Please help me
Plz help................ :shock:
Last edited by atmb4u on Wed Oct 17, 2007 6:46 am, edited 1 time in total.
[a:t:m]
WHILE WALKING THROUGH A STORM,WALK WITH YOUR HEADS RIGHT UP,THEN YOU WILL NEVER WALK ALONE
User avatar
Alboin
Member
Member
Posts: 1466
Joined: Thu Jan 04, 2007 3:29 pm
Location: Noricum and Pannonia

Post by Alboin »

Wow.
  • Wrong Forum
  • Asking for "A-Z" or "just giv"
  • Questionable Grammar
  • Did not search this forum\wiki to find your answer. (Otherwise your wouldn't have posted in the manner you did. ;) )
  • ALSA was mentioned on an osdev forum.
To answer, you must first develop your kernel to a certain extent and then write drivers to support your audio card. And no, I've been doing osdev for awhile, and all the time ALSA has never been mentioned, so, sorry.

Please do obey forum policy. Thank you.
C8H10N4O2 | #446691 | Trust the nodes.
User avatar
Brynet-Inc
Member
Member
Posts: 2426
Joined: Tue Oct 17, 2006 9:29 pm
Libera.chat IRC: brynet
Location: Canada
Contact:

Post by Brynet-Inc »

You've already posted this.. and you keep posting it in the wrong section as well :roll:

http://www.osdev.org/phpBB2/viewtopic.php?p=108339

Please don't wait 5 days and ask the same question again.. :lol:
Image
Twitter: @canadianbryan. Award by smcerm, I stole it. Original was larger.
atmb4u
Posts: 12
Joined: Tue Oct 16, 2007 7:17 am
Location: ""CEC""

Post by atmb4u »

Now then plz guide me. I am searching in the wrong area then show me the right path Plz....
This is because I don't know wat to do.....
plz :) :idea: :idea: :idea:
[a:t:m]
WHILE WALKING THROUGH A STORM,WALK WITH YOUR HEADS RIGHT UP,THEN YOU WILL NEVER WALK ALONE
atmb4u
Posts: 12
Joined: Tue Oct 16, 2007 7:17 am
Location: ""CEC""

Post by atmb4u »

Im sorry about the grammer. :cry: :cry: :cry:
Please pardon me...........
[a:t:m]
WHILE WALKING THROUGH A STORM,WALK WITH YOUR HEADS RIGHT UP,THEN YOU WILL NEVER WALK ALONE
User avatar
JackScott
Member
Member
Posts: 1036
Joined: Thu Dec 21, 2006 3:03 am
Location: Hobart, Australia
Mastodon: https://aus.social/@jackscottau
Matrix: @JackScottAU:matrix.org
GitHub: https://github.com/JackScottAU
Contact:

Post by JackScott »

The OSDev wiki forum is generally only for questions relating to the development of the wiki, and questions about dubious content. If you have a general development question (such as this one is) you should consider using the Development board (http://www.osdev.org/phpBB2/viewforum.php?f=1).

As for your actual question, we need more information to be able to help. For instance, what do you mean by 'link audio with the kernel'. I presume you mean you want to support sound cards. Well, there are a lot of different types, all accessed in different ways. Some of them might have ISA interfaces, some have PCI. Others will have non-standard drivers.

To begin with, check out http://www.osdev.org/wiki/Resources#Audio

If you refine your question, hopefully we'll be able to help more.
User avatar
mystran
Member
Member
Posts: 670
Joined: Thu Mar 08, 2007 11:08 am

Post by mystran »

atmb4u wrote:Now then plz guide me. I am searching in the wrong area then show me the right path Plz....
This is because I don't know wat to do.....
plz :) :idea: :idea: :idea:
Fine. You will need three things:

- a device driver for the specific type of audio interface in the computer

- audio data in some format

- some code to feed the data to the driver in the format it understands


How to write device drivers for sound cards should be your first problem. Such a device driver typically fills a buffer for the soundcard, waits until the buffer is empty (or near empty) then fills some more, and so on. Doing this in a reasonable manner involves interrupts, so make sure you can handle those first. Then figure out what device you want to support first (choosing some simple well documented and emulator supported thing like SBpro/16 might be a good idea), and search for documentation of said device.

The part that then feeds data to this driver (into some possibly larger buffer) is relatively easy, if your audio data is something simple. I'd suggest you forget about fancy codecs like MP3 at first, and just use something like uncompressed .WAVs, which are basicly PCM data.

Ofcourse if you've never written any software that plays audio under some normal operating system, I suggest you try that first, before you start messing with your own device drivers.

Did that help any?
The real problem with goto is not with the control transfer, but with environments. Properly tail-recursive closures get both right.
atmb4u
Posts: 12
Joined: Tue Oct 16, 2007 7:17 am
Location: ""CEC""

AUDIO::AUDIO::AUDIO::All around...

Post by atmb4u »

:) :) :) Another foolish doubt. :) :) :)
Is it necessary to have "SPECIFIC" audio drivers to use the audio devices????
Can I use same program to access audio devices in different systems at minimum level???
Can I access it through any other easier means???

Plz Don't feel bored of my foolish questions.


It is to know how much should I study to develop something at this level.
:roll: :roll: :roll:
[a:t:m]
WHILE WALKING THROUGH A STORM,WALK WITH YOUR HEADS RIGHT UP,THEN YOU WILL NEVER WALK ALONE
User avatar
JamesM
Member
Member
Posts: 2935
Joined: Tue Jul 10, 2007 5:27 am
Location: York, United Kingdom
Contact:

Post by JamesM »

Hi,

Every audio chipset is different in some respects unfortunately. Although I'm no expert on the matter I'm sure you can find some traits that run through most (Register addresses etc?) but each will have a difference.
User avatar
mystran
Member
Member
Posts: 670
Joined: Thu Mar 08, 2007 11:08 am

Re: AUDIO::AUDIO::AUDIO::All around...

Post by mystran »

atmb4u wrote: Is it necessary to have "SPECIFIC" audio drivers to use the audio devices????
Yes, although some devices are compatible to other devices (or specifications). It used to be that all audio cards had some level of soundblaster compatibility. Not so anymore, but nowadays many cards (and especially integrated chipsets) follow the AC97 specification, so researching into that might be worth something.
Can I use same program to access audio devices in different systems at minimum level???
Same program, yes, but same driver, no. The program talks to the driver, the driver knows how to speak to a specific audio card.
Can I access it through any other easier means???
In a custom OS.. well, no.
The real problem with goto is not with the control transfer, but with environments. Properly tail-recursive closures get both right.
User avatar
Brynet-Inc
Member
Member
Posts: 2426
Joined: Tue Oct 17, 2006 9:29 pm
Libera.chat IRC: brynet
Location: Canada
Contact:

Re: AUDIO::AUDIO::AUDIO::All around...

Post by Brynet-Inc »

atmb4u wrote:Is it necessary to have "SPECIFIC" audio drivers to use the audio devices????
Typically, Yes - Sound card manufactures don't design their cards identically...
atmb4u wrote:Can I use same program to access audio devices in different systems at minimum level???
Program? Normally you would write the drivers in-kernel or via modules.. and then implement a standard userland API (Like OSS..)
atmb4u wrote:Can I access it through any other easier means???
Intel's AC'97 is often implemented.... if you aren't one of the lucky few, Try looking at other OS's drivers and port them over (licence permitting...)

http://en.wikipedia.org/wiki/AC97 (Fairly common..)
http://en.wikipedia.org/wiki/Intel_High ... tion_Audio (Also widely implemented..)

Please try searching Google or the Wiki first.. in the future ;)

EDIT: mystran got here first sadly, hopefully I was of some help anyway..
Image
Twitter: @canadianbryan. Award by smcerm, I stole it. Original was larger.
User avatar
Dex
Member
Member
Posts: 1444
Joined: Fri Jan 27, 2006 12:00 am
Contact:

Post by Dex »

AC97 are not as good as they seem, as you would need at less 5 differant drivers, to cover the common ones. also most cards are still SB-Pro compatable, but you need to turn it it on, as they default to SB-Pro compatable off.
Also the way they are switch on, is differant on each make of card.
Post Reply