QutEcoacoustics / audio-analysis

The audio analysis code (AnalysisPrograms.exe) for the QUT Ecoacoustics Research Group
https://ap.qut.ecoacoustics.info/
Apache License 2.0
52 stars 12 forks source link

ReflectionTypeLoadException when running audio2csv #241

Closed tinchobulen closed 5 years ago

tinchobulen commented 5 years ago

Describe the bug

AnalysisPrograms.exe does not run. I tried using R and Power Shell but did not succed

Expected behavior

To analyze a long recording of 1.1 hours in .wav format.

Diagnostics

in Power Shell:

D:\AP\AnalysisPrograms.exe audio2csv D:\Tesis\DatosSitiosCalilegua\AP_analysis\Mixdown1.1hs.wav Towsey.Acoustic.yml D:\Tesis\DatosSitiosCalilegua\results_AP.exe

In R:

# The directory to store the results

base_output_directory <- "D:/Tesis/DatosSitios Calilegua/results_AP.exe"

# Get a list of audio files inside the directory
# (Get-ChildItem is just like ls, or dir)

files <- list.files(directory, pattern = ".wav", full.names = TRUE)

# iterate through each file
for(file in files) {
  message("Processing ", file) 

  # get just the name of the file
  file_name <- basename(file)

  # make a folder for results
  output_directory <- normalizePath(file.path(base_output_directory, file_name))
  dir.create(output_directory, recursive = TRUE)

  # prepare command
  command <- sprintf('audio2csv --log-level 7 "%s" "Towsey.Acoustic.yml" "%s"', file, output_directory)

  # finally, execute the command
  system2('D:/AP/AnalysisPrograms.exe', command)
}

Screenshots

PowerShell: image

Rstudio:

image

image

Additional Details

Add any other context about the problem here.

tinchobulen commented 5 years ago

ap_files.txt

atruskie commented 5 years ago

Thanks for the report 😄 !

There are two separate bugs here.

1

The PowerShell screenshot shows a problem probably located to your locale. What country are you located in? Do you use a comma or a period (a decimal point) to separate the integer and fractional parts of a number?

Can you please attach a verbose log for that case?

2

For the main problem, where it is failing to load the required libraries, that's a pickle. I'm almost certain it is something to do with your computer. I'm going to make a custom build of AP.exe that will output more information to help us debug this.

tinchobulen commented 5 years ago

1) I'm in Argentina. I use comma to separate the the integer from fractional parts of a number.

Please find attached the very verbose log file:

log_20190625T130137Z.txt

cheers,

Martin.

atruskie commented 5 years ago

Hi @tinchobulen,

I've created a special build of AP.exe that will provide more information about the error. Can you please download it from here https://ci.appveyor.com/api/buildjobs/91ikkc1ailtlhih3/artifacts/src%2FAnalysisPrograms%2Fbin%2FDebug.19.6.1.1.zip and make sure that version is being used in your R script.

tinchobulen commented 5 years ago

Hi @atruskie thank you very much for your help! I tried again to run AP with this species debug version. It still doesn't work. I checked for decimals and commas errors. I tried in my Power Shell and R.

please find attached the log file from R script: log_20190701T134859Z.txt

log file from Power Shell script.

log_20190701T133717Z.txt

It creates 2 folders in my output direction. One named: Mixdown.wav (inside is the log file .txt and a .yml file names Towsey.Acoustic) and another names Towsey.Acoustic (empty inside)

thank you again for your help!

cheers,

Martín

atruskie commented 5 years ago

Hi @tinchobulen,

I've fixed the comma error (problem number 1) in #242. You'll see this fix in the weekly release version soon.

The other problem, due to some missing files, we're dealing with here. Note: the fixes are in separate branches, and won't both be included in one version until they are both fixed.

Also, it seems you used an older version of AP.exe. I am not sure what is causing the missing code problem, so the special build I linked to above contains extra code that will tell me about the problem. But it isn't fixed yet. Unless you use that version they're won't be any difference in outcome. From the log files you attached:

2019-07-01T10:48:59.8644133-03:00 [1] INFO  CleanLogger - QUT Ecoacoustics Analysis Programs - version 19.5.0.1 (DEBUG build, 2019-05-05T14:00:56.6341125Z)

See how the version number is 19.5.0.1 and not 19.6.1.1?

Please try downloading the linked version again. Make sure to delete any old versions of AP.exe. Then try to run again, with verbose logging, and attach logs.

Thanks!

atruskie commented 5 years ago

From @tinchobulen:

Sure @atruskie! sorry for that.

please find attached the log file from the new version of AP.exe.

Tried with R.

log_20190701T150843Z.txt

Martín.

The important part of the log is thus part:

Could not load file or assembly 'System.Numerics.Vectors, Version=4.1.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

I totally did not expect that 😮. I'll look into a fix.

atruskie commented 5 years ago

Hi @tinchobulen,

I think I have fixed the problem. Unfortunately, I could never replicate the problem on my computers or servers. That means you'll need to test it for me again 😄

As before, please download this https://ci.appveyor.com/api/buildjobs/a9siwupb28my3bnk/artifacts/src%2FAnalysisPrograms%2Fbin%2FRelease.19.7.0.3.zip test version of AP.exe. It has the version number 19.7.0.3. Make sure you delete the old version. Run it in R again and let me know if it works. If it fails, please attach a log.

Thanks!

tinchobulen commented 5 years ago

Hello @atruskie

I tried in my computer and unfortunately it didn't work :(

