Author Topic: Gpe Pim Apps  (Read 209371 times)

karlto

  • Sr. Member
  • ****
  • Posts: 343
    • View Profile
    • http://
Gpe Pim Apps
« Reply #15 on: March 12, 2006, 01:58:04 pm »
Quote
gpe-announce_0.13_armv5tel.ipk -> Works, what' s the right sound device? I thoutght it was /dev/dsp but it tells me device or resource busy....??????? Let me know it' s fast to correct.

Hi Xromer

I'm pretty certain /dev/dsp is correct, so it sounds like something else has it locked. I'll try the new packages as soon as pgas posts them, and see whether it's just a configuration issue, or hopefully at least find out what is locking the sound device.

Thanks

Karl
SL6000-L, RC12

Xromer

  • Full Member
  • ***
  • Posts: 178
    • View Profile
    • http://
Gpe Pim Apps
« Reply #16 on: March 12, 2006, 02:38:53 pm »
Quote
Quote
gpe-announce_0.13_armv5tel.ipk -> Works, what' s the right sound device? I thoutght it was /dev/dsp but it tells me device or resource busy....??????? Let me know it' s fast to correct.

Hi Xromer

I'm pretty certain /dev/dsp is correct, so it sounds like something else has it locked. I'll try the new packages as soon as pgas posts them, and see whether it's just a configuration issue, or hopefully at least find out what is locking the sound device.

Thanks

Karl
[div align=\"right\"][a href=\"index.php?act=findpost&pid=118195\"][{POST_SNAPBACK}][/a][/div]

THX Karl, i' m now looking at the gtk_get_selection_multiple issue that makes gpe-calendar and gpe-contacts segfault.
First thing i saw that exportation with a 1 file sel widget does not bring to segfault, so i think that making the 1 file selection on the import issue would fix the problem.
But it' s not simple, beacause the need of a redesign of the on_import_vcal function of the main.c file in the gpe-calendar, that' s the same of gpe_contacts.
I now know the functions to change, but the problem it' s i' m at the begin on reading the GTK+ API documentation, so if someone has a good skill and can help would appreciate it.
Ok i' ll wait to your test to fix the sound dev problem.
For the message "There is a problem with the scheduling daemon (perhaps atd is not running)!\nThis can cause issues." i saw is in the event-ui.c file and is related to the schedule issue, i' m trying to understand it too, because in the Zauri it doesn' t pop up ???? STRANGE.
BYEZ!
[span style=\'font-size:10pt;line-height:100%\']I don't know how, but i' ll do!!!
This is how i like to live! :)[/span]

Ipaq hx4700

karlto

  • Sr. Member
  • ****
  • Posts: 343
    • View Profile
    • http://
Gpe Pim Apps
« Reply #17 on: March 12, 2006, 02:59:43 pm »
Quote
For the message "There is a problem with the scheduling daemon (perhaps atd is not running)!\nThis can cause issues." i saw is in the event-ui.c file and is related to the schedule issue, i' m trying to understand it too, because in the Zauri it doesn' t pop up ???? STRANGE.

It pops up for me - not always, but mostly after the first time the appointment is set. I assumed that 'at' will return a value on success or failure of setting a scheduled command, and that perhaps it tried to parse the commands given and failed because gpe-announce doesn't exist? Either that or it says it because not all of the command line switches are supported by the Zaurus version of atd/at? E.g. I don't seem to be able to list the queue, so perhaps calendar requires this to confirm the scheduling worked...?
SL6000-L, RC12

Xromer

  • Full Member
  • ***
  • Posts: 178
    • View Profile
    • http://
Gpe Pim Apps
« Reply #18 on: March 12, 2006, 09:19:36 pm »
Quote
Quote
For the message "There is a problem with the scheduling daemon (perhaps atd is not running)!\nThis can cause issues." i saw is in the event-ui.c file and is related to the schedule issue, i' m trying to understand it too, because in the Zauri it doesn' t pop up ???? STRANGE.

It pops up for me - not always, but mostly after the first time the appointment is set. I assumed that 'at' will return a value on success or failure of setting a scheduled command, and that perhaps it tried to parse the commands given and failed because gpe-announce doesn't exist? Either that or it says it because not all of the command line switches are supported by the Zaurus version of atd/at? E.g. I don't seem to be able to list the queue, so perhaps calendar requires this to confirm the scheduling worked...?
[div align=\"right\"][a href=\"index.php?act=findpost&pid=118206\"][{POST_SNAPBACK}][/a][/div]

Thats the clear command with whom the libschedule interfaces with atd.
sprintf(call_at, "/usr/bin/at -q g -f /tmp/atjob.txt %02d:%02d %02d.%02d.%02d 2>&1", tm.tm_hour, tm.tm_min, tm.tm_mday, tm.tm_mon+1, tm.tm_year-100);
As you can see there are 2 switches -q and -f and after the file reference there' s the time string.
The %02d means that the tm.tm_hour and subsequent variables must return a formatted decimal that is the number you see in the /var/spool/at dir.
Now this code changes are very fast to do, the problem is understand the real behaviour of the 2 at daemons the Desktop' s one and Zauri' s one.
After that there' s the event_ui.c code of the gpe-calendar utility that returns the control of the libschedule.

if (ev->flags & FLAG_ALARM)
   {
     ev_real = get_cloned_ev(ev);
     ev_d = event_db_get_details (ev_real);
     if (((int)(ev->start) != (int)skip) && (uid!=ev_real->uid))
       {
         gchar *action;

         action = g_strdup_printf ("gpe-announce '%s'\ngpe-calendar -s %ld -e %ld &\n",
               ev_d->summary, (long)ev->start, ev_real->uid);
         if (!schedule_set_alarm (ev->uid, ev->start, action, TRUE))
            {
/* silently ignore for Maemo, we do not have scheduling here :-( */
#ifndef IS_HILDON      
             GtkWidget* dialog;
               
              dialog = gtk_message_dialog_new (GTK_WINDOW(d),
                         GTK_DIALOG_DESTROY_WITH_PARENT,
                         GTK_MESSAGE_WARNING,
                         GTK_BUTTONS_CLOSE,
                         _("There is a problem with the scheduling daemon (perhaps atd is not running)!\nThis can cause issues."));
                  gtk_dialog_run (GTK_DIALOG(dialog));
                  gtk_widget_destroy(dialog);
#endif
            }
         g_free (action);
         break;
       }
   }
    }
    event_db_list_destroy (events);
}

