dfaust / soundkonverter

soundKonverter is in maintenance mode, PRs are welcome.
https://github.com/dfaust/soundkonverter/wiki
98 stars 27 forks source link

soundkonverter fails to make output directory #12

Closed illumilore closed 10 years ago

illumilore commented 10 years ago

SK seems to regularly fail to make output directories when converting small files. An error occurs about every 1 in 50 conversions with small files

Identifier: /home/ill/Music/civ/leader/1/Bismark/BismarkHateHearIt-02.mp3 Log ID: 675608522 Possible conversion strategies: mp3 ➝ wav (lame), wav ➝ ogg vorbis (Vorbis Tools) mp3 ➝ wav (FFmpeg), wav ➝ ogg vorbis (Vorbis Tools) mp3 ➝ wav (SoX), wav ➝ ogg vorbis (Vorbis Tools) mp3 ➝ wav (MPlayer), wav ➝ ogg vorbis (Vorbis Tools) mp3 ➝ wav (lame), wav ➝ ogg vorbis (SoX) mp3 ➝ wav (FFmpeg), wav ➝ ogg vorbis (SoX) mp3 ➝ ogg vorbis (SoX) mp3 ➝ wav (SoX), wav ➝ ogg vorbis (SoX) mp3 ➝ wav (MPlayer), wav ➝ ogg vorbis (SoX) File system type: ext4

Executing next step Decoding /usr/bin/lame --decode "/home/ill/Music/civ/leader/1/Bismark/BismarkHateHearIt-02.mp3" "/tmp/kde-ill/soundkonverter_temp_convert_675608522_0.wav"

Executing next step Encoding /usr/bin/oggenc -q 5 "/tmp/kde-ill/soundkonverter_temp_convert_675608522_0.wav" -o "/home/ill/Music/NEW/civ/leader/1/Bismark/BismarkHateHearIt-02.ogg" Progress: 0 Opening with wav module: WAV file reader Encoding "/tmp/kde-ill/soundkonverter_temp_convert_675608522_0.wav" to "/home/ill/Music/NEW/civ/leader/1/Bismark/BismarkHateHearIt-02.ogg" at quality 5.00 Progress: 76.6 Done encoding file "/home/ill/Music/NEW/civ/leader/1/Bismark/BismarkHateHearIt-02.ogg"

    File length:  0m 02.0s
    Elapsed time: 0m 00.1s
    Rate:         25.7405
    Average bitrate: 117.5 kb/s

Executing next step Applying Replay Gain /usr/bin/vorbisgain --album --fast "/home/ill/Music/NEW/civ/leader/1/Bismark/BismarkHateHearIt-02.ogg" +3.48 dB | 12619 | 1.49 | 18837 | /home/ill/Music/NEW/civ/leader/1/Bismark/BismarkHateHearIt-02.ogg

Recommended Album Gain: +3.48 dB

Writing tags to '/home/ill/Music/NEW/civ/leader/1/Bismark/BismarkHateHearIt-02.ogg' Couldn't rename '/home/ill/Music/NEW/civ/leader/1/Bismark/vorbisgain.tmp' to '/home/ill/Music/NEW/civ/leader/1/Bismark/BismarkHateHearIt-02.ogg': No such file or directory

Conversion failed. Exit code: 1

Applying Replay Gain No more backends left to try :(

Removing file from conversion list. Exit code 6 (An error occurred) Conversion time: 413ms Output file size: 0 B File size ratio: 0.00 % Finished logging

dfaust commented 10 years ago

Thanks for your report. But could you be a little bit more specific on which directories existed before the conversion and witch existed afterwords? Also can you check what permissions the directories have?

illumilore commented 10 years ago

It is set to copy directory structure, so it was creating all the directories that it was putting the converted files in. The folders created by SK are drwxr-x--- the directories needed are all made, but some of the files to be placed in the directory seem to be finished converting before the file is made. When converting around 2000 of these smallish files, around 30 or so will randomly fail.

dfaust commented 10 years ago

I found the problem. vorbisgain unfortunately uses a fixed name for it's temporary files. So if it is run more than once in one directory, those temporary files collide and cause problems, sometimes even data loss. The solution is to keep track of the directories vorbisgain instances are currently using and wait for vorbisgain to exit in case of a conflict before starting a new instance. I pushed the fix to master so if you want to, give it a run. And I would appreciate it if you could let me know whether it works.

illumilore commented 10 years ago

It seems to work perfectly now. Thanks for the fix.