You are not logged in.

#1 2020-09-10 04:31:43

Coalms
Member
Registered: 2020-04-22
Posts: 59

ALSA or pulseaudio set max dB

TL;DR:How to set max dB on mic and mute after that max is passed

I... have a thing,I have to use a usb C to jack to headphones adapters to communicate with friends due to problems with the jack,the problem is tho that my jack and all the left hand side ports are phisicaly damaged,that being said just a small wrong move and the usb C gets disconected and my friends get ear-raped through short shirctuit ,what I am trying to do is to set a max dB to my mic and mute myself after that max is passed,any guidance with that?

Offline

#2 2020-09-10 06:58:23

digitalone
Member
Registered: 2011-08-19
Posts: 355

Re: ALSA or pulseaudio set max dB

I don't understand. You need something like a limiter which lowers levels > 0 dB to 0 dB?

If yes, try the limiter in PulseEffects.

Offline

#3 2020-09-10 14:33:45

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,372

Re: ALSA or pulseaudio set max dB

I highly doubt that this kind of hardware failure will register on the OS in a way that these software measures can react to.

Don't try to fix broken hardware with weird software workarounds, replace the adapter/headphones.

Offline

#4 2020-09-11 03:51:41

Coalms
Member
Registered: 2020-04-22
Posts: 59

Re: ALSA or pulseaudio set max dB

V1del wrote:

I highly doubt that this kind of hardware failure will register on the OS in a way that these software measures can react to.

Don't try to fix broken hardware with weird software workarounds, replace the adapter/headphones.

The problem is not the headphones themselves,but the whole left side of my device is wanky,as a resault any usb,usb c,hdmi and VGA port connected,just a slight lift upwards disconects them and reconnects them continiously untill it stabilizes ,

in the end I am just trying to mute my mic completly after it passes a specific sound-range and unmute when it goes back down that "limit" ,i tried to make a script for that but I couldnt find any way to read the currently "applied" dB

Offline

#5 2020-09-11 03:55:13

Coalms
Member
Registered: 2020-04-22
Posts: 59

Re: ALSA or pulseaudio set max dB

digitalone wrote:

I don't understand. You need something like a limiter which lowers levels > 0 dB to 0 dB?

If yes, try the limiter in PulseEffects.

yes but limiter is only an output filter not an input one

as i replied to V1del:

Coalms wrote:

in the end I am just trying to mute my mic completly after it passes a specific sound-range and unmute when it goes back down that "limit" ,i tried to make a script for that but I couldnt find any way to read the currently "applied" dB

Offline

#6 2020-09-11 04:05:01

Coalms
Member
Registered: 2020-04-22
Posts: 59

Re: ALSA or pulseaudio set max dB

digitalone wrote:

I don't understand. You need something like a limiter which lowers levels > 0 dB to 0 dB?

If yes, try the limiter in PulseEffects.

V1del wrote:

I highly doubt that this kind of hardware failure will register on the OS in a way that these software measures can react to.

Don't try to fix broken hardware with weird software workarounds, replace the adapter/headphones.

[Continue my last post]
Or if not mute im looking to lower my mic volume to a preset level when a threshold of loudness passes

Offline

#7 2020-09-11 07:30:11

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,372

Re: ALSA or pulseaudio set max dB

I'd say for a start record yourself with something like parec, trigger  the failure condition with different levels of loudness, if the resulting file contains a noticeably lower loudness spike you may have something to go on, if it doesn't I highly doubt you can do this via software

Also if you want to amend a reply, please edit it instead of adding multiple posts.

Last edited by V1del (2020-09-11 07:30:48)

Offline

#8 2020-09-11 12:56:28

Wild Penguin
Member
Registered: 2015-03-19
Posts: 406

Re: ALSA or pulseaudio set max dB

Coalms wrote:

The problem is not the headphones themselves,but the whole left side of my device is wanky,as a resault any usb,usb c,hdmi and VGA port connected,just a slight lift upwards disconects them and reconnects them continiously untill it stabilizes ,

That does sound indeed like a hardware problem. The real solution would be to fix your device (which has a wonky left side), or get a new one if it can not be fixed. So I agree with V1del.

If that is not possible, I don't think there exists some automatic facility to do this; it seems a very niché need to me. From software point of view, you would need some kind of buffer to analyze the sound level from -> if some condition is detected in the audio, e.g. the volume is above some threshold -> mute the stream before the buffer is actually processed (i.e. sent to your friends).

There are plugins for pulseaudio to do normalization, but that is a different thing. It might still be able to set a roof for the sound level, but will not mute.

Perhaps there is some other software which can do this for example with the help of jack. That will make the setup quite complex and inevitably add some latency to your voice.

Offline

#9 2020-09-11 16:49:15

Coalms
Member
Registered: 2020-04-22
Posts: 59

Re: ALSA or pulseaudio set max dB

Wild Penguin wrote:
Coalms wrote:

The problem is not the headphones themselves,but the whole left side of my device is wanky,as a resault any usb,usb c,hdmi and VGA port connected,just a slight lift upwards disconects them and reconnects them continiously untill it stabilizes ,

That does sound indeed like a hardware problem. The real solution would be to fix your device (which has a wonky left side), or get a new one if it can not be fixed. So I agree with V1del.

If that is not possible, I don't think there exists some automatic facility to do this; it seems a very niché need to me. From software point of view, you would need some kind of buffer to analyze the sound level from -> if some condition is detected in the audio, e.g. the volume is above some threshold -> mute the stream before the buffer is actually processed (i.e. sent to your friends).

There are plugins for pulseaudio to do normalization, but that is a different thing. It might still be able to set a roof for the sound level, but will not mute.

Perhaps there is some other software which can do this for example with the help of jack. That will make the setup quite complex and inevitably add some latency to your voice.



Sadly jack cant be used,and since software probably dosent exist or cannot be created(appreantly)with a few loose scripts i guess il just drop the post...that being said how do I do that just adding [DROPED] in front of the tittle or something,there should be no reason for this post to hog the forum if its an unsolvable issue due to hardware only(well one that cannot be fixed)

Offline

#10 2020-09-11 19:40:31

digitalone
Member
Registered: 2011-08-19
Posts: 355

Re: ALSA or pulseaudio set max dB

Coalms wrote:

yes but limiter is only an output filter not an input one

With PulseEffects you can apply the limiter at input sources.

Offline

Board footer

Powered by FluxBB