[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Adding ALSA support to qrq



On Sun, Dec 16, 2007 at 10:21:53AM +0000, Corny, Df6fR wrote:
> Adding some ALSA API code was quite easy and the output to the device
> works. The code compiles nicely without any warning or error. But now
> I've struggled for quite some time to get rid of annoying clicks and
> missing dits and dahs.
> 
> The code snippets with the modification can be found here:
> http://nopaste.debianforum.de/7136
> the complete C file here:
> http://www.qsl.net/df6fr/var/qrq.c
> The morse function is called in its own thread. The output written to
> the PCM device in function tonegen is interleaved frames if integer size
> (2 byte per sample and 2 channels). I even get clicks for single dits
> and dahs.
> 
> I'm really at a loss here and hope somebody on the list can point me to
> a HowTo (couldn't find anything usefull until now) or knows a recipe!

I've had clicking due to sample rate mismatches, particularly when using
OSS emulation. eg with gMFSK set to an 8kHz or 11.025kHz sampling rate,
using a sound card which only supports 48kHz.

There is a rate converter somewhere in the ALSA system (else it wouldn't 
work at all) but it seems to have problems. Setting the application's
sample rate to match the hardware resolved the issue for me.

The default ALSA output device does go via the sample rate converter I
think. If you open a lower-level hardware device, the open will only
succeed with a sample rate supported by the hardware.


Hamish
-- 
Hamish Moffatt VK3SB <hamish@debian.org> <hamish@cloud.net.au>


Reply to: