* (no subject)
@ 2003-07-16 1:55 Eliot Blennerhassett
2003-07-16 11:40 ` Takashi Iwai
2003-07-16 14:56 ` 24 bit pcm_meter ? Case van Rij
0 siblings, 2 replies; 3+ messages in thread
From: Eliot Blennerhassett @ 2003-07-16 1:55 UTC (permalink / raw)
To: alsa-devel
The problem I am seeking help on is not an ALSA problem per-se, but as I am
working on an ALSA driver I thought I'd start here...
any suggestions for a more appropriate forum will be gratefully accepted.
Background info:
I have a lowlevel driver that works fine when I used semaphores to prevent
conention for my hardware. Access was soley via ioctl into my driver.
I have to change the semaphore to a spinlock now that I also call basically the
same entry point from a timer routine in my ALSA driver.
When I record from the card the data is read from the card into a userspace
buffer
ptr,size = <Buffer pointer,size received from user application>
fs = get_fs();
set_fs(get_ds());
/* Ensure that the data buffer is resident in memory. */
if (!access_ok (wrflag ? VERIFY_WRITE : VERIFY_READ, ptr, bytes))
{
set_fs(fs);
return -EFAULT;
}
/* Inside here is the spinlock, and a copy to the ptr mentioned above */
HPI_MessageF (gphHpiSubsys, &hm, &hr, file );
set_fs(fs);
Problem:
The single change from semaphore to spinlock results in a kernel panic when I
try to record from my card:
Unable to handle kernel paging request at virtual address ...
Question:
Notwithstanding bad style etc, am I doing something that is fundamentally wrong
in using a userspace buffer when I am inside a spinlock i.e. in interrupt
context? (In the same way as I must not use a semaphore in interrupt context)
Could it be that when I try to write to the buffer it causes a page fault, which
cannot be handled in interrupt context?
But I thought that access_ok call should take care of making sure the buffer is
in memory...
TIA for any insights you may have.
Eliot Blennerhassett
AudioScience Inc.
--
Junk footer beyond this point. Read at your own risk.
-------------------------------------------------------------
Sign up for ICQmail at http://www.icq.com/icqmail/signup.html
-------------------------------------------------------
This SF.net email is sponsored by: VM Ware
With VMware you can run multiple operating systems on a single machine.
WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the
same time. Free trial click here: http://www.vmware.com/wl/offer/345/0
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: (no subject)
2003-07-16 1:55 (no subject) Eliot Blennerhassett
@ 2003-07-16 11:40 ` Takashi Iwai
2003-07-16 14:56 ` 24 bit pcm_meter ? Case van Rij
1 sibling, 0 replies; 3+ messages in thread
From: Takashi Iwai @ 2003-07-16 11:40 UTC (permalink / raw)
To: Eliot Blennerhassett; +Cc: alsa-devel
At Tue, 15 Jul 2003 18:55:10 -0700 (PDT),
Eliot Blennerhassett wrote:
>
> Question:
> Notwithstanding bad style etc, am I doing something that is fundamentally wrong
> in using a userspace buffer when I am inside a spinlock i.e. in interrupt
> context? (In the same way as I must not use a semaphore in interrupt context)
yes. you cannot copy_from/to_user() in the atomic situation.
Takashi
-------------------------------------------------------
This SF.net email is sponsored by: VM Ware
With VMware you can run multiple operating systems on a single machine.
WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the
same time. Free trial click here: http://www.vmware.com/wl/offer/345/0
^ permalink raw reply [flat|nested] 3+ messages in thread
* 24 bit pcm_meter ?
2003-07-16 1:55 (no subject) Eliot Blennerhassett
2003-07-16 11:40 ` Takashi Iwai
@ 2003-07-16 14:56 ` Case van Rij
1 sibling, 0 replies; 3+ messages in thread
From: Case van Rij @ 2003-07-16 14:56 UTC (permalink / raw)
To: alsa-devel
I'm trying to write and/or use a meter plugin like ameter with the rme
hammerfall dsp/rme 9652 so much without much success, presumably because
of the 24 bit/non-interleaved format this card seems to internally (?)
I noticed s16_enable( ) in alsa-lib/pcm_meter.c includes some support
for other slave pcm formats, would that (in theory) mean it should work
with the RME ?
snd_pcm_scope_s16_open( ) does seem to work (it doesnt fail) but
when running arecord
pcm_mmap.c:137: snd_pcm_mmap_read_areas:
Assertion `snd_pcm_mmap_capture_avail(pcm) >= size)`
snd_pcm_mmap_capture_avail returns 0 which shouldnt happen in
snd_pcm_mmap_read_areas() .. im trying to determine if this would be the
result of the format issue.
So far attempts at using a plug with a fixed format as slave for ameter
have failed.
pcm.short {
type plug;
slave {
pcm "hw:0,0"
format "S16_LE"
}
}
pcm.ameter {
type meter
# slave.pcm 'hw:0,0'
slave.pcm 'short'
frequency 10
scopes.0 ameter
}
Any ideas ?
Thanks,
Case
-------------------------------------------------------
This SF.net email is sponsored by: VM Ware
With VMware you can run multiple operating systems on a single machine.
WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the
same time. Free trial click here: http://www.vmware.com/wl/offer/345/0
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2003-07-16 14:56 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-16 1:55 (no subject) Eliot Blennerhassett
2003-07-16 11:40 ` Takashi Iwai
2003-07-16 14:56 ` 24 bit pcm_meter ? Case van Rij
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.