Skip to contentSkip to conversation

Sound with metal effect

DISCUSSION Laurielle LEA 2 participants 2 messages Apr 1, 2005 – Apr 2, 2005

lore
Share & tools
lore
#0 lore raw

In fact, in my read function,

count = 320;
rc = snd_pcm_readi(audio_hdl, (short*)ptr, count); I have to have rc = 320 but I receive just 160.

You tell me about other algorithms but I don't understand everything. Maybe I have to add other init hardware parameters ?

Quoted 37 lines · --- Manuel Jander

Hi,

Quoted 3 lines · Giuliano Pochini
Quoted 1 line · On 31-Mar-2005 Laurielle LEA wrote:

I'm integrating ALSA to my voipclient

(softphone) and

Quoted 1 line
Quoted 1 line

my problem is the sound received by the remote

user is

Quoted 3 lines
Quoted 1 line

with metal effect.

VoIP uses 8KHz sampling rate IIRC. What did you

expect ?

Metal effect indicates bad antialiasing filters. That may be caused by
bad hardware, bad hardware setup or a very bad software emulation. 8KHz
sound obviously does not sound CD-quality, but it should not have
aliasing noise. It should just sound with lower bandwidth, specially
higher frequencies being cutoff. Standard phone bandwidth is between
300-3400 Hz.
Software resampling through removing or adding samples, and doing some
mean value cooking is far from optimal. It would be better to use a
recursive Z-tranform (or whatever math tool you prefer) synthesised
algorithm. Even a small IIR filter for postprocessing would barely
consume any CPU power. Such algorithms are well known and available.

Quoted 8 lines

Best Regards

Signature · 2 lines
Manuel Jander
Dipl.-Ing. Fachrichtung Elektronik

-------------------------------------------------------

Quoted 9 lines

This SF.net email is sponsored by Demarc:
A global provider of Threat Management Solutions.
Download our HomeAdmin security software for free
today!
http://www.demarc.com/Info/Sentarus/hamr30
_______________________________________________
Alsa-devel mailing list
[email protected]

https://lists.sourceforge.net/lists/listinfo/alsa-devel

Quoted 1 line

__________________________________________________________________
Découvrez le nouveau Yahoo! Mail : 250 Mo d'espace de stockage pour vos mails ! Créez votre Yahoo! Mail sur http://fr.mail.yahoo.com/

-------------------------------------------------------
This SF.net email is sponsored by Demarc:
A global provider of Threat Management Solutions. Download our HomeAdmin security software for free today!
http://www.demarc.com/Info/Sentarus/hamr30

#1 lore raw
Quoted 10 lines · Laurielle LEA

In fact, in my read function,

count = 320;
rc = snd_pcm_readi(audio_hdl, (short*)ptr, count); I have to have rc = 320 but I receive just 160.

You tell me about other algorithms but I don't understand everything. Maybe I have to add other init hardware parameters ?

Your read function takes the third argument in bytes. But snd_pcm_readi expects "count" to be in frames. It looks like you have an 8 bit stereo stream, or 2 bytes per frame. So you did get 160 frames (320 bytes). It looks like you need to set the device to 8 bit mono.

Please see alsa-lib/test/latency.c for an example of the correct usage.

Lee

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click