gradio icon indicating copy to clipboard operation
gradio copied to clipboard

Interface crashes with MP3 file for audio

Open jjshoots opened this issue 1 year ago • 7 comments

Describe the bug

The interface crashes with a SIGILL for longer MP3 files, it works for WAV files (which, of the same length, are like 10x the filesize).

I'm using the Brave Browser v1.62.162.

The audio file in question (this link doesn't immediately download the file): http://jjshoots.ddns.net:8090/share/0ikEkQG0

Have you searched existing issues? 🔎

  • [X] I have searched and found no existing issues

Reproduction

import gradio as gr

with gr.Blocks() as app:
    audio = gr.Audio(value="AUDIO_FILE_HERE", interactive=False, autoplay=False)

app.launch()

Screenshot

image

Logs

No response

System Info

Gradio Environment Information:
------------------------------
Operating System: Linux
gradio version: 4.17.0
gradio_client version: 0.9.0

------------------------------------------------
gradio dependencies in your environment:

aiofiles: 23.2.1
altair: 5.1.2
fastapi: 0.104.1
ffmpy: 0.3.1
gradio-client==0.9.0 is not installed.
httpx: 0.25.1
huggingface-hub: 0.20.3
importlib-resources: 6.1.1
jinja2: 3.1.2
markupsafe: 2.1.3
matplotlib: 3.8.1
numpy: 1.26.2
orjson: 3.9.10
packaging: 23.2
pandas: 2.1.3
pillow: 10.1.0
pydantic: 2.5.0
pydub: 0.25.1
python-multipart: 0.0.6
pyyaml: 6.0.1
ruff: 0.2.1
semantic-version: 2.10.0
tomlkit==0.12.0 is not installed.
typer: 0.9.0
typing-extensions: 4.8.0
uvicorn: 0.24.0.post1
authlib; extra == 'oauth' is not installed.
itsdangerous; extra == 'oauth' is not installed.


gradio_client dependencies in your environment:

fsspec: 2023.10.0
httpx: 0.25.1
huggingface-hub: 0.20.3
packaging: 23.2
typing-extensions: 4.8.0
websockets: 11.0.3

Severity

I can work around it

jjshoots avatar Feb 10 '24 00:02 jjshoots

Is still an issue with the latest version of gradio?

abidlabs avatar Feb 10 '24 00:02 abidlabs

@abidlabs Just tried it, yes. Going to update the issue with the new version.

jjshoots avatar Feb 10 '24 00:02 jjshoots

I think I'm encountering the same issue. I noticed that after hitting stop recording my bandwidth meter displays incredibly high bandwidth like 4Mi up AND down. So I don't know if that's relevant or if my metering is flawed but I wouldn't be surprised if there were some sort of infinite loop that sends the file over and over or something. And 4Mi is only for something like 3s of audios.

thiswillbeyourgithub avatar Feb 23 '24 18:02 thiswillbeyourgithub

Hi @jjshoots were you able to solve this? I am getting the same issue in version 4.29.0. When I record a longer audio my gradio application hangs and returns the

Aw, snap!! error

SamridhiVaid avatar May 08 '24 21:05 SamridhiVaid

Nope, not solved. I just use m4a files instead. They're much bigger in size so it eats up bandwidth but doesn't crash.

jjshoots avatar May 09 '24 16:05 jjshoots

Nope, not solved. I just use m4a files instead. They're much bigger in size so it eats up bandwidth but doesn't crash.

I am using microphone as a source. Should I just change the format to m4a then? @jjshoots

SamridhiVaid avatar May 09 '24 18:05 SamridhiVaid

Yea either m4a or wav works.

jjshoots avatar May 10 '24 05:05 jjshoots

This issue is still present in vesion 4.41.0

According to this issue it's happening since 4.17.0 and maybe in 4.16.0

Here are the commits that cause extensive change to the gr.Audio component in those updates:

  • https://github.com/gradio-app/gradio/commit/ded5256c4a39a84155b9c3d7f4e8e7060d798186
  • https://github.com/gradio-app/gradio/commit/e3217b41862925a6a05f44070ac2bdabbeee6769
  • https://github.com/gradio-app/gradio/commit/e8b2d8b2f81b7c4b2d107765f06eaf09a030f1df
  • https://github.com/gradio-app/gradio/commit/217bfe39ca6a0de885824f16be4a707e7f032d57

According to the changelog

I just noticed that somehow firefox does not seem to crash anymore but chromium does. I was completely unable to trace the error, it seems to hang / freeze / crash but produce no python output and no output in the dev console of the browser. Chrmium crashes but brave is fine.

Could this be considered of a bit higher priority ? It's been 6 months and 25 updates since...

thiswillbeyourgithub avatar Aug 08 '24 17:08 thiswillbeyourgithub

Hi @thiswillbeyourgithub can you try setting format=".mp3" in gr.Audio to see if this helps with the issue?

abidlabs avatar Aug 09 '24 18:08 abidlabs

The link in the original issue does not work for me, so if someone has an example of a specific audio file that they are encountering an error with, please share here so that we can repro the issue.

abidlabs avatar Aug 09 '24 18:08 abidlabs

Hi folks, I just merged in a PR that I think should solve this. If you'd like to try it out, please install Gradio from this fork: https://github.com/gradio-app/gradio/pull/8843 (instructions are in the PR body). If you are still experiencing this bug, I'll reopen the issue.

abidlabs avatar Aug 13 '24 05:08 abidlabs