Problem with resourcess... not surely

Hi All,

I am writting some application on embedded device, that has to use mplayer. I want to call mplayer by using system() call, which seems the easiest. However (of course when sufficient number of modules is loaded - significant part of memory is used), I get the error saying "Cannot allocate memory". So this is kind of reasonable I can't do it. However I can call mplayer from within a console and all is fine.
So I thought there may be some issues concerning process limits. So I tried to changed them (such as RLIMIT_NPROC, RLIMIT_AS and few more)(on application startup), by invoking setrlimit (also checked if they were changed by getrlimit, later) and this didn't help.

Maybe some of You do know the solution, how I can make mplayer playing, because this is not a limitation of the hardware, obviously.
Thank You for any response and hint.
Regards,
Krzysztof.

1
2
3
4
5
void GUI::on_pushButton_pressed()
{
    if (system("mplayer -demuxer aac http://gr-relay-3.gaduradio.pl/9")==-1)
        perror ("MPlAYER error");
}
Can you run mplayer from the console when your application is running and at the point that it would make the system call?

One thing to note is that the system command effectively does a fork()/exec(). You may not have the resources to fork() your application, but can fork() the shell. You could implement your own system() call and see where it fails.

What OS is this embedded device running?
Thank You for being concerned :)

Can you run mplayer from the console when your application is running and at the point that it would make the system call?


Yes I can do this. Originally I tried to do this with QProcess, then with pies (popen(), however this is how qprocess works as well), and then tried system calls. None of them worked.

One thing to note is that the system command effectively does a fork()/exec(). You may not have the resources to fork() your application, but can fork() the shell. You could implement your own system() call and see where it fails.

Could You give me any hints, how to fork the shell, not my application, doing anything from my application?

What OS is this embedded device running?

This is the linux Angstrom distribution.

Thanks once more for trying to solve my problem.
Regards,
Krzysztof.
Topic archived. No new replies allowed.