As you can see the FLAG ALARM is taken from the libschedule and  the  action gpe-announce '%s'\ngpe-calendar -s %ld -e %ld &\n is taken to wake up gpe-announce. A check of the alarm taken is done by schedule_set_alarm reference to libschedule that in case of failure popups the windows with the massage we know.
So the lack of gpe-announce doesn' t fit anything with the popup.
Always in the schedule_set_alarm  there' s the string that touch the at command i.e. sprintf(call_at, "/usr/bin/at -q g -f /tmp/atjob.txt %02d:%02d %02d.%02d.%02d 2>&1", tm.tm_hour, tm.tm_min, tm.tm_mday, tm.tm_mon+1, tm.tm_year-100);
so giving the right command to the at daemon surely works out the problem.
But i think there' s a difference in the Ipaq and Zauri at port and the Desktop one, as in the Desktop the schedule_set_alarm function fails and i see that atd is not triggered.
Let me know BYEZ!
« Last Edit: March 12, 2006, 09:25:30 pm by Xromer »
[span style=\'font-size:10pt;line-height:100%\']I don't know how, but i' ll do!!!
This is how i like to live! :)[/span]

Ipaq hx4700

karlto

  • Sr. Member
  • ****
  • Posts: 343
    • View Profile
    • http://
Gpe Pim Apps
« Reply #19 on: March 12, 2006, 09:36:06 pm »
Quote
Thats the clear command with whom the libschedule interfaces with atd.
sprintf(call_at, "/usr/bin/at -q g -f /tmp/atjob.txt %02d:%02d %02d.%02d.%02d 2>&1", tm.tm_hour, tm.tm_min, tm.tm_mday, tm.tm_mon+1, tm.tm_year-100);

