Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Emulator: Trying to erase a non-existent color buffer with handle 0
Started by tap32 Sep 06 2019 02:17 AM

3 replies to this topic
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

tap32

[GLOBAL: userInfoPane.html]
tap32
  • Contributor

  • 240 posts
  • Corona SDK

I've got an app that is running fine on iOS and the simulator, but when I try to run it on Android I get the following error:

Emulator: Trying to erase a non-existent color buffer with handle 0

The error occurs after playing a video. I was wondering if anyone else had had an issue like this before and what can be done to track the issue down as it's a bit vague.

 

One of the big differences between the Android and iOS versions are that the videos are transferred to the app using iTunes File Sharing while on Android they are downloaded from AWS.

 

In both cases the videos are run using the command:

local onComplete = function(event)
          practiceslot.markPractice()
          daycounter.markStarted()
          logging.addData("circles shown",config.cirlces)
          composer.gotoScene("scenes.multiplechoice",{params={
              ....
end
media.playVideo(config.file,system.DocumentsDirectory,false,onComplete)

The first three lines in the on complete listener are writing json files to the DocumentDirectory and the multiplechoice scene has already been shown a few times before the video plays.

 

The app runs fine until the video completes, at which point it closes on the device without warning. In the simulator I got the above error. Any thoughts?



[TOPIC: post.html]
#2

tap32

[GLOBAL: userInfoPane.html]
tap32
  • Contributor

  • 240 posts
  • Corona SDK

I have reduced the problem down to the following (which runs if a JSON videos is found and the videos are on the device)

  local prob=math.random()
  local config
  local i=1
  local files=jsonreader.load(system.pathForFile("videos.json",system.DocumentsDirectory))
  repeat
    config=files[i]
    i=i+1
    prob=prob-config.probability
  until prob<=0


  media.playVideo(config.file,system.DocumentsDirectory,false,function()
    composer.gotoScene("scenes.start")
  end)

I think it must be an issue with media.playVideo. As said the video runs fine, but the app closes instantly on the device without error.

 

Running the APK in Android Studio I see the error:

 Emulator: Trying to erase a non-existent color buffer with handle 0

The videos I am generating are created using moviepy which is calling into FFMPEG with the following parameters:

codec="libx264", audio_codec='aac', temp_audiofile='temp-audio.m4a',remove_temp=True, preset="medium",

ffmpeg_params=["-profile:v", "baseline", "-level", "3.0",
                            "-pix_fmt", "yuv420p"])

I don't know if any of those parameters jump out as being problematic. I also remove the audio from the clip when I use it (we want to force it to be mute). 



[TOPIC: post.html]
#3

tap32

[GLOBAL: userInfoPane.html]
tap32
  • Contributor

  • 240 posts
  • Corona SDK

Okay, I've reduced my code down to the following:

 

  media.playVideo("wash_1_circles.mp4",system.ResourceDirectory,false,function()
    display.newText("It did not crash", display.contentCenterX, display.contentCenterY)
  end)

It runs fine in the simulator, but closes without any error message in the Android Emulator. 



[TOPIC: post.html]
#4

tap32

[GLOBAL: userInfoPane.html]
tap32
  • Contributor

  • 240 posts
  • Corona SDK

Ah, I did a bit more digging: there's a segault happening. Have file a bug report.




[topic_controls]
[/topic_controls]