Webcam - with audio?

It could be a good idea, audio recognition is a hot topic of research today, but I have to suggest a possible main issue: the noise of the surrounding ambient and so the isolation of your (I hope the 3d printer is inside it) case.
Imagine for example if your print stops if you close the door and this sounds like a bar that comes out from the holder.
Maybe a deep learning approach could help, but I don't think that a raspberry has enough RAM space to run both the print and the sound classifier.
The only solution could be: record a big dataset and.... try to implement your idea, if it works, it could be a good improvement! :wink:

1 Like

If I might be so bold, machine learning and the ability for Octoprint to detect errors just by sound would be cool, but that doesn't sound like what Mucs_Bela was asking about at all.

I've had odd issues in the past that I would have detected and corrected much sooner had I been able to hear the webcam audio when my print started. Issues like (embarrassingly) disconnecting my X endstop switch instead of my Z endstop switch to use as a filament runout sensor after installing an auto bed-leveling sensor.

Just having access to the audio would be a huge help in cases like that.

3 Likes

A friend has written a octoprint plugin for personal use which uses a kinect to detect print errors / and what is really cool the colorchange if a filament was changed during print, the printer wipes the noozle on a brass brush and resume print when the new filament color is stable. So no purge tower is needed / but he doesn't release it because he was sued for developing open source software (a Linux distribution, drivers) m). (he created a distro and didn't released the build script (which was totally fine) / all other parts are open source)

Color change detecting + nozzle wiping is something which would be really great.
Good the tool changer wipes the nozzles with a brush -> but a single hotend setup would be nice :smiley:

2 Likes

I started wondering about this too, I am building an enclosure for my Prusa and want to stick a smoke detector in there. Having a plugin that simply listens to the webcam microphone, graphs an average sound pressure and can alert when it goes above a set threshold would enable me to run actions if the smoke alarm ever starts sounding, like automatically cutting power to the printer.

It seems like these two projects could be interesting to experiment with and extend upon:


I've tested with my widecam F100 and the microphone works fine with arecord even while mjpg-streamer is using the camera.

the syntax is like this:

arecord -D plughw:1,0 -d 5 -f S16_LE -t wav test.wav
Recording WAVE 'test.wav' : Signed 16 bit Little Endian, Rate 8000 Hz, Mono
1 Like

Rather than a smoke detector, why not a Firetrace extinguisher?

(low melting-point plastic tube with internal pressure that holds an
extinguisher valve closed. If the tube melts the extinguisher goes off.)

https://www.firetrace.co.uk/applications/cnc-edm-machinery

I am not sure how much the cheapest one is, they sell them for cookers
(Fryertrace) and tumble dryers too.

Another idea, with a camera and OpenCV or similar it should be possible to
make a flame detector plug-in...

2 Likes

I found this because I want what I think the OP wanted. I don't want Octoprint to detect the malfunctions via audio (actually, that would be really cool), rather I want to be able to hear the audio through the webcam stream, so that I can detect a malfunction.

I'm only using the raspberry pi camera at the moment, so forgive me if using a real webcam already does this.

4 Likes

Audio? Sure? Some have them printers in the bedroom.... :blush:

3 Likes

Actually, I've worked on a project which involved using a Raspberry Pi 3B to record from a microphone and then to broadcast it over short-range FM. It worked great. You could listen to your printer using any standard FM radio if you wanted.

I'll have to chase the code, though. I can't find it on this laptop. <_<

1 Like

bump! and a plus one for this. it would be great to have a plugin to listen for abnormal noise from my printer. the spaghetti detective watches, now we need The Thunder Ear to hear! :smiley:

2 Likes

Same here.
I always listen for strange noises which point for example to a loosening support structure or skipping extruder steps.
For me there would be no need for an automated action. Simple streaming of audio to the webcam tab would be great and sufficient. I'm nowhere near to programming a plugin which can solve that. But I hope there will be one who can.

Keep up the very good work
I appreciate your efforts.
Stay safe and healthy.

1 Like

It's easy to add audio to HLS webcam - see Experimental HLS support .

1 Like

I know this is an older thread, but I too believe having audio capability would be beneficial. It'd be ideal of one could hear the filament "popping" or extruder struggling to be able to address it.

3 Likes

Bump... any updates on this? Would be nice to hear (as well as see) the current progress of your print. Additionally, you could post the video with audio to help diagnose any problems.

The machine learning thing.. Sure, great idea. But let's just get the audio working first :slight_smile:

2 Likes

I just found this thread through google and I'm looking for the same thing.

I've got a Raspberry Pi 4B with an LED light and a cheap Microsoft webcam hooked up to it through USB.
Yesterday my Ender 5 Plus did a 4 hour print. About 15 minutes before it was done I got a weird feeling in my gut and checked the webcam (I always have the window open on my second screen). Everything looked fine but I still went into the other room to check on it myself and lo and behold, the filament was tangled and the printer was making weird sounds. Luckily I was able to untangle it far enough so it could finish printing.

Being able to listen to the printer (you can just mute through Firefox directly) when there's already a webcam set up would be really nice to detect problems like that, stuff that you simply can't notice by just watching a stream without sound.

1 Like

with the official stable release of octopi 0.18 you may be able to do this with the HLS support based on what @Chudsaviet implemented. There may be some tweaks to the hls stream settings but he'd be the best to tell you exactly what. It will never work the mjpgstream as that is video only since it uses an img tag in the html code.

Yes, it is possible with HLS and I was testing it.
However, ALSA sound input have been extremely unstable and created lots of problems in the whole stream stability.
I decided not to push it to production for now.

But if someone wish to debug it - I can post a Systemd config to run the stream with audio.

1 Like

Since another year has passed, i would like to pickup this thread and i'm happy to help to debug.

any update? i'm intrested to listen audio from webcan on octoprint. it would be great even without ai, just listen audio.

1 Like