MALLOC or

V

vikram

hello sir,
plz have patience to read this looooong mail.
i need to design a high speed recording system.
the pci card has a plx chip which provides dma facilty for data
transfer.
for dma i need the source address and the destination address....
i have input audio files (.wav files) i need to read the data from the
files and store the audio data in an buffer.
buffer is malloc(sizeof(audio File)) or virtualalloc(...)

then i give this buffer[0] as the start address for dma transfer.and
the destination address as the plx register offset which is mapped to
a FIFO.from FIFO output goes to analog output where data is recorded.

Now the question is i need the whole of audio data in RAM.
due to performance issues.. i cant fetch from hard disk and start
transfer.
i need data in memory and start transfer... will it hold data upto
1.5GB in RAM ...?
any suggestion is apprecieated..
 
J

Jeff Schwab

vikram said:
hello sir,
plz have patience to read this looooong mail.
i need to design a high speed recording system.
the pci card has a plx chip which provides dma facilty for data
transfer.
for dma i need the source address and the destination address....
i have input audio files (.wav files) i need to read the data from the
files and store the audio data in an buffer.
buffer is malloc(sizeof(audio File)) or virtualalloc(...)

then i give this buffer[0] as the start address for dma transfer.and
the destination address as the plx register offset which is mapped to
a FIFO.from FIFO output goes to analog output where data is recorded.

Now the question is i need the whole of audio data in RAM.
due to performance issues.. i cant fetch from hard disk and start
transfer.
i need data in memory and start transfer... will it hold data upto
1.5GB in RAM ...?
any suggestion is apprecieated..

How much RAM you have is about as platform-specific as it gets.

C++ doesn't place any particular limit on maximum buffer size. With
current technology, 1.5 GB buffers are certainly possible, and probably
not uncommon. You have to find out whether you particular system has
enough RAM.
 
J

JKop

vikram posted:
hello sir,
plz have patience to read this looooong mail.
i need to design a high speed recording system.
the pci card has a plx chip which provides dma facilty for data
transfer.
for dma i need the source address and the destination address....
i have input audio files (.wav files) i need to read the data from the
files and store the audio data in an buffer.
buffer is malloc(sizeof(audio File)) or virtualalloc(...)

then i give this buffer[0] as the start address for dma transfer.and
the destination address as the plx register offset which is mapped to
a FIFO.from FIFO output goes to analog output where data is recorded.

Now the question is i need the whole of audio data in RAM.
due to performance issues.. i cant fetch from hard disk and start
transfer.
i need data in memory and start transfer... will it hold data upto
1.5GB in RAM ...?
any suggestion is apprecieated..


Stream it from the storage.

For instance, open an MP3 file and play it. Watch the light on your computer
that indicates Hard Disk usage.


-JKop
 
P

Peter van Merkerk

vikram said:
hello sir,
plz have patience to read this looooong mail.
i need to design a high speed recording system.
the pci card has a plx chip which provides dma facilty for data
transfer.
for dma i need the source address and the destination address....

Not only that but the PLX chip needs physical rather than virtual
addresses.
i have input audio files (.wav files) i need to read the data from the
files and store the audio data in an buffer.
buffer is malloc(sizeof(audio File)) or virtualalloc(...)

virtualalloc(...) isn't a standard C++ function, I assume you are
programming on a Win32 platform?

On a Win32 system malloc() and VirtualAlloc() return virtual rather than
physical addresses. But that is only one problem. On systems with virtual
memory (like Windows) there is no guarantee that the memory you allocate is
backed by physical RAM memory, it may be on the hard disk or not even
committed at all. In other words even if malloc() succeeds the allocated
memory may not be accessible by the PLX.

To control the PLX chip you will need to write a device driver or use a
toolkit that allows you to access hardware and allocate physical RAM from a
user mode program.
then i give this buffer[0] as the start address for dma transfer.and
the destination address as the plx register offset which is mapped to
a FIFO.from FIFO output goes to analog output where data is recorded.

Now the question is i need the whole of audio data in RAM.
due to performance issues.. i cant fetch from hard disk and start
transfer.

Are you sure there is a performance issue? Normally the speed of a hard
disks is more than adequate for audio applications. If made audio and video
applications in the past and certainly for for audio applications the speed
of the harddisk has never been an issue.
i need data in memory and start transfer... will it hold data upto
1.5GB in RAM ...?

This obviously depends on how much RAM is in your system. Also some concern
is if your PLX chip supports scatter/gatter lists (the old PLX chips didn't
allow scatter/gatter lists on the PCI side of the bridge), otherwise the
physical RAM needs to be contiguous as well...
any suggestion is apprecieated..

This question has nothing to do with the C++ language (the topic of this
newsgroup). I suggest you read this first:
http://www.slack.net/~shiva/welcome.txt and then visit one of the newsgroup
dedicated to the OS you are using.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,812
Latest member
GracielaWa

Latest Threads

Top