OK - here's an example command using that format:

Code: [Select]
/usr/bin/at -q g -f /tmp/atjob.txt 15:32 13.03.06
...which does *not* work on my Zaurus. It creates a file with a different extension and different file mode in /var/spool/at, just like gpe-calendar did! at doesn't return; I have to kill it, so this would explain a bad return value.

It *does work* if I remove the -q switch:

Code: [Select]
/usr/bin/at -f /tmp/atjob.txt 15:32 13.03.06
The pdaXrom version of atd does not seem to support queues (e.g. above we are trying to add to a queue called 'g'). As far as I can see, this is only for organising and reviewing purposes, and is not required. Note also that the -l switch (used to list queued commands - see at man page) does not work in pdaXrom, so hopefully it isn't used anywhere either.

I would say just remove the '-q g' switch and see what happens!
SL6000-L, RC12

karlto

  • Sr. Member
  • ****
  • Posts: 343
    • View Profile
    • http://
Gpe Pim Apps
« Reply #20 on: March 12, 2006, 10:18:14 pm »
Quote
gpe-announce_0.13_armv5tel.ipk -> Works, what' s the right sound device? I thoutght it was /dev/dsp but it tells me device or resource busy....??????? Let me know it' s fast to correct.

I just tried this, and it fails for me too. It seems that pdaXrom uses esd, which would explain it. I tried 'esdctl standby' to release /dev/dsp, but it doesn't seem to work.

From what I gather, it should be possible to simply pipe the sound to the program '/usr/bin/esddsp', which gives compatibility with older dsp programs... is this possible? It would then play any sound through the esound daemon, and should work fine!

With the correct at command and working sound, that would be it!

(fingers crossed)
SL6000-L, RC12

Xromer

  • Full Member
  • ***
  • Posts: 178
    • View Profile
    • http://
Gpe Pim Apps
« Reply #21 on: March 13, 2006, 08:01:17 am »
Quote
Quote
gpe-announce_0.13_armv5tel.ipk -> Works, what' s the right sound device? I thoutght it was /dev/dsp but it tells me device or resource busy....??????? Let me know it' s fast to correct.

I just tried this, and it fails for me too. It seems that pdaXrom uses esd, which would explain it. I tried 'esdctl standby' to release /dev/dsp, but it doesn't seem to work.

From what I gather, it should be possible to simply pipe the sound to the program '/usr/bin/esddsp', which gives compatibility with older dsp programs... is this possible? It would then play any sound through the esound daemon, and should work fine!

With the correct at command and working sound, that would be it!

