>> We're effectively talking about a driver for the Motorola DSP
>> onboard (I can't remember what the no is.)
>No, that stuff is "secret". The microcode is available only as raw
>binaries, and the driver's job is to talk to the microcode; not the
>hardware directly. So, we're talking about Linux kernel space only;
>no DSP code.
When you say "available as binaries" I take it that it's still running on
board the card's ROM? (ie microcode implemented within the card, not the
host.)
[This is a conversation Francois and I have been having this morning.
There is a general problem with LADSPA wrapper plugins that create
plugins from other sources. Its not possible for them to pick unique IDs
as they dont know what has been assigned and what hasn't]
On Tue, Mar 18, 2003 at 10:14:44AM +0100, Francois Dechelle wrote:
> > That reminds me, there was another issue that Thomas raised, theres
> > currently no way to create a one-time unique LADSPA id, which I guess you
> > would need for this to work reliably.
>
> Yes, it is something that I need. The problem is that the jmaxladspa
> plugin is not a unique plugin: the number of plugins it defines is
> variable (it is the number of .jmax files that are in LADSPA_PATH
> directories).
>
> A temporary solution would be to allocate to the jMax plugin a range of
> unique IDs and that no more than this range patches can be loaded. What
> do you think about it?
Thats OK as a quick fix, but it doesn't solve the broader problem, if you
save state from a host using jMax LADSPA plugins then it wont necceserily
be the same set when you reload.
I think LADSPA needs self assigned ID's, if the UID space were bigger we
could just reseve the top bit for self assigned stuff and hash unique
strings to fill it, but as its only 32bits thats not enough space.
> Apart from this solution, I don't see how to do it.
Agreed, without a change to LADSPA I dont think its possible.
One solution could be to use a reserved ID range to flag that the ID isn't
globally unique, but the label string (not name) is, so hosts should save
state aginst the label not the ID. It has very dodgy semantics though.
A better solution would be to expand the ID space to 64bits, and reserve
the top bit's worth, which is plenty, but will break binary compatibility
of course.
> Another question: is there a plan to get plugin port values that are not
> floats? More precisely, I am thinking of transforming a patch that does
> granular synthesis into a plugin. But this patch needs a sound file
> name. How can I pass it to the LADSPA plugin?
You can't. I think this is thought to be outside the remit of LADSPA.
> BTW, do you think we should discuss this on jMax mailing list or on
> linux-audio-dev?
Yes, both probably, but I've forgotten what email address I subscribed to
the jMax list with. I guess I should resubscribe. I'l CC this to l-a-d in
the meantime.
- Steve
hi all,
so i've tried to make a new scheduling policy for linux. i've
called it SCHED_USERFIFO. the intent is basically to allow a process
ask for x amount of processor time out of every y jiffies. (the user
part is in the hope that the administrator can set rlimits on the
amount of percentage of time requested and allow non-priviledged users
to use this policy without being able to complete hang the box).
it works just like SCHED_FIFO as long as the process doesn't take
more than the amount of time it asked for. if it does try to take
more time, it is allowed to be preempted until the period is over.
i hacked this up quickly, and tested it with the program below. i
was able to get a process in a while (1) loop to take up >99.4% of
processor while still being able to kill it from the console (although
trying to do anything interactive was excruciatingly slow during this
time). when i allowed the process to take up 100% of the period, the
system hung (with respect to other processes) as expected. (tested in
vmware, btw).
this patch is against 2.4.20+lowlatency. it's intended mostly
for people to look at and give feedback. it probably won't work on
systems that use APIC's, it doesn't do any sanity checking, and it
doesn't handle jiffy rollover.
(mostly i'm just sending a mail because i'm pleased with myself
and want to share and get feedback; hopefully this sort of does what i
say it does too).
thanks,
rob
here is the test program, note the two new fields in sched_param:
param.period_reserved
param.period_length
these are specified in system ticks. below i give the program
49 out of every 50 ticks.
------------- testprogram.c ----------------
#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>
//#include <sched.h>
// import these directly
#include <sys/time.h>
#include <sys/poll.h>
#define SCHED_OTHER 0
#define SCHED_FIFO 1
#define SCHED_RR 2
#define SCHED_USERFIFO 3
struct sched_param {
int sched_priority;
/* user fifo stuff */
unsigned long period_length;
unsigned long period_reserved;
};
/* return -1 on failure */
int
set_realtime(void)
{
int r;
struct sched_param param;
pid_t pid;
pid = getpid();
param.sched_priority = 50;
param.period_length = 50;
param.period_reserved = 49;
return sched_setscheduler(pid, SCHED_USERFIFO, ¶m);
}
void
waste_time(void)
{
struct timeval tv, tv_old, tv_tmp, tv_timeout;
struct pollfd ufds;
int res;
int i = 0;
ufds.fd = 2;
ufds.events = POLLPRI;
tv_timeout.tv_sec = 0;
tv_timeout.tv_usec = 600;
i = 0;
while (i<40000000L) {
printf("unf\n");
i++;
}
}
int
main(int argc, char ** argv)
{
int i = 0;
if (set_realtime() < 0) {
fprintf(stderr, "couldn't set scheduler to SCHED_USERFIFO\n");
return -1;
}
waste_time();
return 0;
}
---------------------------------------------
here is the kernel patch.
--- pristine/linux-2.4.20/kernel/sched.c 2003-03-17 23:24:02.000000000 -0500
+++ linux/kernel/sched.c 2003-03-17 22:11:13.000000000 -0500
@@ -188,7 +188,42 @@
* runqueue (taking priorities within processes
* into account).
*/
+
+ if (p->policy == SCHED_USERFIFO) {
+
+ /*
+ * check if we are in the right time period
+ *
+ * XXX if it burns though it's entire period and
+ * into the next ?
+ *
+ */
+ if (jiffies >= p->t_period_end) {
+ /* no, start over from now */
+ p->t_period_start = jiffies;
+ p->t_period_end = p->t_period_length + p->t_period_start;
+ p->t_period_remain = p->t_period_reserved;
+ }
+
+ /*
+ * is there any remaining time ?
+ *
+ */
+
+ if (p->t_period_remain > 0) {
+ weight = 1000 + p->rt_priority;
+ } else {
+ /* redundent, for clarity */
+ weight = -1;
+ }
+ goto out;
+ }
+
+ /* normal RT case */
+
weight = 1000 + p->rt_priority;
+
+
out:
return weight;
}
@@ -939,8 +974,8 @@
else {
retval = -EINVAL;
if (policy != SCHED_FIFO && policy != SCHED_RR &&
- policy != SCHED_OTHER)
- goto out_unlock;
+ policy != SCHED_OTHER && policy != SCHED_USERFIFO)
+ goto out_unlock;
}
/*
@@ -964,6 +999,15 @@
retval = 0;
p->policy = policy;
p->rt_priority = lp.sched_priority;
+
+ if (policy == SCHED_USERFIFO) {
+ /* FIXME: no checks, doesn't handle jiffy rollover */
+ p->t_period_length = lp.period_length;
+ p->t_period_reserved = lp.period_reserved;
+ p->t_period_start = jiffies;
+ p->t_period_end = p->t_period_length + p->t_period_start;
+ p->t_period_remain = p->t_period_reserved;
+ }
current->need_resched = 1;
--- pristine/linux-2.4.20/include/linux/sched.h 2003-03-17 23:24:02.000000000 -0500
+++ linux/include/linux/sched.h 2003-03-17 21:55:04.000000000 -0500
@@ -119,7 +119,7 @@
#define SCHED_OTHER 0
#define SCHED_FIFO 1
#define SCHED_RR 2
-
+#define SCHED_USERFIFO 3
/*
* This is an additional bit set when we want to
* yield the CPU for one re-schedule..
@@ -127,7 +127,10 @@
#define SCHED_YIELD 0x10
struct sched_param {
- int sched_priority;
+ int sched_priority;
+ /* user fifo stuff */
+ unsigned long period_length;
+ unsigned long period_reserved;
};
struct completion;
@@ -419,6 +422,15 @@
/* journalling filesystem info */
void *journal_info;
+
+
+ /* our extra stuff */
+
+ unsigned long t_period_end;
+ unsigned long t_period_start;
+ unsigned long t_period_remain;
+ unsigned long t_period_length;
+ unsigned long t_period_reserved;
};
/*
--- pristine/linux-2.4.20/kernel/timer.c 2002-11-28 18:53:15.000000000 -0500
+++ linux/kernel/timer.c 2003-03-17 22:42:52.000000000 -0500
@@ -610,6 +610,15 @@
p->need_resched = 1;
}
}
+ if (p->policy == SCHED_USERFIFO) {
+
+ if (p->t_period_remain == 0) {
+ p->need_resched = 1;
+ } else {
+ p->t_period_remain--;
+ }
+ }
+
if (p->nice > 0)
kstat.per_cpu_nice[cpu] += user_tick;
else
-------------------- end -------------------------------
----
Robert Melby
Georgia Institute of Technology, Atlanta Georgia, 30332
uucp: ...!{decvax,hplabs,ncar,purdue,rutgers}!gatech!prism!gt4255a
Internet: async(a)cc.gatech.edu
I am pleased to announce Octavian - a realtime software synthesizer for GNU\Linux
operating system.
Octavians's design is like analog modular synthesizers, so it can be used both as
synth and as effect processor. Modular tasks separation allow to extend
possibilities in simple way. Modules can be connected between each other via
channels.
Features:
Audio Input/Output:
- OSS
- JACK
MIDI Input/Output:
- OSS
- ALSA
Plugin's compatability:
- native modules
- LADSPA
This is first pre-beta release. It is a big subject for changes and improvements,
so please send your wishes and bugreports.
Roman
-------------------------------------------
-------- mailto: wormpost(a)mail.ru ---------
-------------------------------------------
Hi.
I released ZynAddSubFX 1.2.0
It is a powerfull software synthesizer for Linux and
Windows, and it is located at
http://zynaddsubfx.sourceforge.net/
News:
1.2.0 - ZynAddSubFX is ported to Windows ;-)
- added internal Virtual Keyboard
- added Configuration window
- added frequency tracking to filter
- improved the OscilGen (harmonic filter, RMS
normalisation, etc..)
- improved the recorder (uses the WAV file
format and it starts only when a key is pressed)
- added filter interpolation if the frequency is
changed very fast (it removes some annoying clicks)
- other improovements, bugfixes, speedups and
cleanups of the code
Paul.
__________________________________________________
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
http://platinum.yahoo.com
> I have downloaded the C++ sample code from the echo site. Has anybody
> developed it beyond that point? I will go ahead and set up a web site for
> the management of the development. Are there any suggestions as to the tools
> we will need to collaborate?
Well, base would be CVS and bugzilla. A forum system would be good, as it's
more flexible than a mailing list. phpBB is quite easy to setup, or are you
thinking one of the standard repositories?
I don't have much experience of more advanced tools under Linux; what do you
guys reckon?
It'd be good if we could version control diagrams as well.
My 2 cents ;)
Ranjit.
PyJack 0.1, Initial Release
Download: http://www.a2hd.com/software/
This is a Python module which provides an interface to the Jack Audio
Server. It is possible to access the Jack graph to manipulate port
connections, monitor graph change events, and to perform
soft-realtime audio capture and playback using Numeric Python arrays.
More details, including caveats regarding realtime usage, can be found in
the package documentation.
This software is released under the GPL.
Enjoy,
Andy W. Schmeder
P.S. I will not CC to jackit-devel for future release announcements. This
is only for the initial. Thanks.
--aws
mailto:andy*a2hd,com
http://www.a2hd.com/
>My only interest is in th interface components useful in making a device
>driver.
Sure. I was just curious as to whether there was scope at a later to date to
play with the DSP code.
I've looked at the source again (cheers, David ;) and I can see what David
means, in that for each device (Darla20, Darla24 etc) there is a block of
data defined eg in Darla20DSP.c (in the DSP folder) which is the microcode to
load into the DSP.
So we don't need to mess about with that at this stage, if ever- TBH the hex
doesn't look like code seqs to me (especially the Mia stuff) more like tables
of setup info. Still, as you say, it's irrelevant to what we're doing, which
is to interface that DSP to higher level functions.
Sorry if all this is obvious; hopefully writing up our understanding of what's
going on will help others.
Hello,
Sorry for the OT message but I thought those of you within the UK
might be interested. I am selling lots of Computer Music magazines on
Ebay. I will post to within the UK, and all the auctions start at just
10p (with no reserve), which is pretty good considering each magazine
comes with a CD containing loads of samples and software (and they cost me
5UKP each).
You can see the auctions (with photos and descriptions) at:
http://search.ebay.co.uk/search/search.dll?MfcISAPICommand=GetResult&ebayta…
Thanks for your time.
Cheers,
Bill.
--
Dr. William Bland. Computer Programmer, UK.
www.abstractnonsense.com