Page 1 of 1

Sound Input Level meter

Posted: Sat 14 Apr 2012, 03:09
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.

Posted: Sat 14 Apr 2012, 03:13
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.

Posted: Sun 15 Apr 2012, 06:19
by jamesbond
Updated post for 32-bit systems too.

Posted: Sun 15 Apr 2012, 06:35
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

Posted: Mon 16 Apr 2012, 01:16
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!

Posted: Mon 16 Apr 2012, 15:05
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:

Posted: Mon 16 Apr 2012, 16:28
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.

Posted: Tue 17 Apr 2012, 00:38
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!

rien, rien de rien. niet audio

Posted: Fri 29 Aug 2014, 07:53
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...)

Re: rien, rien de rien. niet audio

Posted: Fri 29 Aug 2014, 08:15
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!
.

Re: rien, rien de rien. niet audio

Posted: Fri 29 Aug 2014, 09:38
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

Posted: Fri 29 Aug 2014, 10:10
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.

Posted: Fri 29 Aug 2014, 10:19
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.

Posted: Fri 29 Aug 2014, 10:30
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

Shouldn't this be a simple part of WOOFCE?

Posted: Fri 29 Aug 2014, 16:05
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!

eh men, i was searching solutions !

Posted: Fri 29 Aug 2014, 17:17
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.

Posted: Fri 29 Aug 2014, 18:28
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; }
.

Posted: Fri 29 Aug 2014, 19:18
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.

Posted: Fri 29 Aug 2014, 22:45
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