Project

General

Profile

Feature #1938

Audible sound at start and shutdown?

Added by Cyber Jock over 4 years ago. Updated 30 days ago.

Status:
Closed
Priority:
Nice to have
Assignee:
Category:
API / Middleware
Target version:
Start date:
Due date:
% Done:

0%

Hardware Configuration:
Blanket Approval:
No
Needs QA:
Yes
QA Status:
Not Tested

Description

My pfsense box plays a small 3 melody chime when the machine completes booting up and when it begins a shutdown sequence. Can this feature be added to FreeNAS?

I would imagine it would be easy to implement.

History

#1 Updated by Ryan - over 4 years ago

Probably the way to implement this would be to add a checkbox in the Advanced Settings of the GUI to enable/disble this feature. Add the speaker module to the kernel, add /usr/ports/audio/beep, add an rc script at the correct init level, and then put a sequence of beep commands like:

/usr/local/bin/beep -p 500 5
/usr/local/bin/beep -p 400 5
/usr/local/bin/beep -p 600 5
/usr/local/bin/beep -p 800 5
/usr/local/bin/beep -p 800 5

Where "5" can be a variable based on kern.hz

#2 Updated by Anonymous over 4 years ago

You can also write strings to /dev/speaker to have it play stuff instead of installing a program to do it for you, if you want to save a step. See speaker(4) for the manual and /usr/sbin/spkrtest for examples.

#3 Updated by Cyber Jock about 4 years ago

Mr. Dwhite,

If we could have the /dev/speaker added to 9.1 then anyone wanting to add their own speaker sounds could do it thanks to the new FreeNAS 9.1 init/shutdown script feature. :D

#4 Updated by Jordan Hubbard over 3 years ago

  • Status changed from Unscreened to Closed: Not Applicable

Sadly, too few of the sorts of server type machines FreeNAS runs on have the sort of audio capability that would make this worth adding. Sure, it might work on a few old desktop systems doing double-duty as FreeNASes, but even new desktop machines don't have speakers - they just have audio output jacks.

#5 Updated by Marc - over 3 years ago

The last couple of mainboards I bought came all with a pluggable piezo speaker.

Even without UI implementation this would be a beneficial feature.
Start/stop indication could then for instance easily be achieved by "Init/Shutdown Scripts".

The possibility to get an audible indication on "Alert" could be another use case for usage in SOHO environments.

#6 Updated by James Dean about 3 years ago

Jordan Hubbard wrote:

Sadly, too few of the sorts of server type machines FreeNAS runs on have the sort of audio capability that would make this worth adding. Sure, it might work on a few old desktop systems doing double-duty as FreeNASes, but even new desktop machines don't have speakers - they just have audio output jacks.

Au Contraire: My pfSense experience is that a lot of server MB, even very compact ones have a piezo speaker on the board. If the video fails, BIOS "beep codes" have been a thing for forever and those require a speaker...

The alternative for me is: Fire up a compatible browser, log in to the IPMI server(s), start the Java console, log out and reset all the Java security permissions because there was a Java update since the last time I did this, assuming the client I'm working on even HAS Java installed, start over again. A nice "I booted fine with no issues" bleep-tune a'la pfSense is greatly preferred.

tl;dr: +MANY

#7 Updated by Jordan Hubbard about 3 years ago

  • Assignee set to Sean Fagan
  • Target version set to 49
  • Status changed from Closed: Not Applicable to Unscreened

OK, I stand corrected. Cheesy piezo speakers apparently abound!

I'd be cool with a startup / shutdown sound (it could even play https://ia600209.us.archive.org/0/items/AppleMacBootUpSound/MacStartUp.mp3 on startup and maybe that "wah-wah!" sound on shutdown). Just so long as we don't use audio for alerts. Data centers full of beeping machines that nobody ever hears beep are sad places.

#8 Updated by Anonymous about 3 years ago

Just don't test it on the new Mini, it does not have a beep can, and its speaker header is unpopulated. :-)

#9 Updated by Sean Fagan about 3 years ago

  • Status changed from Unscreened to Screened

sigh. You know that audio interface counts as UI, right? :)

I'm not sure where pfsense plays the sounds, although I have heard them.

#10 Updated by Cyber Jock about 3 years ago

What do you mean you don't know where? Out the crappy speaker that beeps when your system POSTs. That's all pfsense uses and in all of the pfsense boxes I've built it was definitely loud enough to know that your router was back up when you rebooted/updated/powered-on the box.

EDIT: I also wasn't expect to have a UI feature(although that is possible). I just wanted the /dev/speaker to be made available so I could do my own post-init script.

#11 Updated by Sean Fagan about 3 years ago

  • Status changed from Screened to Investigation

I meant where the file it used was, and how it used it.

/dev/speaker is another matter entirely, one I'm more comfortable with. :)

#12 Updated by Sean Fagan about 3 years ago

Getting /dev/speaker -- or, at least, speaker.ko -- is pretty trivial, just a one line change to the build script.

But /usr/local/bin/beep is another issue.

#13 Updated by Josh Paetzel about 3 years ago

That's a matter of adding the audio/beep port.

#14 Updated by Sean Fagan about 3 years ago

Note that audio/beep is gone in the current version of ports.

#15 Updated by Sean Fagan about 3 years ago

Perhaps because the file it depends on is gone.

#16 Updated by Sean Fagan about 3 years ago

Without the beep port, I don't know how useful this is.

Adding the speaker module is trivial:

diff --git a/build/nano_env b/build/nano_env
index 2b1f950..edacc85 100644
--- a/build/nano_env
+++ b/build/nano_env
@ -170,6 +170,7 @ add_nano_modules ispfw/ispfw
add_nano_modules opensolaris
add_nano_modules pf pflog smbfs tmpfs
add_nano_modules udf usb/xhci zfs
+add_nano_modules speaker

if is_truenas ; then
add_nano_modules hwpmc ipdivert ipfw ispfw linprocfs syscons/blank

Do we have a place to stash ports distfiles?

#17 Updated by Cyber Jock about 3 years ago

Sean Fagan wrote:

Do we have a place to stash ports distfiles?

I don't know.

I did find this though... https://forums.freebsd.org/viewtopic.php?&t=12001

It appears that you make the /dev/speaker work by simply doing something like:

echo "BP" > /dev/speaker
echo "SO4L16G>L8C." > /dev/speaker

So it appears that we might not even need the beep application.

Sean,

If you can throw the speaker.ko into the 9.3 nightlies and let me know which one I'll play around a bit and see what I can come up with.

Thanks.

#18 Updated by Jordan Hubbard over 1 year ago

  • Status changed from Investigation to Closed

BRB: Timing out and closing.

#19 Updated by Kris Moore 30 days ago

  • Target version changed from 49 to N/A

Also available in: Atom PDF