Sound Input Level meter

Audio editors, music players, video players, burning software, etc.
Post Reply
Message
Author
jamesbond
Posts: 3433
Joined: Mon 26 Feb 2007, 05:02
Location: The Blue Marble

Sound Input Level meter

#1 Post by jamesbond »

A simple visualisation for the sound input level (e.g. microphone input, etc). Good to check whether your input is working or in the correct range.
Note: please close this before you start the actual application (recording, voip, or whatever) as the script uses arecord, and arecord blocks other applications from doing their work.

EDIT: two packages now provided, one for 32-bit puppies and one for 64-bit puppies (fatdog).

EDIT: updated to version 1.1, remove the stereo files - thanks for OscarTalks for reporting the bug.
Attachments
alsa-input-level-1.1-x86_64.pet
package for 64-bit puppies
(27.15 KiB) Downloaded 676 times
alsa-input-level-1.1.pet
Updated package for 32-bit puppies
(25.16 KiB) Downloaded 835 times
Last edited by jamesbond on Tue 17 Apr 2012, 00:35, edited 3 times in total.
Fatdog64 forum links: [url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Latest version[/url] | [url=https://cutt.ly/ke8sn5H]Contributed packages[/url] | [url=https://cutt.ly/se8scrb]ISO builder[/url]

jamesbond
Posts: 3433
Joined: Mon 26 Feb 2007, 05:02
Location: The Blue Marble

#2 Post by jamesbond »

If you can't be bothered with stdbuf and GUI, just open terminal and do this:

Code: Select all

arecord -vv /dev/null
There is your input level meter. Of course, as above, you need to stop this before starting your actual application.
Fatdog64 forum links: [url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Latest version[/url] | [url=https://cutt.ly/ke8sn5H]Contributed packages[/url] | [url=https://cutt.ly/se8scrb]ISO builder[/url]

jamesbond
Posts: 3433
Joined: Mon 26 Feb 2007, 05:02
Location: The Blue Marble

#3 Post by jamesbond »

Updated post for 32-bit systems too.
Fatdog64 forum links: [url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Latest version[/url] | [url=https://cutt.ly/ke8sn5H]Contributed packages[/url] | [url=https://cutt.ly/se8scrb]ISO builder[/url]

Master_wrong
Posts: 452
Joined: Thu 20 Mar 2008, 01:48

#4 Post by Master_wrong »

thanks... I do realize that during recording video using tv-tuner i have to use :
amixer set Capture 2%

v4lctl volume mute off

ffmpeg -y -f oss -i /dev/dsp -itsoffset 1 -acodec pcm_s16le -f video4linux2 -s 640x480 -r 15 -qscale 5 -vc 1 -tvstd PAL-DK -i /dev/video0 -sws_flags bicubic -ss 00:00:03 -t 00:00:15 -f avi test.avi
other wise the sound would be terrible.

even with my script, it is "just ok" quality. do you have any suggestion ?

thanks
Cluster-Pup v.2-Puppy Beowulf Cluster
[url]http://www.murga-linux.com/puppy/viewtopic.php?p=499199#499199[/url]

User avatar
OscarTalks
Posts: 2196
Joined: Mon 06 Feb 2012, 00:58
Location: London, England

#5 Post by OscarTalks »

Hello JamesBond,

Thanks for that. A useful little tool. A lot of people seem to report problems with sound input and this is a nice way of providing an indication of what (if anything) is happening.

By the way, is there any chance that you might be able to offer help and advice regarding PSIP at some stage please? Cheers!
Oscar in England
Image

jamesbond
Posts: 3433
Joined: Mon 26 Feb 2007, 05:02
Location: The Blue Marble

#6 Post by jamesbond »

@Master_Wrong, I can't help with that, I don't have tvtuner myself. But I suggest you try to capture from alsa (-f alsa) instead of from OSS (-f oss) if your tvtuner supports it.

@OscarTalks, yes, I'd like to help but I'm a bit busy right now. I will see what I can do. Haven't been in the PSIP forum for a few months :wink:
Fatdog64 forum links: [url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Latest version[/url] | [url=https://cutt.ly/ke8sn5H]Contributed packages[/url] | [url=https://cutt.ly/se8scrb]ISO builder[/url]

User avatar
OscarTalks
Posts: 2196
Joined: Mon 06 Feb 2012, 00:58
Location: London, England

#7 Post by OscarTalks »

Installed your sound input meter in Saluki 019. Is it supposed to be saving the audio as a .wav file called "stereo" in root? Mine did. Deleted it of course.
My PSIP disappeared completely from the menu as well which was strange. Had to uninstall and re-install PSIP in PPM. Just wondering if my installing this tool had anything to do with it as I hadn't done much else. EDIT, just noticed, looks like my Precord may have gone for a burton as well. Uninstalled and re-installed to get it back.
Oscar in England
Image

jamesbond
Posts: 3433
Joined: Mon 26 Feb 2007, 05:02
Location: The Blue Marble

#8 Post by jamesbond »

OscarTalks wrote:Installed your sound input meter in Saluki 019. Is it supposed to be saving the audio as a .wav file called "stereo" in root? Mine did. Deleted it of course.
No, it's not supposed to do that. My stupidity of course. Fixed :D
My PSIP disappeared completely from the menu as well which was strange. Had to uninstall and re-install PSIP in PPM. Just wondering if my installing this tool had anything to do with it as I hadn't done much else. EDIT, just noticed, looks like my Precord may have gone for a burton as well. Uninstalled and re-installed to get it back.
I haven't tried it on Saluki yet, but it isn't supposed to do that. It's just a simple one-line script file. I used Fatdog64 to package the pet, perhaps it's a bit too old and the PET format no longer works for newer puppies. Anyway, you can just get the PET, extract it manually (tar -xvf alsa-input-level.pet) and copy the files to /usr/bin/ (and the desktop files to /usr/share/applications).

cheers!
Fatdog64 forum links: [url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Latest version[/url] | [url=https://cutt.ly/ke8sn5H]Contributed packages[/url] | [url=https://cutt.ly/se8scrb]ISO builder[/url]

Pelo

rien, rien de rien. niet audio

#9 Post by Pelo »

Sound Input Level Meter, alsamixer, retrovol, precord, i give up.
NO, succes with Sound Input Level Meter.
But my voice is weak, very weak (up to 5% only...)
Last edited by Pelo on Fri 29 Aug 2014, 17:27, edited 1 time in total.

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

Re: rien, rien de rien. niet audio

#10 Post by greengeek »

Pelo wrote:Sound Input Level Meter, alsamixer, retrovol, precord, i give up.
Pelo - can you try a different machine? Surely there must be something funny with your hardware???

Can you plug in a usb soundcard ($4 on ebay) and see if you have different results?

@jamesbond - I see "Alsa input level" in my Multimedia menu but if I click it my system hangs (except the mouse which still moves). I have to use CtrlAltBkspace then xwin to get going again. Have you seen such a symptom?? (This is on Slacko 5.3)

I found the best way to run this was to create a script as follows:

Code: Select all

#!/bin/bash
urxvt -e arecord -vv /dev/null &
When I click that it works well.
Thank you!
.

mcewanw
Posts: 3169
Joined: Thu 16 Aug 2007, 10:48
Contact:

Re: rien, rien de rien. niet audio

#11 Post by mcewanw »

greengeek wrote:
I found the best way to run this was to create a script as follows:

Code: Select all

#!/bin/bash
urxvt -e arecord -vv /dev/null &
When I click that it works well.
Thank you!
.
As forum member SFR discovered, you should avoid using that command because it causes the special file /dev/null to be overwritten with a text file of the same name, which can cause serious system errors for some other apps. A workable way of using arecord VU meter is described in the following link:

http://www.murga-linux.com/puppy/viewto ... 738#784147

Note that Bacon Recorder VU meter code has the same error overwriting /dev/null, the VU meter code used in both Precord and pAVrecord, however, already contains the above fix.

William
github mcewanw

jamesbond
Posts: 3433
Joined: Mon 26 Feb 2007, 05:02
Location: The Blue Marble

#12 Post by jamesbond »

Haha, a revival of 2 year old thread - finally the original poster is still around :lol:

@mcewann - thank you, you're right. I found a simpler fix, though, at least for the version of arecord that I have:

Code: Select all

arecord -vv > /dev/null
@greengeek - make sure you have "stdbuf". Here's the fixed version of alsa-input-level GUI:

Code: Select all

#!/bin/sh
exec arecord -vvv 2>&1 > /dev/null | stdbuf -o0 sed '/%$/ !d' | Xdialog --title "Sound Input Level" --progress "Close this when done, before starting recording." 0 0
If you don't have stdbuf then this won't work.

@Pelo - make sure your remove $HOME/.asoundrc (that would be removing /root/.asoundrc, /root/spot/.asoundrc) and also /etc/asoundrc. If you can post the content of your "/proc/asound/cards" - that would help too.
Fatdog64 forum links: [url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Latest version[/url] | [url=https://cutt.ly/ke8sn5H]Contributed packages[/url] | [url=https://cutt.ly/se8scrb]ISO builder[/url]

mcewanw
Posts: 3169
Joined: Thu 16 Aug 2007, 10:48
Contact:

#13 Post by mcewanw »

jamesbond wrote: @mcewann - thank you, you're right. I found a simpler fix, though, at least for the version of arecord that I have:

Code: Select all

arecord -vv > /dev/null
Yes, we tried that too, but that only works for some versions of arecord. As far as I recall that code worked in recent Slacko but not in Precise. I'll try it again sometime to double check though. The solution adopted at present at least, whilst a bit complicated is a workaround that works everywhere so far.

William

EDIT: This is the note I took from previous conversations about this. The additional issue is that vu-meter output gets mixed with general data in alsa version < 1.0.26 so gets discarded altogether when construct >/dev/null is used:
However in Slacko it's perfectly fine.
1.0.25 (Precise/DDog) vs. 1.0.26 (Slacko) would make such a difference..?
Perhaps the relevant change (though it says only 'aplay') was:
Quote:
aplay: print vu-meter to stderr, not stdout

Src.: http://www.alsa-project.org/main/index. ... 25_v1.0.26

If that's the case, then in Alsa < 1.0.26 vu-meter gets mixed with actual data (at least if there's no output file specified) and that's how it looks like in terminal, and most likely that's why >/dev/null discards both elements.
Last edited by mcewanw on Fri 29 Aug 2014, 10:49, edited 1 time in total.
github mcewanw

mcewanw
Posts: 3169
Joined: Thu 16 Aug 2007, 10:48
Contact:

#14 Post by mcewanw »

jamesbond wrote:Haha, a revival of 2 year old thread - finally the original poster is still around :lol:
Whilst not the same thread, its actually a revival of an over six year old topic ;-)

http://murga-linux.com/puppy/viewtopic. ... 193#373193
github mcewanw

gcmartin

Shouldn't this be a simple part of WOOFCE?

#15 Post by gcmartin »

@Jamesbond made this several years ago when several of us were struggling with identifying sound in our desktop use. This has been a great tool and is practical.

Every PUP should come with this built into its Menu as many/most in the community have progressed to a point where we need this as a tool insuring the system can see audio/mic input. I think we all understand the value of this, hence it was presented to us by @Jamesbond.

Couple of things:
  • Its a Puppy exclusive script
  • It has excellent value in its presence
  • It carries so few instructions that it ISO weight is too small to measure
  • It has NO system performance impact as it is simple a test tool
  • Every PC/Laptop/Netbook/etc comes with Microphone ports
Sound recording on the motherboard is now over 20 years old. This simple tool should be a basic part of all PUPs from this point forward, one would think, to eliminate/reduce developer support for any user need.

Users/developers shouldn't have to hunt for this thread for something that is so simple and widespread.

Questions
  • How does something like this get presented and included in WOOFCE such that it results in all PUPs?
  • Does this tool need amending for ALSA or Retrovol or ... version level(s).
I know I did this before when wrestling with this in a prior FATDOG, BUT AGAIN, THANKS @Jamesbond :D

Cheers!

Pelo

eh men, i was searching solutions !

#16 Post by Pelo »

Sound input Level meter : i check it on an audio working system, in My Virtual machine,
When i had seen a working system, perhaps i will see what is wrong in the non-working one. English is not easy to explain things.
Ah OK, it's a vu-metre mesurant le volume of sound... OK.
The vocabulary is so complicated for audio, everything is code, and furthermore english . i understand pcm means computer microphone
Don't Mind, Sound Input Level Meter works. but this tool will be mine only when I get sound.

The fact : my Puppy has audio in Virtual machine, not in normal use. That means that the few drivers OF VM succeed where alsa tools failed.
Only an icon size can stop all the process.

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#17 Post by greengeek »

jamesbond wrote: make sure you have "stdbuf". Here's the fixed version of alsa-input-level GUI:

Code: Select all

#!/bin/sh
exec arecord -vvv 2>&1 > /dev/null | stdbuf -o0 sed '/%$/ !d' | Xdialog --title "Sound Input Level" --progress "Close this when done, before starting recording." 0 0
If you don't have stdbuf then this won't work.
I appear to not have stdbuf (testing at the moment on a slacko 5.6 derivative). Is this something that I really should have? If so can you recommend the best way to get it?

I'm currently testing using williams updated vu_tmp method from the other thread he referenced and it seems to be working fine using the following script:

Code: Select all

#!/bin/bash
urxvt -e arecord -vv /tmp/vu_tmp & { sleep 1; rm -f /tmp/vu_tmp; }
.

jamesbond
Posts: 3433
Joined: Mon 26 Feb 2007, 05:02
Location: The Blue Marble

#18 Post by jamesbond »

stdbuf is part of GNU coreutils package. (I think) I also package it in the pet package on first post. William method works, and may work better if you need compatibility with older version of arecord.
Fatdog64 forum links: [url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Latest version[/url] | [url=https://cutt.ly/ke8sn5H]Contributed packages[/url] | [url=https://cutt.ly/se8scrb]ISO builder[/url]

mcewanw
Posts: 3169
Joined: Thu 16 Aug 2007, 10:48
Contact:

#19 Post by mcewanw »

jamesbond wrote:stdbuf is part of GNU coreutils package. (I think) I also package it in the pet package on first post. William method works, and may work better if you need compatibility with older version of arecord.
Credit where credit is due. It is actually SFR's method, which I then implemented in Precord.

William
github mcewanw

Post Reply