(fingers crossed)
[div align=\"right\"][a href=\"index.php?act=findpost&pid=118260\"][{POST_SNAPBACK}][/a][/div]

OK when i said that we were near i said because it is. HHEHEHHE!  
You know now i know the code to change, so this evening i will do the fixes and release the packages to test.
THX for your investigations they are fundamental to undestand the At and Sound behaviours, as i don' t have much time to test.
Code changes for the AT commands are very easy to do.
For the sound i think that was my mistake.
HUM.... gpe-announce seems to use 2 devices to generate the sound.
One is the BUZZER device:
#define BUZZER_FILE "/dev/misc/buzzer"
#define CFG_NOSOUND    -2
#define CFG_AUTOMATIC    -1


And this is the function:
void open_buzzer (void)
{
   buzzerfd = open (BUZZER_FILE, O_WRONLY);
}

int set_buzzer (int on, int off)
{
   struct buzzer_time t;

   if (buzzerfd == -1)
      return 0;

   t.on_time = on;
   t.off_time = off;

   if (ioctl (buzzerfd, IOC_SETBUZZER, &t))
   {
      perror ("IOC_SETBUZZER");
      return -1;
   }

   return 0;
}

void buzzer_off (int sig)
{
   set_buzzer (0, 0);
   exit (128 + sig);
}




The other is the libsoundgen soundgen_init  function that already trigs the ESD daemon as you see.

int soundgen_init(void)
{
int dspfd;

        if ((dspfd = esd_play_stream_fallback(ESD_STEREO | ESD_BITS16 | ESD_STREAM | ESD_PLAY, 44100, NULL, NULL)) < 0) {
#ifdef DEBUG
      perror("error opening /dev/dsp");
#endif
      return (-1);
   }
   _tone1_buffer = NULL;
   _tone2_buffer = NULL;

return dspfd;
}


When i redirected the BUZZER signal to the /dev/dsp device in the FC4 i think that it worked because the /dev/dsp device can be opened more than 1 time.
This is not true for the Zauri i saw.
I don't really know what the BUZZER device is, that is a direct call to the LINUX ioctl.h header as you can see in the code.
But i think that eliminating the BUZZER issue can be the solution.
Do you agree?
This evening i' ll do the fixes, because here at work i don' t have the CROSS TOOLS installed.
Let me know if you think i' m right.
A consideration, Linux is so powerful that makes understand code relantionship to a Programmer Beginner like me, i will like to thanks for this to all the Linux programmers in the World and to the GPL license logically!!!!
   
THX again to the PdaXromers guys for their excellent work! That made me find the final reason having Linux in my PDAS too.  GO ON LIKE THAT!!!!

BYEZ!!
« Last Edit: March 13, 2006, 08:09:47 am by Xromer »
[span style=\'font-size:10pt;line-height:100%\']I don't know how, but i' ll do!!!
This is how i like to live! :)[/span]

Ipaq hx4700

karlto

  • Sr. Member
  • ****
  • Posts: 343
    • View Profile
    • http://
Gpe Pim Apps
« Reply #22 on: March 13, 2006, 02:12:11 pm »
Quote
HUM.... gpe-announce seems to use 2 devices to generate the sound.
One is the BUZZER device:
#define BUZZER_FILE "/dev/misc/buzzer"
#define CFG_NOSOUND  -2
#define CFG_AUTOMATIC  -1


And this is the function:
void open_buzzer (void)
{
   buzzerfd = open (BUZZER_FILE, O_WRONLY);
}

int set_buzzer (int on, int off)
{
   struct buzzer_time t;

   if (buzzerfd == -1)
  return 0;

   t.on_time = on;
   t.off_time = off;

   if (ioctl (buzzerfd, IOC_SETBUZZER, &t))
   {
  perror ("IOC_SETBUZZER");
  return -1;
   }

   return 0;
}

void buzzer_off (int sig)
{
   set_buzzer (0, 0);
   exit (128 + sig);
}




The other is the libsoundgen soundgen_init  function that already trigs the ESD daemon as you see.

int soundgen_init(void)
{
int dspfd;

        if ((dspfd = esd_play_stream_fallback(ESD_STEREO | ESD_BITS16 | ESD_STREAM | ESD_PLAY, 44100, NULL, NULL)) < 0) {
#ifdef DEBUG
  perror("error opening /dev/dsp");
#endif
  return (-1);
   }
   _tone1_buffer = NULL;
   _tone2_buffer = NULL;

return dspfd;
}


When i redirected the BUZZER signal to the /dev/dsp device in the FC4 i think that it worked because the /dev/dsp device can be opened more than 1 time.
This is not true for the Zauri i saw.
I don't really know what the BUZZER device is, that is a direct call to the LINUX ioctl.h header as you can see in the code.
But i think that eliminating the BUZZER issue can be the solution.
Do you agree?

Hmmm.... here is the exact error I get:

Code: [Select]
unable to get volume
IOC_SETBUZZER: Invalid argument
/dev/dsp: Device or resource busy
/dev/dsp: Device or resource busy
error opening /dev/dsp: Illegal seek
Couldn't init soundgen

The last four lines are repeated a couple of times, then the IOC_SETBUZZER line, then a few more iterations of the last four lines.

Here is something - I have no '/dev/misc/buzzer' on my Zaurus, but I do have a '/dev/misc/sharp_buz'. Try leaving the buzzer stuff in and
Code: [Select]
#define BUZZER_FILE /dev/misc/sharp_buz
Perhaps you also need to have a look for the esd_play_stream_fallback() function and see what it does? Where did you define /dev/dsp?

Keep up the good work - this will be a much more reliable alarm system than apmsleep and kopi!

Karl
SL6000-L, RC12

miskinis

  • Sr. Member
  • ****
  • Posts: 348
    • View Profile
    • http://
Gpe Pim Apps
« Reply #23 on: March 13, 2006, 11:41:41 pm »
Quote
gpsdrive_2.10pre2_armv5tel.ipk ->]Works but not as root user, don' t know

