Opened 4 years ago

Last modified 13 months ago

#5457 review defect

Can't get Audio to process

Reported by: Espionage724 Owned by:
Priority: minor Milestone:
Component: programming Keywords: audio, processing, freesound, upstream
Cc: joar Parent Tickets:

Description

I've tried on Ubuntu 16.04, openSUSE Tumbleweed, and currently Arch Linux, and cannot get audio to process.

I've installed everything (aside from bad and ugly gstreamer plugins) mentioned on the Wiki pages for both a base MG install and audio (Arch): sudo pacman -S --needed nodejs git python2-lxml automake make npm python2-pastedeploy python2-virtualenv gst-python2 python2 python2-pillow gst-libav gst-plugins-good python2-scipy python2-numpy libsndfile alsa-lib

I have added mediagoblin.media_types.audio? (with double brackets on both sides; ticket formatted it weird) to mediagoblin_local.ini.

I have also ran gmg dbupdate and restarted both celery and paster.

All audio I've tried (various .ogas, .mp3s, and .oggs) fails to process.

Videos (even audio on the video) and pictures work fine. I'm not sure what else could be wrong, unless the documentation is missing some critical step, or audio support is broken.

I've used various MG builds from the master branch I think as far back as 0.80. At the time of writing, I'm using the latest version available from master.

Subtickets

Attachments (3)

axis-0.patch (926 bytes) - added by Espionage724 4 years ago.
git patch
sturm-pip-freeze.txt (3.5 KB) - added by Ben Sturmfels 3 years ago.
pip freeze on system that doesn't exhibit this bug
0001-Use-audio-icon-when-spectrogram-fails.-Add-note-to-d.patch (4.6 KB) - added by Jorge 3 years ago.
Use audio icon if the spectrum creation fails. Add TODOs to drop dependency from scikits.audiolab as suggested in ticket:5467#comment:4.

Download all attachments as: .zip

Change History (17)

comment:1 Changed 4 years ago by Espionage724

Error log: http://pastebin.com/raw/ZjJJMRk1

In mediagoblin/media_types/audio/audioprocessing.py, changing the only occurrence of axis=1 to axis=0 seems to fix this.

I got the idea from https://github.com/numpy/numpy/issues/6014#issuecomment-115028947

Changed 4 years ago by Espionage724

Attachment: axis-0.patch added

git patch

comment:2 Changed 4 years ago by ayleph

Status: newreview

comment:3 Changed 4 years ago by ayleph

This appears to be the same issue as #5379 which was closed without fixing. I think it's time to fix this.

comment:4 Changed 4 years ago by ayleph

Keywords: audio processing freesound upstream added

Oh, this is part of freesound in extlib. I can't just patch it. We need to see if there's an updated version of freesound available, and if not, then we need to file a bug upstream.

comment:5 Changed 4 years ago by ayleph

Status: reviewaccepted

Since the best solution to this issue is to get it fixed upstream, I'm going to remove the review status for now.

comment:6 Changed 3 years ago by Ben Sturmfels

Cc: joar added

Hi Espionage724,

Thanks very much for raising this issue. Would you mind attaching a small piece of a file that's not working, just so that we have something to test against? I upload a bit of audio myself and haven't seen this problem, so would be interested to test your file.

I note that Joar is one of the authors of freesound/audioprocessing.py (as well as being a MediaGoblin hacker). Joar, are you able to determine if Espionage724's patch above would be appropriate for upstream? My instinct is that changing axis to 0 might fix this particular case but break others.

Noting also that this component currently fails on Python 3 due to dependency on scikits.audiolab. See #5467.

Regards,
Ben

comment:7 Changed 3 years ago by ayleph

I don't think there's any need for Espionage724 to share a bit of audio for this. It's the spectograph thumbnail generation that fails, not the actual audio conversion. We've had numerous people raise this issue. I think it would be appropriate to file a bug with freesound about this and try to get it fixed upstream.

Alternatively or additionally, I think we should provide an option to disable spectrograph thumbnail generation. It doens't use the workbench properly, and it fails on sites which use Cloudfiles storage. On my site which uses Cloudfiles, I had to disable this feature entirely to get audio uploads to work.

comment:8 Changed 3 years ago by Ben Sturmfels

The reason I asked for a sample of audio is that I'm not able to reproduce this error. Are you able to reproduce this Ayleph?

While the issue may not be related to the audio itself, I'd like to be sure before we push this issue upstream.

comment:9 Changed 3 years ago by Espionage724

Here's two files I believe I tested before: https://obscuredfiles.com/?file=OgWNFsoC

comment:10 Changed 3 years ago by Ben Sturmfels

Thanks Espionage724, just confirming that both those files upload successfully for me. That's not at all to dismiss your problem; rather just to confirm that it's not caused by a property of the audio. Will attach my pip freeze output in case that helps compare versions.

I've also tested with your patch applied and upload still proceeds successfully (though I don't know enough to comment on whether the patch is the right thing to do).

Changed 3 years ago by Ben Sturmfels

Attachment: sturm-pip-freeze.txt added

pip freeze on system that doesn't exhibit this bug

comment:11 Changed 3 years ago by Espionage724

I did a MG install on Ubuntu 16.04 a little bit ago and still needed axis=0 for audio to process. Here's my notes on how I set-up MG: https://wiki.realmofespionage.xyz/servers:nginx:gnu_mediagoblin

If I recall correctly, the only distro I didn't need to do axis=0 on was Fedora Server 22 or 23.

comment:12 Changed 3 years ago by LHammonds

I had the same problem installing MediaGoblin 0.9.0 on Ubuntu Server 16.04.1 LTS.

The issue seems to be compatibility problems with AudioLab/Numpy.

You can get around this by installing the older versions of AudioLab and Numpy.

1st, remove the newer versions (Numpy 1.11.2 and AudioLab 0.11.0 at the time of this posting).

./bin/pip uninstall numpy
./bin/pip uninstall scikits.audiolab

Now install the versions that will work without the axis=0 workaround:

./bin/pip install numpy=1.9.1
./bin/pip install scikits.audiolab==0.10.2

LHammonds

Changed 3 years ago by Jorge

Use audio icon if the spectrum creation fails. Add TODOs to drop dependency from scikits.audiolab as suggested in ticket:5467#comment:4.

comment:13 Changed 3 years ago by Olivier Mehani

I had a follow-up issue after downgrading numpy and scikit.audiolab to the desired version.

File "numpy.pxd", line 30, in scikits.audiolab.pysndfile._sndfile (scikits/audiolab/pysndfile/_sndfile.c:9632)

This seems to be due to scikits.audilab in PyPi being statically linked against a different version of libsndfile. I fixed it by rebuilding scikit.audiolab from source, which linked it against my installed version.

pip install numpy==1.9.1 git+https://github.com/cournape/audiolab/@0.10.2

comment:14 Changed 13 months ago by ShawnRisk

Status: acceptedreview
Note: See TracTickets for help on using tickets.