Opened 7 years ago

Closed 7 years ago

#4422 closed defect (fixed)

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
Blocked By: Blocking:
Deployments affected: Action Needed:
Verified: yes

Description

Joyride 81

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

Attachments (2)

org.laptop.RecordActivity-1.log (474 bytes) - added by kimquirk 7 years ago.
Record log
org.laptop.RecordActivity-1.2.log (809 bytes) - added by AlexL 7 years ago.

Download all attachments as: .zip

Change History (16)

Changed 7 years ago by kimquirk

Record log

comment:1 Changed 7 years ago by kimquirk

  • Component changed from camera-activity to distro
  • Owner changed from erikb to jg

comment:2 Changed 7 years ago by marco

  • Component changed from distro to camera-activity
  • Owner changed from jg to erikb

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.

comment:3 Changed 7 years ago by erikb

  • Cc olpc-dev@… added

Where are the new rules for /tmp posted?

comment:4 follow-up: Changed 7 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.

comment:5 in reply to: ↑ 4 ; follow-up: Changed 7 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!

comment:6 in reply to: ↑ 5 ; follow-up: Changed 7 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.

comment:7 Changed 7 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?

comment:8 Changed 7 years ago by erikb

  • Resolution set to fixed
  • Status changed from new to closed

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.

comment:9 in reply to: ↑ 6 Changed 7 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.

comment:10 Changed 7 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 7 years ago by AlexL

comment:11 Changed 7 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.

comment:12 Changed 7 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?

comment:13 Changed 7 years ago by mstone

  • Resolution fixed deleted
  • Status changed from closed to reopened

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)

comment:14 Changed 7 years ago by AlexL

  • Resolution set to fixed
  • Status changed from reopened to closed
  • Verified set

The activity loads in Joyride 243.

Note: See TracTickets for help on using tickets.