I would be very interested to know if gpsdrive works under a non-root user, if
you perform a "chmod a+rw" on the serial port device.  

Thanks,  John
_John Miskinis_

Xromer

  • Full Member
  • ***
  • Posts: 178
    • View Profile
    • http://
Gpe Pim Apps
« Reply #24 on: March 14, 2006, 02:34:56 am »
Quote
Quote
gpsdrive_2.10pre2_armv5tel.ipk ->]Works but not as root user, don' t know

I would be very interested to know if gpsdrive works under a non-root user, if
you perform a "chmod a+rw" on the serial port device.  

Thanks,  John
[div align=\"right\"][a href=\"index.php?act=findpost&pid=118449\"][{POST_SNAPBACK}][/a][/div]

Ok gpe-announce fixed, i was right. The buzzer device it' s not needed by the Zauri and Desktop.
This is the gpe-announce fixed. Still remains the mixer problem, it gives the same "Device busy" because there' s a function that try to control the volume for the Snooze issue.
Now is /dev/mixer the right device?

This 2 functions set the volume to something you can hear.


int get_vol(int *left, int *right, int channel)
{
   int vol;
   int err;
   char *mixer = MIXER;

   fd = open(mixer, O_RDONLY);
   if(fd == -1)
      printf("Unable to open mixer device: %s\n", mixer);
   err = ioctl(fd, channel, &vol);
   if(err != -1) {
      *left = vol & 0xff;
      *right = (vol >> 8) & 0xff;
   }
   close(fd);
   return err;
}


int set_vol(int left, int right, int channel)
{
   int vol = left | (right << 8);
   int err;
   char *mixer = MIXER;

   fd = open(mixer, O_RDONLY);
   if(fd == -1)
      printf("Unable to open mixer device: %s\n", mixer);
   err = ioctl(fd, MIXER_WRITE(channel), &vol);
   close(fd);

return err;
}


This other is for the Snooze it raise auomatically the volume:

if (sound_config == CFG_AUTOMATIC)
         switch (times) {
            case 0:
               set_vol(50,50,SOUND_MIXER_VOLUME);
               break;
            case 1:
               set_vol(55,55,SOUND_MIXER_VOLUME);
               break;
            case 2:
               set_vol(60,60,SOUND_MIXER_VOLUME);
               break;
            case 3:
               set_vol(65,65,SOUND_MIXER_VOLUME);
               break;
            case 4:
               set_vol(70,70,SOUND_MIXER_VOLUME);
               break;
            case 5:
               set_vol(75,75,SOUND_MIXER_VOLUME);
               break;
            case 6:
               set_vol(80,80,SOUND_MIXER_VOLUME);
               break;
            case 7:
               set_vol(85,85,SOUND_MIXER_VOLUME);
               break;
            case 8:
               set_vol(90,90,SOUND_MIXER_VOLUME);
               break;
            case 9:
               set_vol(95,95,SOUND_MIXER_VOLUME);
               break;
            case 10:
               set_vol(100,100,SOUND_MIXER_VOLUME);
               break;
            default:
               break;
         }
               
         times++;
         if (times>20) PlayAlarmStop = TRUE;

Dev mixer is defined as /dev/mixer

Ok now i' m becoming mad with the atd commands.
at -f /tmp/atjob.txt -q g the -q switch it' s not related to the query but to the priority so that is not the error.
I tried it, it generates the right file in the right /var/spool/at position.
Now i got the error "Atd is not running etc." from gpe-calendar removing the event.
This beacause the atrm it' s not in the atd Zauri package.
So i changed the cancel string to delete the atd file in the spool dir directly.
It worked but the problem is that the event doesn' t execute the command!!!!
So, what a big hassle this at daemon guys.
I still doesn' t know how to make it work from the command line!!!! It doesn' t trig the event nor from the Desktop than the Zauri.
BOHHHHH!! ?????
Yesterday i boguht a Pretec CF GPS, i will try Gpsdrive with it.
BYEZ!!!

P.S. For KarIto:
I found the function that fill the at_file_alarm with the environment garbage i can delete it, but it' s a secondary fix.
« Last Edit: March 14, 2006, 02:41:23 am by Xromer »
[span style=\'font-size:10pt;line-height:100%\']I don't know how, but i' ll do!!!
This is how i like to live! :)[/span]

Ipaq hx4700

trichmon

  • Full Member
  • ***
  • Posts: 148
    • View Profile
Gpe Pim Apps
« Reply #25 on: March 14, 2006, 12:29:39 pm »
I want to just say thanks to both of you guys for working on this.  This looks like it will be a great solution to the pim needs on pdazrom.

Todd
SL-6000l running pdaXrom RC12 icewm + rox
Targus keyboard
Trendnet cf 10/100 ethernet
Linksys CF wireless
Sandisk 256mb SD card
Lexar 1gig SD card
SL-5500 running zynergy rom

karlto

  • Sr. Member
  • ****
  • Posts: 343
    • View Profile
    • http://
Gpe Pim Apps
« Reply #26 on: March 14, 2006, 02:37:00 pm »
Quote
Ok gpe-announce fixed, i was right. The buzzer device it' s not needed by the Zauri and Desktop.
Yes - it works (very loud!)

Quote
This is the gpe-announce fixed. Still remains the mixer problem, it gives the same "Device busy" because there' s a function that try to control the volume for the Snooze issue.
Now is /dev/mixer the right device?
I get 'unable to get volume' or something, and it blasts out at full noise! (I don't get device busy error unless it is actually busy).

It looks like the right device (mine is a symlink to /dev/sound/mixer). I can get/set the volume using /usr/bin/mixmos or the gui mixer applet without trouble (not both at once of course).

I wonder if the mixer needs to be set at all? If I set the volume low, gpe-announce still runs at full volume. I read somewhere that esd gets volume info with the specific stream, so perhaps the mixer is a red herring and you need to look at the esd play routine? Is there another spot where you get a choice between buzzer and esd?

Quote
Ok now i' m becoming mad with the atd commands.
at -f /tmp/atjob.txt -q g the -q switch it' s not related to the query but to the priority so that is not the error.
I tried it, it generates the right file in the right /var/spool/at position.
Now i got the error "Atd is not running etc." from gpe-calendar removing the event.
This beacause the atrm it' s not in the atd Zauri package.
So i changed the cancel string to delete the atd file in the spool dir directly.
It worked but the problem is that the event doesn' t execute the command!!!!
So, what a big hassle this at daemon guys.
I still doesn' t know how to make it work from the command line!!!! It doesn' t trig the event nor from the Desktop than the Zauri.

I still think that you need to remove the -q switch. at accepts it on my Zaurus, but it doesn't return. Are you sure that it is making the spool file correctly? When it does this for me, it makes a file, but it doesn't finish correctly and doesn't schedule it. I don't see any need for a priority, as there isn't likely to be much else running!

To make atd work on pdaXrom:

1) Make a file (e.g. atd_command.txt) containing your command (no shebang):
Code: [Select]
echo "atd executed this at $(date)" >> ~/atd_test.txt2) Run at from the command line:
Code: [Select]
at -f atd_command.txt 8:15(it was 8:10 when I did this). Note that if at does not exit cleanly on the command line, it doesn't work. Between 8:10 and 8:15, I can see the file /var/spool/at/1142410500.26491, which is executable. After being executed, it is gone (the file is the command above prefixed by a shebang and postfixed by 'rm -f $0'). The output is of course in ~/atd_test.txt.

