* Sound-card question: HELP
@ 2003-03-17 4:47 William W. Austin
2003-03-17 9:17 ` Interrupt handler Giuliano Pochini
2003-03-17 16:28 ` Sound-card question: HELP Takashi Iwai
0 siblings, 2 replies; 8+ messages in thread
From: William W. Austin @ 2003-03-17 4:47 UTC (permalink / raw)
To: alsa-devel
(Apologies if you see this twice: I also posted a very similar query to the
alsa-user list, earlier tonight.)
I have been using alsa for some time (I'm at the 0.9.1-fr1 level now), and I
have a problem, and to solve that I will probably have to get a new sound card.
I have an sb live! 2.1 card, and had not had any difficult problems until about
a month ago when I got a new machine. On previous machine (same card) I had
been able to load some very large sound font files into the card with sfxload
(we are talking 125+ Mb of files here) and everthing worked without a whimper.
My wife composes, and the ability to load the above sound fonts is _extremely_
important.
However, due to some upcoming work schedule changes (which were the reason for
the new machine), I will be working very late for several months. Normally I
play music (MP3's, cd's) when working, but soundproofing is a problem here and I
will have switch to headphones part of the time. (But only part: I've been
using 4 speakers + subwoofer for a while, and would still like to maintain this
ability with whatever solution I choose.)
I had thought of perhaps getting an Audigy platinum (with the easy headphone
access) but ONLY IF it supports soundfont loading/usage better than the SBlive!
does (and I already know it supports the 4 speakers + subwoofer setup).
HOWEVER in reading both the devel and user lists, and in searching through the
archives, I have not been able to tell whether the audigy handles the loading of
large soundfonts any better than the live! does. (On previous machine, the
fonts loaded correctly; on the new one, after 8-9 MB of files are loaded, I get
the ENOSPC (No space left on device)" message and loading terminates. However,
on on single occasion for reasons unknown the files loaded correctly -- all 125+
Mb of them. I still don't understand...).
So my question is, does the Audigy do a better job of handling the loading of
soundfonts, or is it likely to have the same problem? Failing that, what other
cards offer the capabilities I have mentioned above (large soundfont handling,
front/rear channels, headphone capabilities, not extremely expensive)?
I am running redhat 8.0, kernel-2.4.18-26.8.0 with an Athlon xp2100+ & 1GB of
pc2700 memory; MB is a gigabyte GA-7VAX (the integrated sound on the MB is
disabled).
ANY help on answering the above questions would be _greatly_ appreciated (feel
free to write me off-list if you'd prefer).
Thanks in advance
--
William W. Austin bill@34.mumb.atln.nrcrgais.dsl.att.net
"Life is just a phase I'm going through... this time, anyway..."
-------------------------------------------------------
This SF.net email is sponsored by:Crypto Challenge is now open!
Get cracking and register here for some mind boggling fun and
the chance of winning an Apple iPod:
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: Interrupt handler
2003-03-17 4:47 Sound-card question: HELP William W. Austin
@ 2003-03-17 9:17 ` Giuliano Pochini
2003-03-17 12:49 ` Takashi Iwai
2003-03-17 16:28 ` Sound-card question: HELP Takashi Iwai
1 sibling, 1 reply; 8+ messages in thread
From: Giuliano Pochini @ 2003-03-17 9:17 UTC (permalink / raw)
To: alsa-devel
> When an interrupt arrives and I call snd_pcm_period_elapsed(), what
> function gets from alsa middle layer the new block to play and sets up
> the hardware ?
Ok, nobody answered, perhaps my question was too stupid :))
I still haven't found in the docs how can I get from ALSA the
address of the blocks to play/record, or how to tell ALSA where
it the space I allocated so it knows where it has to write the
audio data to be played.
I can build a very generic scatter-gather list. It has three
instructions: addr/length, generate interrupt, jump. Per example
I can write an sg list like this to emulate the cyclic buffer of
many soundblaster cards:
start:
addr0/len0
Irq
addr1/len1
Irq
goto start
Bye.
-------------------------------------------------------
This SF.net email is sponsored by:Crypto Challenge is now open!
Get cracking and register here for some mind boggling fun and
the chance of winning an Apple iPod:
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Interrupt handler
2003-03-17 9:17 ` Interrupt handler Giuliano Pochini
@ 2003-03-17 12:49 ` Takashi Iwai
2003-03-17 14:22 ` Giuliano Pochini
0 siblings, 1 reply; 8+ messages in thread
From: Takashi Iwai @ 2003-03-17 12:49 UTC (permalink / raw)
To: Giuliano Pochini; +Cc: alsa-devel
At Mon, 17 Mar 2003 10:17:04 +0100 (CET),
Giuliano Pochini wrote:
>
>
> > When an interrupt arrives and I call snd_pcm_period_elapsed(), what
> > function gets from alsa middle layer the new block to play and sets up
> > the hardware ?
>
> Ok, nobody answered, perhaps my question was too stupid :))
both of Jaroslav and I were absent since the last friday to attend at
the LAD meeting...
> I still haven't found in the docs how can I get from ALSA the
> address of the blocks to play/record, or how to tell ALSA where
> it the space I allocated so it knows where it has to write the
> audio data to be played.
first, the data is not necessarily as a block on ALSA.
and second, you don't have to copy the data as long as the hardware
supports DMA on the host memory. the alsa middle layer does this
job.
usually in the interrupt handler, you need to just send "ack" to the
middle layer by calling snd_pcm_period_elapsed(). then, the
middle-layer checks the current position by calling pointer callback,
and copy/send/set-silence in the necessary area.
the pointer callback, thus, must return the current position of the
hardware pointer, i.e. the position offset (in frames) in the DMA
buffer, where the DMA is working right now (or the last finished
positoin, if you cannot get the current DMA pointer due to the
hardware limitation).
Takashi
-------------------------------------------------------
This SF.net email is sponsored by:Crypto Challenge is now open!
Get cracking and register here for some mind boggling fun and
the chance of winning an Apple iPod:
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Interrupt handler
2003-03-17 12:49 ` Takashi Iwai
@ 2003-03-17 14:22 ` Giuliano Pochini
2003-03-18 13:32 ` Takashi Iwai
0 siblings, 1 reply; 8+ messages in thread
From: Giuliano Pochini @ 2003-03-17 14:22 UTC (permalink / raw)
To: Takashi Iwai; +Cc: alsa-devel
On 17-Mar-2003 Takashi Iwai wrote:
> usually in the interrupt handler, you need to just send "ack" to the
> middle layer by calling snd_pcm_period_elapsed(). then, the
> middle-layer checks the current position by calling pointer callback,
> and copy/send/set-silence in the necessary area.
I didn't realize the role of .pointer callback. Tnx.
In hw_params callback I build the hardware sg list according
to sgbuf->table. Then I have to set the card to play the list
in a neverending loop and to issue an irq at the and of each
period. Is it right ?
Bye.
-------------------------------------------------------
This SF.net email is sponsored by:Crypto Challenge is now open!
Get cracking and register here for some mind boggling fun and
the chance of winning an Apple iPod:
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Sound-card question: HELP
2003-03-17 4:47 Sound-card question: HELP William W. Austin
2003-03-17 9:17 ` Interrupt handler Giuliano Pochini
@ 2003-03-17 16:28 ` Takashi Iwai
1 sibling, 0 replies; 8+ messages in thread
From: Takashi Iwai @ 2003-03-17 16:28 UTC (permalink / raw)
To: bill; +Cc: alsa-devel
At Sun, 16 Mar 2003 23:47:19 -0500 (EST),
William W. Austin <bill@34.mumb.atln.nrcrgais.dsl.att.net> wrote:
>
> I had thought of perhaps getting an Audigy platinum (with the easy headphone
> access) but ONLY IF it supports soundfont loading/usage better than the SBlive!
> does (and I already know it supports the 4 speakers + subwoofer setup).
audigy supports 32bit DMA mask (while sb live does only 29bit), so the
chance would be slightly better, but i guess it won't help.
try the below at first.
> HOWEVER in reading both the devel and user lists, and in searching through the
> archives, I have not been able to tell whether the audigy handles the loading of
> large soundfonts any better than the live! does. (On previous machine, the
> fonts loaded correctly; on the new one, after 8-9 MB of files are loaded, I get
> the ENOSPC (No space left on device)" message and loading terminates. However,
> on on single occasion for reasons unknown the files loaded correctly -- all 125+
> Mb of them. I still don't understand...).
please check /proc/asound/card0/wavetable whether the driver has
enough large virtual memory area. the maximum size is configurable
via the max_buffer_size module option of snd-emu10k1. increase this
value e.g. to 256.
if this doesn't help, then it's usually the memory fragmentation
problem. although alsa driver tries to allocate a single kernel page,
the linux kernel sometimes doesn't give you allocate it well
(unfortunately). this should be improved in the later version.
anyway, try to load the soundfont as early as possible after the
boot. and just keep it.
Takashi
-------------------------------------------------------
This SF.net email is sponsored by:Crypto Challenge is now open!
Get cracking and register here for some mind boggling fun and
the chance of winning an Apple iPod:
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Interrupt handler
2003-03-17 14:22 ` Giuliano Pochini
@ 2003-03-18 13:32 ` Takashi Iwai
2003-03-19 1:15 ` Giuliano Pochini
0 siblings, 1 reply; 8+ messages in thread
From: Takashi Iwai @ 2003-03-18 13:32 UTC (permalink / raw)
To: Giuliano Pochini; +Cc: alsa-devel
At Mon, 17 Mar 2003 15:22:45 +0100 (CET),
Giuliano Pochini wrote:
>
>
> On 17-Mar-2003 Takashi Iwai wrote:
> > usually in the interrupt handler, you need to just send "ack" to the
> > middle layer by calling snd_pcm_period_elapsed(). then, the
> > middle-layer checks the current position by calling pointer callback,
> > and copy/send/set-silence in the necessary area.
>
> I didn't realize the role of .pointer callback. Tnx.
>
> In hw_params callback I build the hardware sg list according
> to sgbuf->table. Then I have to set the card to play the list
> in a neverending loop and to issue an irq at the and of each
> period. Is it right ?
yes.
also, don't forget to unlock the spinlock during calling
snd_pcm_period_elapsed() if a single lock is used for callbacks.
as mentioned above, snd_pcm_period_elapsed() will call pointer
callback. if you call snd_pcm_period_elapsed() inside the spinlock,
this may result in a deadlock.
Takashi
-------------------------------------------------------
This SF.net email is sponsored by: Does your code think in ink?
You could win a Tablet PC. Get a free Tablet PC hat just for playing.
What are you waiting for?
http://ads.sourceforge.net/cgi-bin/redirect.pl?micr5043en
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Interrupt handler
2003-03-18 13:32 ` Takashi Iwai
@ 2003-03-19 1:15 ` Giuliano Pochini
2003-03-19 9:38 ` Giuliano Pochini
0 siblings, 1 reply; 8+ messages in thread
From: Giuliano Pochini @ 2003-03-19 1:15 UTC (permalink / raw)
To: Takashi Iwai; +Cc: alsa-devel
On mar, 2003-03-18 at 13:32, Takashi Iwai wrote:
> also, don't forget to unlock the spinlock during calling
> snd_pcm_period_elapsed() if a single lock is used for callbacks.
Yes, I'm following the tutorial and it's clear about that.
Now I have another weird problem. This is a peice of my hw_param
function:
static int pcm_hw_params(){
printk("pcm_hw_params bytes=%d\n",params_buffer_bytes(hw_params));
for (per=0; per<params_periods(hw_params); per++) {
printk("pcm_hw_params Add%d (%x - %d)\n",
per,
sgbuf->table[per].addr,
params_period_bytes(hw_params));
}
}
Mar 19 00:48:33 localhost kernel: pcm_hw_params bytes=44100
Mar 19 00:48:33 localhost kernel: pcm_hw_params Add0 (3a1d000 - 11026)
Mar 19 00:48:33 localhost kernel: pcm_hw_params Add1 (3a1c000 - 11026)
Mar 19 00:48:33 localhost kernel: pcm_hw_params Add2 (3a1b000 - 11026)
Mar 19 00:48:33 localhost kernel: pcm_hw_params OK
Look at the physical addresses. They're spaced by 4KB, but the periods
are 11KB long and 11026*3<44100 !! You can imagine how beatiful sound I
get... What am I missing ?
Bye.
-------------------------------------------------------
This SF.net email is sponsored by: Does your code think in ink?
You could win a Tablet PC. Get a free Tablet PC hat just for playing.
What are you waiting for?
http://ads.sourceforge.net/cgi-bin/redirect.pl?micr5043en
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Interrupt handler
2003-03-19 1:15 ` Giuliano Pochini
@ 2003-03-19 9:38 ` Giuliano Pochini
0 siblings, 0 replies; 8+ messages in thread
From: Giuliano Pochini @ 2003-03-19 9:38 UTC (permalink / raw)
To: Takashi Iwai; +Cc: alsa-devel
> Look at the physical addresses. They're spaced by 4KB, but the periods
> are 11KB long and 11026*3<44100 !! You can imagine how beatiful sound I
> get... What am I missing ?
Ehm, I found the problem, ignore my previous msg.
Bye.
-------------------------------------------------------
This SF.net email is sponsored by: Does your code think in ink?
You could win a Tablet PC. Get a free Tablet PC hat just for playing.
What are you waiting for?
http://ads.sourceforge.net/cgi-bin/redirect.pl?micr5043en
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2003-03-19 9:38 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-03-17 4:47 Sound-card question: HELP William W. Austin
2003-03-17 9:17 ` Interrupt handler Giuliano Pochini
2003-03-17 12:49 ` Takashi Iwai
2003-03-17 14:22 ` Giuliano Pochini
2003-03-18 13:32 ` Takashi Iwai
2003-03-19 1:15 ` Giuliano Pochini
2003-03-19 9:38 ` Giuliano Pochini
2003-03-17 16:28 ` Sound-card question: HELP Takashi Iwai
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.