[squeak-dev] Sound mixing makes nasty noises
tim at rowledge.org
Sat Dec 26 20:23:30 UTC 2020
> On 2020-12-25, at 10:28 PM, K K Subbu <kksubbu.ml at gmail.com> wrote:
> On 26/12/20 4:09 am, tim Rowledge wrote:
>> I'd add files for the alsa Pi but I can't make arecord work at all. As usual, making sense of a man page is ridiculous.
> ;-). A man(ual) page is detailed spec. Reading all options can be quite intimidating. I just skip to the examples section in the beginning. I only use options to override defaults.
Me too - except it always seems that the examples section has been deleted when things are really confusing. I claim that this is all part of a Vast Global Conspiracy To Confuse Us. It's working.
> $ arecord -d 5 -f cd Pi4-alsa-1.wav
> will sample mic at 44khz (16-bit little endian) for 5 seconds and store it in wav format file (-t wav is the default anyway).
Yeah, I saw that example somewhere but it returns the same old "arecord: main:828: audio open error: No such file or directory" error as the others.
All the other cases I posted were as recommended on assorted pages, which is terribly frustrating. I think maybe my alsa-Pi has got some wider alsa setup issue - which is strange since I haven't ever deliberately done any sound stuff on this particular unit and so it should be completely default. None of the examples to test the sound seem to work - 'sudo aplay /usr/share/sounds/alsa/Front_Center.wav' makes no sound at all. And yet Squeak does make faint and feeble (scratchy) noises ... totally nuts.
I guess I can try a totally fresh load-up on yet another Pi to compare.
> The "output" argument to -D is not a valid audio input device. What valid audio input devices does "arecord -l" show?
Well, 'arecord -l' shows no devices, which isn't surprising on a bare Pi. But this is supposed to be recording what gets sent to the headphone output, so all the examples I've seen have referred to things like 'output' and 'default' and 'hw:1,0' etc etc. The parecord on the pulse-Pi had no problem.
OK, I'll put this email aside for a moment while I fire up the 'very old alsa Pi' to see if it can do better.
Later - the old alsa-Pi system (that 2017 version OS) plays sound from Scratch perfectly well, and even when playing a looped sample guitar I can thrash up and down the pianokeyboard without glitches. I can bang on the 'normal' pianokeyboardmorph without scratchy-glitches. My code snippet plays fine even with volume set to 100% with either a plan FMSound or an organ1 sound (that adds the envelope stuff to the mix). The test samples stuff ' aplay /usr/share/sounds/alsa/Front_Center.wav' works fine and clear.
However, I can't record the headphone output with arecord which makes it difficult to share. I bet there's some magic incantation to make the headphone out channel appear as an input.
So - 4 y.o. Pi system makes nice sounds. iMac makes nice sounds. Newer alsa Pi makes nasty sounds but may be borked in other ways. New pulse-Pi makes nasty sounds. Herbert has shown convincing evidence of bad clipping occurring. Dave's chord example makes graunchy noises on all machines *except iMac*, which is interesting, and if the volume is increased even the mac makes graunch.
I guess this implies we need to check the clipping code at the very least. And I've already mentioned that the pulse sound driver needs a bunch of additional code for new stuff. Such fun!
tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
The downside of being better than everyone else is that people tend to assume you're pretentious
More information about the Squeak-dev