The above works perfectly fine for me, and wakes the Zaurus from suspend. However, it fails when I try to use the -q switch (file is made but never executed, just like your problem), or even pipe a command directly into at; it only seems to work with a file input.

It's very close now...

Karl
SL6000-L, RC12

Xromer

  • Full Member
  • ***
  • Posts: 178
    • View Profile
    • http://
Gpe Pim Apps
« Reply #27 on: March 14, 2006, 04:26:14 pm »
Quote
Quote
Ok gpe-announce fixed, i was right. The buzzer device it' s not needed by the Zauri and Desktop.
Yes - it works (very loud!)

Quote
This is the gpe-announce fixed. Still remains the mixer problem, it gives the same "Device busy" because there' s a function that try to control the volume for the Snooze issue.
Now is /dev/mixer the right device?
I get 'unable to get volume' or something, and it blasts out at full noise! (I don't get device busy error unless it is actually busy).

It looks like the right device (mine is a symlink to /dev/sound/mixer). I can get/set the volume using /usr/bin/mixmos or the gui mixer applet without trouble (not both at once of course).

I wonder if the mixer needs to be set at all? If I set the volume low, gpe-announce still runs at full volume. I read somewhere that esd gets volume info with the specific stream, so perhaps the mixer is a red herring and you need to look at the esd play routine? Is there another spot where you get a choice between buzzer and esd?

Quote
Ok now i' m becoming mad with the atd commands.
at -f /tmp/atjob.txt -q g the -q switch it' s not related to the query but to the priority so that is not the error.
I tried it, it generates the right file in the right /var/spool/at position.
Now i got the error "Atd is not running etc." from gpe-calendar removing the event.
This beacause the atrm it' s not in the atd Zauri package.
So i changed the cancel string to delete the atd file in the spool dir directly.
It worked but the problem is that the event doesn' t execute the command!!!!
So, what a big hassle this at daemon guys.
I still doesn' t know how to make it work from the command line!!!! It doesn' t trig the event nor from the Desktop than the Zauri.

I still think that you need to remove the -q switch. at accepts it on my Zaurus, but it doesn't return. Are you sure that it is making the spool file correctly? When it does this for me, it makes a file, but it doesn't finish correctly and doesn't schedule it. I don't see any need for a priority, as there isn't likely to be much else running!

To make atd work on pdaXrom:

1) Make a file (e.g. atd_command.txt) containing your command (no shebang):
Code: [Select]
echo "atd executed this at $(date)" >> ~/atd_test.txt2) Run at from the command line:
Code: [Select]
at -f atd_command.txt 8:15(it was 8:10 when I did this). Note that if at does not exit cleanly on the command line, it doesn't work. Between 8:10 and 8:15, I can see the file /var/spool/at/1142410500.26491, which is executable. After being executed, it is gone (the file is the command above prefixed by a shebang and postfixed by 'rm -f $0'). The output is of course in ~/atd_test.txt.

