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

audioread + Bash on Windows #51

Closed
viggyfresh opened this issue May 17, 2017 · 6 comments
Closed

audioread + Bash on Windows #51

viggyfresh opened this issue May 17, 2017 · 6 comments

Comments

@viggyfresh
Copy link

Hi there,

I was using librosa on my Windows machine via Bash on Windows and came across this error:

File "venv/local/lib/python2.7/site-packages/librosa/core/audio.py", line 144, in load
    y.append(frame)
  File "venv/local/lib/python2.7/site-packages/audioread/ffdec.py", line 279, in __exit__
    self.close()
  File "venv/local/lib/python2.7/site-packages/audioread/ffdec.py", line 263, in close
    self.proc.kill()
  File "/usr/lib/python2.7/subprocess.py", line 1572, in kill
    self.send_signal(signal.SIGKILL)
  File "/usr/lib/python2.7/subprocess.py", line 1562, in send_signal
    os.kill(self.pid, sig)
OSError: [Errno 3] No such process
Exception OSError: (3, 'No such process') in <bound method FFmpegAudioFile.__del__ of <audioread.ffdec.FFmpegAudioFile object at 0x7fcae7a492d0>>
 ignored

I think other folks with this (admittedly odd) usage pattern have seen similar issues as well (librosa/librosa#536).

Any thoughts on this? Thanks!

@sampsyo
Copy link
Member

sampsyo commented May 17, 2017

Hmm, that's odd. The call to proc.kill there is guarded by an if that checks that the process is still running… this could use some more investigation, and I don't currently have a Windows machine set up to run WSL. We could consider just handling and ignoring the exception, but I'm concerned something subtler is going on and we'll leak the subprocess that way.

Any Windows-running volunteers available to look a little closer?

@viggyfresh
Copy link
Author

I can poke around, although my knowledge of WSL and audioread are very limited. What am I looking for?

@sampsyo
Copy link
Member

sampsyo commented May 17, 2017

Good question. The main thing is that, in a line indicated in your traceback, we're calling self.proc.kill to terminate the ffmpeg process. That happens when you close the file before reading the whole thing—and after we check that the process is, in fact, still running. So the investigation to be done is to check when the process died, and why our self.proc.returncode is None check is indicating that the process is still running.

@bgiesing
Copy link

Same here on OpenSUSE Leap on Windows 10 WSL using drensin/Remixatron

Traceback (most recent call last):
  File "infinite_jukebox.py", line 222, in <module>
    progress_callback=MyCallback, async=False)
  File "/mnt/c/Users/me/Desktop/Remixatron-master/Remixatron.py", line 160, in __init__
    self.__process_audio()
  File "/mnt/c/Users/me/Desktop/Remixatron-master/Remixatron.py", line 183, in __process_audio
    y, sr = librosa.core.load(self.__filename, mono=False, sr=None)
  File "/home/bgiesing/.local/lib/python2.7/site-packages/librosa/core/audio.py", line 144, in load
    y.append(frame)
  File "/home/bgiesing/.local/lib/python2.7/site-packages/audioread/ffdec.py", line 279, in __exit__
    self.close()
  File "/home/bgiesing/.local/lib/python2.7/site-packages/audioread/ffdec.py", line 263, in close
    self.proc.kill()
  File "/usr/lib64/python2.7/subprocess.py", line 1253, in kill
    self.send_signal(signal.SIGKILL)
  File "/usr/lib64/python2.7/subprocess.py", line 1243, in send_signal
    os.kill(self.pid, sig)
OSError: [Errno 3] No such process
Exception OSError: (3, 'No such process') in <bound method FFmpegAudioFile.__del__ of <audioread.ffdec.FFmpegAudioFile object at 0x7fa01e0b99d0>> ignored

@sampsyo
Copy link
Member

sampsyo commented Jun 23, 2017

Very strange. If you can nail down what's happening, it would be very helpful!

@bgiesing
Copy link

I have 0 knowledge of python so IDK how to help

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

No branches or pull requests

3 participants