How to get the io-address for mmap_device_io()?

I’d like to use in8() and out8() to received and send data from two sound card on different PCs, if it can be done with in8() and out8()… :confused:
And I understand that mmap_device_io() need to be used first to access the sound card register. But I how can I find the IObase address? I use command pci and got two addresses:
PCI IO ADDRESS= ee00h and PCI IO ADDRESS= edc0h, are they the addresses? Then how to use them two?

And the audio card has two channels, can I use only use one channel by access one address?or some other ways?

Many thanks in advance!

I hope you are not saying you want to access both sound cards from the same PC using in8() and out8(). in8() and out8() only work locally. Sound cards generally get data using DMA. The in and out routines will setup the DMA but the data will first have to placed in a DMA safe buffer. To find the IO addresses you might want to check out the pci_*() routines. address ee00h and edc0h are not the same.

A lot of the information you are requesting will be specific to the card you are using, but you don’t mention what that is.

You also don’t mention the level of programming you are doing. Are you writing a driver for a card? You should make sure that the driver doesn’t already exist, otherwise reading and writing to the card would be via the driver and much easier.

Hello Maschoen, thank you for your reply.
I use two PCs. Actually I just want to use the sound card on one PC to simulate and output a analog signal, and than use the other PC to receive the signal, because the sound card is a kind of ADC.
The sound card is AC 97 as I remenber, and I don’t write a driver I just want to read and write. I read the sound card DDK document, and there are snd_pcm_playback/capture functions.
But I am wondering it could be easier to use in/out8(), if they can be use in this case.
So can I use in8 and out8() function here ?
Thanks a lot.

If you have a driver, you do not want to use in8 and out8. They talk directly to the hardware. To know how to use them you need specifications for the hardware. Every sound card is different. The purpose of the driver is to remove this complication from an application programmer.

But I am wondering it could be easier to use in/out8(),
It would be much harder.

Ok, so do you mean use the snd_pcm_* functions instead of in/out8(). Then I will working on snd_pcm_*. Thanks