Maybe its something wrong with my installation process? I re updated my .NET windows. please find attached the log file and a screenshot from my R console.

log_20190705T140148Z.txt

5-7-2019 11 7 10 1

thank you!!

tinchobulen commented 5 years ago

Or maybe its a problem with my windows 7 ultimate version?

I will try it in another computer.

cheers,

Martin.

atruskie commented 5 years ago

Hi @tinchobulen,

So yeah I'm pretty confident it is something unique about your machine. I'm just not sure what it is. It is worth fixing because it might be a condition shared by more than one computer... Or it could equally be isolated to your machine.

The core problem seems to be around a missing dependency that should be installed with the .NET Framework.

Can I get you to tell me which .Net framework you have installed? https://docs.microsoft.com/en-us/dotnet/framework/migration-guide/how-to-determine-which-versions-are-installed

Also it would be great to try it on another computer.

And after you've got the version, try installing a newer .NET Framework. Our goal was to be backwards compatible but it looks like I might have messed that up. https://www.microsoft.com/en-us/download/details.aspx?id=55170

Thanks again,

tinchobulen commented 5 years ago

Yes,

I have the 4.6.2 NET version installed in my computer.

today I'll try AP.exe in another pc.

cheers,

M.

El vie., 5 de jul. de 2019 a la(s) 18:10, Anthony Truskinger ( notifications@github.com) escribió:

Hi @tinchobulen https://github.com/tinchobulen,

So yeah I'm pretty confident it is something unique about your machine. I'm just not sure what it is. It is worth fixing because it might be a condition shared by more than one computer... Or it could equally be isolated to your machine.

The core problem seems to be around a missing dependency that should be installed with the .NET Framework.

Can I get you to tell me which .Net framework you have installed? https://docs.microsoft.com/en-us/dotnet/framework/migration-guide/how-to-determine-which-versions-are-installed

Also it would be great to try it on another computer.

And after you've got the version, try installing a newer .NET Framework. Our goal was to be backwards compatible but it looks like I might have messed that up. https://www.microsoft.com/en-us/download/details.aspx?id=55170

Thanks again,

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/QutEcoacoustics/audio-analysis/issues/241?email_source=notifications&email_token=AKLSK3Y7IY44S2RKY3QBKODP562DXA5CNFSM4H3AWWAKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZKKDGY#issuecomment-508862875, or mute the thread https://github.com/notifications/unsubscribe-auth/AKLSK35WWYFZC5JEYXH7BSLP562DXANCNFSM4H3AWWAA .

-- Lic. Martín Boullhesen Instituto de Ecorregiones Andinas (INECOA), UNJu-CONICET. Canónigo Gorriti 237 -CP 4600, San Salvador de Jujuy, Argentina.

tinchobulen commented 5 years ago

Hello @atruskie !

I want to let you know that finally I ran the audio2csv command! I'me really excited about this :) I just tried out with a simple 1 hour recording file. I think the problem was isolated in my computer. Don't know yet the origin. Perhaps its about the administrators permits on my windows notebook. Nevertheless, I made it on my girlfriend's notebook.

please find attached the log file (very_verbose enabled)

Also, at the end of the analysis a new error pups out, when trying to make an Events CSV file. Anyway I think I have a progress here!

thank you for your help.

log_20190713T160526Z.txt

now I will start to analyze longer recordings.

cheers,

Martín

atruskie commented 5 years ago

Hi @tinchobulen,

Glad it's working. If you ever track down the problem please let me know. I'll close this issue for now. I'm fairly confident this problem will disappear on a new install of your OS, or if you upgrade to Windows 10.

The event file error you are referring to is not an error. Our analyses can return acoustic events, or acoustic indices, or both. Since you ran an analysis that only generates indices, AP warned you that you won't find an Events.csv file in your output folder (just in case you were expecting it).

Thanks for working with me on this. If you have any more problems, please contact us again.

atruskie commented 5 years ago

It turns out one of our team members (@ninascarpelli) just encountered this problem!

@ninascarpelli can you please use the following link and report back on which version of .NET is installed on your computer? https://docs.microsoft.com/en-us/dotnet/framework/migration-guide/how-to-determine-which-versions-are-installed

ninascarpelli commented 5 years ago

Hi @atruskie

I've got .NET Framework 4.7.2 (QUT desktop) and 4.8 (personal laptop) and both are giving me the same error.

tinchobulen commented 5 years ago

Hi!

thanks for sharing this with me.

I'll be on alert for news about this bug.

cheers.

ninascarpelli commented 5 years ago

R is writing the command like this:

C:\AP\ANALYS~1.EXE audio2csv "C:/AP/AudioData/REC05_WA/20190815_070035.WAV" "C:/AP/ConfigFiles/Towsey.Acoustic.yml" "C:/AP/outputs//REC05_WA/20190815_070035.WAV" -p

and this is causing the failure.

atruskie commented 5 years ago

I've narrowed this down further:

Situation Works Notes
R system2 Uses sys.which to shorten exe name to C:\AP\ANALYS~1.EXE
R shell Uses cmd to shell execute
cmd (8.3 name) C:\AP\ANALYS~1.EXE
cmd (full name)
PowerShell 5 (8.3 name) C:\AP\ANALYS~1.EXE
PowerShell 5 (full name)
PowerShell 6 (8.3 name) C:\AP\ANALYS~1.EXE
PowerShell 6 (full name)

These attributes do not seem to change, the outcome: