Ticket #4422 (closed defect: fixed)

Opened 6 years ago

Last modified 6 years ago

Record doesn't open in joyride

Reported by: kimquirk Owned by: erikb
Priority: blocker Milestone: Update.1
Component: camera-activity Version:
Keywords: tomeu Cc: olpc-dev@…, tomeu
Action Needed: Verified: yes
Deployments affected: Blocked By:
Blocking:

Description

Joyride 81

Click on record. You get a blank white screen. It doesn't load.

Attachments

org.laptop.RecordActivity-1.log (474 bytes) - added by kimquirk 6 years ago.
Record log
org.laptop.RecordActivity-1.2.log (0.8 kB) - added by AlexL 6 years ago.

Change History

Changed 6 years ago by kimquirk

Record log

  Changed 6 years ago by kimquirk

  • owner changed from erikb to jg
  • component changed from camera-activity to distro

  Changed 6 years ago by marco

  • owner changed from jg to erikb
  • component changed from distro to camera-activity

Looks like a camera-activity bug, triggered by the fact that now sugar cwd into the bundle directory when starting an activity.

self.tempPath = os.path.join("tmp", "Record_"+str(self.instanceId))

I guess you didn't actually want to create a tmp dir inside the current directory. (just forgot the slash there?). If you actually want /tmp make sure to consider the implications of tmpfs. Also perhaps you should just use mkdtemp if that's the case.

  Changed 6 years ago by erikb

  • cc olpc-dev@… added

Where are the new rules for /tmp posted?

follow-up: ↓ 5   Changed 6 years ago by marco

There are no *new* rules for /tmp. Files in /tmp are basically stored in RAM (and have been for a while).

What files are you storing in that directory? It's very likely that you want to use Activity get_activity_root instead.

in reply to: ↑ 4 ; follow-up: ↓ 6   Changed 6 years ago by erikb

Replying to marco:

There are no *new* rules for /tmp. Files in /tmp are basically stored in RAM (and have been for a while).

Let me rephrase: what has changed in sugar so that this line of code no longer works?

Replying to marco:

What files are you storing in that directory? It's very likely that you want to use Activity get_activity_root instead.

At start of the activity, I create "self.tempPath", and it is into this location that I save copies of all media that comes into the activity (photos from camera, photos from the mesh). When write_file is called, I use these paths to save data to the datastore.

We've assumed rainbow would come into play before FRS, so we've not worried about checking if my filenames are unique. We also don't clean up after ourselves because we assumed Rainbow handle that as well.

Advise. Thanks!

in reply to: ↑ 5 ; follow-up: ↓ 9   Changed 6 years ago by marco

  • cc tomeu added
  • keywords tomeu added

Replying to erikb:

Let me rephrase: what has changed in sugar so that this line of code no longer works?

Sugar launch activities so that current directory is inside the bundle. i.e. inside /usr/share... Before I think it was /. If you try to write into "tmp" you are actually writing inside /usr/share/.../tmp. Whatever you do, you clearly don't want to use relative paths there.

At start of the activity, I create "self.tempPath", and it is into this location that I save copies of all media that comes into the activity (photos from camera, photos from the mesh). When write_file is called, I use these paths to save data to the datastore.

Are these files sticking around? Or they get written and immediately moved into the datastore?

Advise. Thanks!

Here is what sugar seem to be doing:

file_path = os.path.join(tempfile.gettempdir(), '%i' % time.time())

Tomeu, can you explain the rationale for using tmpfs there. AFAICT we are just doing a move there, which should not trash the disk nor be slow.

  Changed 6 years ago by erikb

ok, using get_activity_root as my path... and gstreamer is complaining that it can't get an open resource for writing with the path I give it. let me output that path so I can tell you where it wants to save (but cannot):

/home/olpc/.sugar/default/org.laptop.RecordActivity/output.ogg

suggestions?

  Changed 6 years ago by erikb

  • status changed from new to closed
  • resolution set to fixed

Fixed in #4441, wherein we do two things differently:

self.tmpPath = os.path.join( self.get_activity_root(), "tmp")

and, to expedite the saving of media in that directory into the datastore, we set the flag transfer_owndership=True on their datastore entries before they are written.

in reply to: ↑ 6   Changed 6 years ago by tomeu

Replying to marco:

{{{ file_path = os.path.join(tempfile.gettempdir(), '%i' % time.time()) }}} Tomeu, can you explain the rationale for using tmpfs there. AFAICT we are just doing a move there, which should not trash the disk nor be slow.

That's a mistake, have pushed a fix for saving those temp files in SUGAR_ACTIVITY_ROOT/tmp.

  Changed 6 years ago by AlexL

Still doesn't work in Joyride 184. I'll attach the log, but it would be good to know whether the fix is in there or not.

Changed 6 years ago by AlexL

  Changed 6 years ago by AlexL

From looking at the logs, it seems to be the same problem, so I'm guessing that the fix has not gone in yet, or the new relative path is still not being given permission.

  Changed 6 years ago by erikb

We are waiting on a real shell on dev.laptop.org to that our code can be part of the new builds. We've asked Ivan for one via email. Is there a more formal process?

  Changed 6 years ago by mstone

  • status changed from closed to reopened
  • resolution deleted

Still broken as of joyride-235.

erikb: to get the account set up, send email or irc message to djbclark (danny at laptop dot org)

  Changed 6 years ago by AlexL

  • status changed from reopened to closed
  • verified set
  • resolution set to fixed

The activity loads in Joyride 243.

Note: See TracTickets for help on using tickets.