The above works perfectly fine for me, and wakes the Zaurus from suspend. However, it fails when I try to use the -q switch (file is made but never executed, just like your problem), or even pipe a command directly into at; it only seems to work with a file input.

It's very close now...

Karl
[div align=\"right\"][a href=\"index.php?act=findpost&pid=118559\"][{POST_SNAPBACK}][/a][/div]

Ok PERFECT! I got it! GPE-ANNOUNCE completely fixed, now all works and i' ll explain how.
gpe-announce has 3 modes of function.
Silent, Automatic, Level as you can see here:

int get_config (void)
{
   int result = CFG_AUTOMATIC;
   char *filename = g_strdup_printf("%s/.gpe/alarm.conf", g_get_home_dir());
   FILE *cfgfile;
   int enabled = 1;
   int automatic = 1;
   int level = 0;
   
   cfgfile = fopen(filename, "r");
   if (cfgfile)
   {
      int val = -1, ret;
      char buf[128];
      while (fgets(buf, 128, cfgfile))
      {
         ret = sscanf(buf, "enabled %d", &val);
         if (ret)
            enabled = val;
         
         ret = sscanf(buf, "automatic %d", &val);
         if (ret)
            automatic = val;
         
         ret = sscanf(buf, "level %d", &val);         
         if (ret)
         {
            if ((val >= 0) && (val <=100))
               level = val;
         }
      }
      fclose(cfgfile);
      
      if (!enabled)
         result = CFG_NOSOUND;
      else
         if (!automatic)
            result = level;
   }
   g_free(filename);


You need to put a file called alarm.conf in your .gpe directory
In this file there must be three lines:
enable 0 -> 0 means volume on, 1 means silent
automatic 0 -> if 1 raise automatically the level to the maximum and after 20 sec goes down
level 0 -> is a range from 0 to 100 of the Volume that remains fixed

For the Unable to get volume is logical because you have only the Master Volume and gpe-announce try to set the PCM too, to be sure that the PCM is active.
But the Zauri haven' t the PCM Volume so i deleted the strings related (The red ones).

if((get_vol(&curl, &curr, SOUND_MIXER_VOLUME) == -1)
      || (get_vol(&curpcml, &curpcmr, SOUND_MIXER_PCM) == -1))
   {
      VolumeReset = FALSE;
      printf("Unable to get volume\n");
   }
   set_vol(100, 100, SOUND_MIXER_PCM);
   
   signal (SIGINT, buzzer_off);

   if (sound_config != CFG_NOSOUND)
      set_buzzer (1000, 500);
   
   if (sound_config != CFG_NOSOUND)
   {
      if (sound_config == CFG_AUTOMATIC)
         set_vol(50, 50, SOUND_MIXER_VOLUME);
      else
         set_vol(sound_config, sound_config, SOUND_MIXER_VOLUME);
   }
   PlayAlarmStop = FALSE;
   if (pthread_create(&SoundThread, NULL, play_alarm, NULL) != 0) {
      g_print("pthread_create() failed\n");
      gtk_main_quit();
   }
   return(1);

Ok announce is done i' m finishing fixing the atd issues.
As i finish i' ll release the new libschedule and gpe-announce fixed.
I'll let you know byez!
 
« Last Edit: March 14, 2006, 04:30:49 pm by Xromer »
[span style=\'font-size:10pt;line-height:100%\']I don't know how, but i' ll do!!!
This is how i like to live! :)[/span]

Ipaq hx4700

karlto

  • Sr. Member
  • ****
  • Posts: 343
    • View Profile
    • http://
Gpe Pim Apps
« Reply #28 on: March 14, 2006, 05:54:34 pm »
Quote
Ok PERFECT! I got it! GPE-ANNOUNCE completely fixed, now all works and i' ll explain how.

<snip>

Ok announce is done i' m finishing fixing the atd issues.
As i finish i' ll release the new libschedule and gpe-announce fixed.
I'll let you know byez!
 
[div align=\"right\"][a href=\"index.php?act=findpost&pid=118576\"][{POST_SNAPBACK}][/a][/div]

Well done! It all makes sense in hindsight, but I know for a fact that getting there isn't so simple!

Looking forward to trying it out!
SL6000-L, RC12

Antikx

  • Hero Member
  • *****
  • Posts: 1147
    • View Profile
    • http://tyrannozaurus.com
Gpe Pim Apps
« Reply #29 on: March 14, 2006, 06:04:25 pm »
Great work! I look forward to giving it a try when you finish the last stretch of the journey.
Kanpai,
-Antikx (Twitter, Mugshot and PodNova)
C1000 - pdaXrom R198 (Celestial Environment)
tyrannozaurus.com
[img]http://www.tyrannozaurus.com/files/category_pictures/general_1.png\" border=\"0\" class=\"linked-sig-image\" /]
Zaurus news/blogs feed from Zaurus users
Free Windows, Linux, or Web RSS readers.
Featured pages at tyrannozaurus:
Sharp Petition, ScummVM, Cacko, pdaXii13, and Celestial Environment