Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wav importer crash[MacOS/iOS] #6865

Closed
ryancheung opened this issue Aug 19, 2019 · 16 comments
Closed

Wav importer crash[MacOS/iOS] #6865

ryancheung opened this issue Aug 19, 2019 · 16 comments
Labels
ContentPipeline Content processing issues

Comments

@ryancheung
Copy link
Contributor

ryancheung commented Aug 19, 2019

What version of MonoGame does the bug occur on:

  • MonoGame 3.8 custom build from develop branch: 2c4bace
    And Piplilne Tool was download from MonoGame.net website, with the development build version.

What operating system are you using:

  • MacOS/iOS

What MonoGame platform are you using:

  • iOS

error log:

c924fb2b5a443088a4571f9540d903>:0 
      at Microsoft.Xna.Framework.Content.Pipeline.WavImporter.Import (System.String filename, Microsoft.Xna.Framework.Content.Pipeline.ContentImporterContext context) [0x0003f] in <9cc924fb2b5a443088a4571f9540d903>:0 
      at Microsoft.Xna.Framework.Content.Pipeline.ContentImporter`1[T].Microsoft.Xna.Framework.Content.Pipeline.IContentImporter.Import (System.String filename, Microsoft.Xna.Framework.Content.Pipeline.ContentImporterContext context) [0x0001c] in <9cc924fb2b5a443088a4571f9540d903>:0 
      at MonoGame.Framework.Content.Pipeline.Builder.PipelineManager.ProcessContent (MonoGame.Framework.Content.Pipeline.Builder.PipelineBuildEvent pipelineEvent) [0x00079] in <9cc924fb2b5a443088a4571f9540d903>:0 
    /Users/Ryan/monogame/Foo-MonoGame/ClientMobile/Content/Sound/282-2.wav
    /Users/Ryan/monogame/Foo-MonoGame/ClientMobile/Content/Sound/282-2.wav : error : Importer 'WavImporter' had unexpected failure!
    Microsoft.Xna.Framework.Content.Pipeline.InvalidContentException: Failed to open file 282-2. Ensure the file is a valid audio file and is not DRM protected. ---> System.ComponentModel.Win32Exception: ApplicationName='osx/ffprobe', CommandLine='-i "/Users/Ryan/monogame/Foo-MonoGame/ClientMobile/Content/Sound/282-2.wav" -show_format -show_entries streams -v quiet -of flat', CurrentDirectory='', Native error= Cannot find the specified file
      at System.Diagnostics.Process.StartWithCreateProcess (System.Diagnostics.ProcessStartInfo startInfo) [0x0029f] in <5dbc08ae08f74da3b452ce8aeb57e2ac>:0 
      at System.Diagnostics.Process.Start () [0x0003a] in <5dbc08ae08f74da3b452ce8aeb57e2ac>:0 
      at (wrapper remoting-invoke-with-check) System.Diagnostics.Process.Start()
      at Microsoft.Xna.Framework.Content.Pipeline.ExternalTool.Run (System.String command, System.String arguments, System.String& stdout, System.String& stderr, System.String stdin) [0x000ab] in <9cc924fb2b5a443088a4571f9540d903>:0 
      at Microsoft.Xna.Framework.Content.Pipeline.Audio.DefaultAudioProfile.ProbeFormat (System.String sourceFile, Microsoft.Xna.Framework.Content.Pipeline.Audio.AudioFileType& audioFileType, Microsoft.Xna.Framework.Content.Pipeline.Audio.AudioFormat& audioFormat, System.TimeSpan& duration, System.Int32& loopStart, System.Int32& loopLength) [0x00010] in <9cc924fb2b5a443088a4571f9540d903>:0 
      at Microsoft.Xna.Framework.Content.Pipeline.Audio.AudioContent..ctor (System.String audioFileName, Microsoft.Xna.Framework.Content.Pipeline.Audio.AudioFileType audioFileType) [0x00015] in <9cc924fb2b5a443088a4571f9540d903>:0 
       --- End of inner exception stack trace ---
      at Microsoft.Xna.Framework.Content.Pipeline.Audio.AudioContent..ctor (System.String audioFileName, Microsoft.Xna.Framework.Content.Pipeline.Audio.AudioFileType audioFileType) [0x0023b] in <9cc924fb2b5a443088a4571f9540d903>:0 
      at Microsoft.Xna.Framework.Content.Pipeline.WavImporter.Import (System.String filename, Microsoft.Xna.Framework.Content.Pipeline.ContentImporterContext context) [0x0003f] in <9cc924fb2b5a443088a4571f9540d903>:0 
      at Microsoft.Xna.Framework.Content.Pipeline.ContentImporter`1[T].Microsoft.Xna.Framework.Content.Pipeline.IContentImporter.Import (System.String filename, Microsoft.Xna.Framework.Content.Pipeline.ContentImporterContext context) [0x0001c] in <9cc924fb2b5a443088a4571f9540d903>:0 
      at MonoGame.Framework.Content.Pipeline.Builder.PipelineManager.ProcessContent (MonoGame.Framework.Content.Pipeline.Builder.PipelineBuildEvent pipelineEvent) [0x00079] in <9cc924fb2b5a443088a4571f9540d903>:0 
    /Users/Ryan/monogame/Foo-MonoGame/ClientMobile/Content/Sound/282-4.wav
    /Users/Ryan/monogame/Foo-MonoGame/ClientMobile/Content/Sound/282-4.wav : error : Importer 'WavImporter' had unexpected failure!
    Microsoft.Xna.Framework.Content.Pipeline.InvalidContentException: Failed to open file 282-4. Ensure the file is a valid audio file and is not DRM protected. ---> System.ComponentModel.Win32Exception: ApplicationName='osx/ffprobe', CommandLine='-i "/Users/Ryan/monogame/Foo-MonoGame/ClientMobile/Content/Sound/282-4.wav" -show_format -show_entries streams -v quiet -of flat', CurrentDirectory='', Native error= Cannot find the specified file
      at System.Diagnostics.Process.StartWithCreateProcess (System.Diagnostics.ProcessStartInfo startInfo) [0x0029f] in <5dbc08ae08f74da3b452ce8aeb57e2ac>:0 
      at System.Diagnostics.Process.Start () [0x0003a] in <5dbc08ae08f74da3b452ce8aeb57e2ac>:0 
      at (wrapper remoting-invoke-with-check) System.Diagnostics.Process.Start()
      at Microsoft.Xna.Framework.Content.Pipeline.ExternalTool.Run (System.String command, System.String arguments, System.String& stdout, System.String& stderr, System.String stdin) [0x000ab] in <9cc924fb2b5a443088a4571f9540d903>:0 
      at Microsoft.Xna.Framework.Content.Pipeline.Audio.DefaultAudioProfile.ProbeFormat (System.String sourceFile, Microsoft.Xna.Framework.Content.Pipeline.Audio.AudioFileType& audioFileType, Microsoft.Xna.Framework.Content.Pipeline.Audio.AudioFormat& audioFormat, System.TimeSpan& duration, System.Int32& loopStart, System.Int32& loopLength) [0x00010] in <9cc924fb2b5a443088a4571f9540d903>:0 
      at Microsoft.Xna.Framework.Content.Pipeline.Audio.AudioContent..ctor (System.String audioFileName, Microsoft.Xna.Framework.Content.Pipeline.Audio.AudioFileType audioFileType) [0x00015] in <9cc924fb2b5a443088a4571f9540d903>:0 
       --- End of inner exception stack trace ---
      at Microsoft.Xna.Framework.Content.Pipeline.Audio.AudioContent..ctor (System.String audioFileName, Microsoft.Xna.Framework.Content.Pipeline.Audio.AudioFileType audioFileType) [0x0023b] in <9cc924fb2b5a443088a4571f9540d903>:0 
      at Microsoft.Xna.Framework.Content.Pipeline.WavImporter.Import (System.String filename, Microsoft.Xna.Framework.Content.Pipeline.ContentImporterContext context) [0x0003f] in <9cc924fb2b5a443088a4571f9540d903>:0 
      at Microsoft.Xna.Framework.Content.Pipeline.ContentImporter`1[T].Microsoft.Xna.Framework.Content.Pipeline.IContentImporter.Import (System.String filename, Microsoft.Xna.Framework.Content.Pipeline.ContentImporterContext context) [0x0001c] in <9cc924fb2b5a443088a4571f9540d903>:0 
      at MonoGame.Framework.Content.Pipeline.Builder.PipelineManager.ProcessContent (MonoGame.Framework.Content.Pipeline.Builder.PipelineBuildEvent pipelineEvent) [0x00079] in <9cc924fb2b5a443088a4571f9540d903>:0 
@Jjagg Jjagg added Audio ContentPipeline Content processing issues labels Aug 19, 2019
@Jjagg Jjagg changed the title iOS sound build failured Wav importer crash Aug 19, 2019
@Jjagg Jjagg removed the Audio label Aug 19, 2019
@ryancheung ryancheung changed the title Wav importer crash Wav importer crash[MacOS] Aug 19, 2019
@ryancheung ryancheung changed the title Wav importer crash[MacOS] Wav importer crash[MacOS/iOS] Aug 19, 2019
@Jjagg
Copy link
Contributor

Jjagg commented Aug 19, 2019

System.ComponentModel.Win32Exception: ApplicationName='osx/ffprobe', CommandLine='-i "/Users/Ryan/monogame/Foo-MonoGame/ClientMobile/Content/Sound/282-2.wav" -show_format -show_entries streams -v quiet -of flat', CurrentDirectory='', Native error= Cannot find the specified file

Damn, this probably broke in #6824. Is the ffprobe executable in the location specified in the bin folder?

@ryancheung
Copy link
Contributor Author

I see ffprobe in the folder.

@ryancheung
Copy link
Contributor Author

Mayby it's related to osx/ffprobe, there should no that path? @Jjagg

@ryancheung
Copy link
Contributor Author

31404a9

This commit actually just fixed this issue.
But the latest development build for Visual Studio For Mac package was not update. Please update the build to latest commit. Please.....!

@ryancheung
Copy link
Contributor Author

http://teamcity.monogame.net/viewLog.html?buildId=89124&buildTypeId=MonoGame_DevelopMac&tab=buildChangesDiv&branch_MonoGame=%3Cdefault%3E

I was wrong. The latest Mac installer downloaded from website includes the path fix commit actually, I just checked mongame teamcity. So this is still a bug waiting to be fixed.

@ryancheung
Copy link
Contributor Author

@Jjagg Could please take a look again?

@Jjagg
Copy link
Contributor

Jjagg commented Aug 20, 2019

@ryancheung Can you check the version of MonoGame you have installed, just to make sure?
I don't have a Mac to test this on.

@ryancheung
Copy link
Contributor Author

ryancheung commented Aug 20, 2019

MonoGameVersion

@Jjagg I'm pretty sure the version I installed is the same as the latest teamcity build, which is 3.8.0.796

@ryancheung
Copy link
Contributor Author

MonoGameTeamCity

@Jjagg
Copy link
Contributor

Jjagg commented Aug 20, 2019

Yeah, that looks right :(

@ryancheung
Copy link
Contributor Author

ryancheung commented Aug 20, 2019

There's should no osx/ffprobe path in the installer tools path. But it found the path in Content Pipeline nuget package.

@ryancheung
Copy link
Contributor Author

Or you could tell me how to build the installer myself and then I can debug/fix it my self, since I have a Mac?

@ryancheung
Copy link
Contributor Author

This is a clean build error of manullly execute the build command:

$ /Library/Frameworks/Mono.framework/Versions/Current/bin/mono "/Library/Frameworks/Mono.framework/External/xbuild/MonoGame/v3.0/Tools/MGCB.exe" /platform:iOS /@:"/Users/Ryan/monogame/Foo-MonoGame/ClientMobile/Content/Content.mgcb" /outputDir:"bin/iOS/Content" /intermediateDir:"obj/iOS/Content"
Build started 8/20/2019 9:23:38 AM

/Users/Ryan/monogame/Foo-MonoGame/ClientMobile/Content/Sound/1.wav
chmod: osx/ffprobe: No such file or directory
/Users/Ryan/monogame/Foo-MonoGame/ClientMobile/Content/Sound/1.wav: error: Importer 'WavImporter' had unexpected failure!
Microsoft.Xna.Framework.Content.Pipeline.InvalidContentException: Failed to open file 1. Ensure the file is a valid audio file and is not DRM protected. ---> System.ComponentModel.Win32Exception: ApplicationName='osx/ffprobe', CommandLine='-i "/Users/Ryan/monogame/Foo-MonoGame/ClientMobile/Content/Sound/1.wav" -show_format -show_entries streams -v quiet -of flat', CurrentDirectory='', Native error= Cannot find the specified file
  at System.Diagnostics.Process.StartWithCreateProcess (System.Diagnostics.ProcessStartInfo startInfo) [0x0029f] in <5dbc08ae08f74da3b452ce8aeb57e2ac>:0
  at System.Diagnostics.Process.Start () [0x0003a] in <5dbc08ae08f74da3b452ce8aeb57e2ac>:0
  at (wrapper remoting-invoke-with-check) System.Diagnostics.Process.Start()
  at Microsoft.Xna.Framework.Content.Pipeline.ExternalTool.Run (System.String command, System.String arguments, System.String& stdout, System.String& stderr, System.String stdin) [0x000ab] in <9cc924fb2b5a443088a4571f9540d903>:0
  at Microsoft.Xna.Framework.Content.Pipeline.Audio.DefaultAudioProfile.ProbeFormat (System.String sourceFile, Microsoft.Xna.Framework.Content.Pipeline.Audio.AudioFileType& audioFileType, Microsoft.Xna.Framework.Content.Pipeline.Audio.AudioFormat& audioFormat, System.TimeSpan& duration, System.Int32& loopStart, System.Int32& loopLength) [0x00010] in <9cc924fb2b5a443088a4571f9540d903>:0
  at Microsoft.Xna.Framework.Content.Pipeline.Audio.AudioContent..ctor (System.String audioFileName, Microsoft.Xna.Framework.Content.Pipeline.Audio.AudioFileType audioFileType) [0x00015] in <9cc924fb2b5a443088a4571f9540d903>:0
   --- End of inner exception stack trace ---
  at Microsoft.Xna.Framework.Content.Pipeline.Audio.AudioContent..ctor (System.String audioFileName, Microsoft.Xna.Framework.Content.Pipeline.Audio.AudioFileType audioFileType) [0x0023b] in <9cc924fb2b5a443088a4571f9540d903>:0
  at Microsoft.Xna.Framework.Content.Pipeline.WavImporter.Import (System.String filename, Microsoft.Xna.Framework.Content.Pipeline.ContentImporterContext context) [0x0003f] in <9cc924fb2b5a443088a4571f9540d903>:0
  at Microsoft.Xna.Framework.Content.Pipeline.ContentImporter`1[T].Microsoft.Xna.Framework.Content.Pipeline.IContentImporter.Import (System.String filename, Microsoft.Xna.Framework.Content.Pipeline.ContentImporterContext context) [0x0001c] in <9cc924fb2b5a443088a4571f9540d903>:0
  at MonoGame.Framework.Content.Pipeline.Builder.PipelineManager.ProcessContent (MonoGame.Framework.Content.Pipeline.Builder.PipelineBuildEvent pipelineEvent) [0x00079] in <9cc924fb2b5a443088a4571f9540d903>:0

Build 0 succeeded, 1 failed.

Time elapsed 00:00:00.34.

@ryancheung
Copy link
Contributor Author

The tools path is /Library/Frameworks/MonoGame.framework/Current/Tools, if you chmod of any file in that path, you'll get Operation not permitted error, since you must use sudo to get the priviledge.

So If I'm not wrong and running chmod command is not a applicable execution. Unless it runs in nuget package MonoGame.Framework.Content.Pipeline.Portable, tools path is a path in user's home directory, and it has the priviledge to do chmod without sudo.

@Jjagg

@ryancheung
Copy link
Contributor Author

ryancheung commented Aug 20, 2019

I found the reason for this bug is the path osx/ffprobe does not exist in the working directory when executing the build command.

The path for the ffprobe command selected is wrong in MacOS.
@Jjagg

@ryancheung
Copy link
Contributor Author

The workaround is to make a directory named osx and copy ffprobe and ffmpeg to the directory, and then copy osx directory to the Content directory of you game project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ContentPipeline Content processing issues
Projects
None yet
Development

No branches or pull requests

2 participants