Login
Username:

Password:

Remember me



Lost Password?

Register now!
Main Menu
Who's Online
1 user(s) are online (1 user(s) are browsing Forum)

Members: 0
Guests: 1

more...

Browsing this Thread:   1 Anonymous Users



« 1 (2) 3 4 »


Re: UADE

Joined:
2011/9/25 1:23
From Hungary
Group:
Member
Posts: 1508
Offline
If I get lucky, I'll be able to replace just the lowest level of the IPC mechanism. These piped files are only used to pass uade messages, which are 4k at max, and strings. I don't know how many characters are passed in each string, but I hope I can squeeze everything into 64k.

If I can get this to work, I hope someone will make a neat MUI player using uadecore

Posted on: 2012/8/30 5:14
_________________
My AROS&MorphOS ports
Arguments that explain everything... explain nothing.
Transfer the post to other applications Transfer


Re: UADE

Joined:
2011/9/25 1:23
From Hungary
Group:
Member
Posts: 1508
Offline
Check this out: http://www.youtube.com/watch?v=hs_sJFUTeOw

Note the ugly code in the background

Posted on: 2012/8/31 5:09
_________________
My AROS&MorphOS ports
Arguments that explain everything... explain nothing.
Transfer the post to other applications Transfer


Re: UADE

Joined:
2011/10/30 16:46
From Germany
Group:
Member
Posts: 275
Offline

BSzili, BSzili, go go go!

Very cool!

Posted on: 2012/8/31 5:56
Transfer the post to other applications Transfer


Re: UADE

Joined:
2011/6/30 19:50
Group:
Member
Posts: 4095
Offline
@bszili,

i'm speechless. QBit's answer + 1

Posted on: 2012/8/31 6:35
Transfer the post to other applications Transfer


Re: UADE

Joined:
2011/9/25 1:23
From Hungary
Group:
Member
Posts: 1508
Offline
This is a more or less usable version: uade.lha

I had to increase the message size from 4k to 32k to get a stutter-free playback. Unfortunately my code has some speed problems. This is how the low-level IPC looks like:
ssize_t uade_ipc_read(void *f, const struct uade_msg *um, const void *buf)
{
    
struct MsgPort *msgport = (struct MsgPort *) f;
    
struct UADEMessage *msg;

    
/*Wait(1 << msgport->mp_SigBit);
    WaitPort(msgport);
    msg = (struct UADEMessage *) GetMsg(msgport);*/
    
    /* ugly busy loop, because WaitPort isn't working... */
    
while (!(msg = (struct UADEMessage *) GetMsg(msgport)))
    {
        
Delay(1);
    }

    
CopyMemQuick(&msg->umumsizeof(struct uade_msg));
    
CopyMem(msg->databufntohl(um->size));
    
ReplyMsg(msg);
    
    return 
1;
}


ssize_t uade_ipc_write(void *f, const struct uade_msg *um, const void *buf)
{
    
struct MsgPort *msgport = (struct MsgPort *) f;
    
struct MsgPort *replyport;
    
struct UADEMessage msg;

    if ((
replyport CreateMsgPort()))
    {
        
msg.message.mn_Node.ln_Type NT_MESSAGE;
        
msg.message.mn_Length sizeof(struct UADEMessage);
        
msg.message.mn_ReplyPort replyport;

        
CopyMemQuick(um, &msg.umsizeof(struct uade_msg));    
        
CopyMem(bufmsg.datantohl(um->size));
    
        
PutMsg(msgport, (struct Message *) &msg);
        
WaitPort(replyport);
        
DeleteMsgPort(replyport);

        return 
1;
    }

    return 
0;
}

uade_ipc_write always creates a new reply message port, which is very inefficient, but I had some problems with reusing the same port for different writes.
Perhaps the bigger problem is uade_ipc_write, because I couldn't use WaitPort or Wait. They work with the first message, but after that uade_ipc_write will always block on WaitPort, no matter how many messages I put into the port. Wait is no better unfortunately, so I had to use that nasty while(!GetMsg) loop with a 1/50th sec delay. I'm sure that loop chews up some CPU time, but I couldn't come up with a better solution

Posted on: 2012/8/31 9:32
_________________
My AROS&MorphOS ports
Arguments that explain everything... explain nothing.
Transfer the post to other applications Transfer


Re: UADE

Joined:
2011/6/30 19:50
Group:
Member
Posts: 4095
Offline
Hi bszili,

Thank you very much for the link (unfortunatley i have to go out in a moment so am not able to test soon).

That problem is wierd. Your waitport looks good afai can tell and is the normal way of doing things. Doesn't it fire at all ?

The part that you tell you can't use the messageport again sounds strange to me. imho that would be plain stupid if it couldn't.

Maybe you could post the writemessage part ? I'm guessing something goes wrong somewhere or you stumbled upon a not so nice 'feature'.

thanks again. You are clearly the fastest lighting bolt around town

Posted on: 2012/8/31 9:43
Transfer the post to other applications Transfer


Re: UADE

Joined:
2009/10/28 4:25
From Finland
Group:
Member
Posts: 243
Offline
@bszili

Is your msgport allocated in a different task/process? If so you need to update the mp_SigTask field in the msgport first before you can use it.

msgport->mp_SigTask = FindTask(NULL);

Note also that mp_SigBit will be allocated in the wrong task so you might want to allocate a new one just to be safe.

msgport->mp_SigBit = AllocSignal(-1);

You can create a port with no signal like this:
struct MsgPort *CreatePortNoSignal (void) {
    
struct MsgPort *port;
    
port AllocVec(sizeof(*port), MEMF_CLEAR);
    if (
port) {
        
port->mp_Node.ln_Type NT_MSGPORT;
        
port->mp_Flags PA_IGNORE;
        
port->mp_MsgList.lh_Head = (struct Node *)&port->mp_MsgList.lh_Tail;
        
port->mp_MsgList.lh_Tail NULL;
        
port->mp_MsgList.lh_TailPred = (struct Node *)&port->mp_MsgList.lh_Head;
    }
    return 
port;
}

void DeletePortNoSignal (struct MsgPort *port) {
    
FreeVec(port);
}


Just remember to set mp_SigTask, mp_SigBit and mp_Flags to the correct values before using it (mp_Flags should be PA_SIGNAL).

Posted on: 2012/8/31 10:55
Transfer the post to other applications Transfer


Re: UADE

Joined:
2011/9/25 1:23
From Hungary
Group:
Member
Posts: 1508
Offline
Thanks this solved the problem! The CPU usage is much lower, and the sound won't crackle if I resize windows. I think I can lower the message size now.

Posted on: 2012/8/31 11:30
_________________
My AROS&MorphOS ports
Arguments that explain everything... explain nothing.
Transfer the post to other applications Transfer


Re: UADE

Joined:
2011/6/30 19:50
Group:
Member
Posts: 4095
Offline
This is FF-ing AWESOME !!.

Now playing some future composer mods from my collection... finally i can put that mod-collection to good use on aros .

Nevermind the hickups stutters and other bugs... very funny to see the seconds-counter go faster when more noise is being made

thank you bszili.


Posted on: 2012/8/31 17:18
Transfer the post to other applications Transfer


Re: UADE

Joined:
2011/10/30 16:46
From Germany
Group:
Member
Posts: 275
Offline
UADE runs fine on my machine... great! Mr. BSzili!

It would be fantastic if somebody could make a GUI for UADE!

Posted on: 2012/8/31 22:30
Transfer the post to other applications Transfer



« 1 (2) 3 4 »



You can view topic.
You cannot start a new topic.
You cannot reply to posts.
You cannot edit your posts.
You cannot delete your posts.
You cannot add new polls.
You cannot vote in polls.
You cannot attach files to posts.
You cannot post without approval.

[Advanced Search]


Search
Top Posters
1 paolone
paolone
4375
2 magorium
magorium
4095
3 phoenixkonsole
phoenixkonsole
3897
4 nikolaos
nikolaos
3761
5 deadwood
deadwood
2923
6 ncafferkey
ncafferkey
2693
7 mazze
mazze
2216
8 clusteruk
clusteruk
2111
9 Kalamatee
Kalamatee
2026
10 damocles
damocles
1789
© 2004-2017 AROS Exec