Go to advanced search

by millerpuckette
Thu Nov 29, 2012 5:29 am
Forum: Raspberry Pi OS
Topic: alsa audio-in with Pure Data and USB dongle
Replies: 12
Views: 9412

Re: alsa audio-in with Pure Data and USB dongle

Found this from sleep_lack on another thread: http://www.raspberrypi.org/phpBB3/viewtopic.php?t=10848&p=191748 Some USB 2.0 features are still not working on the Pi, and the clever workaraound is simply to restrict USB to 1.1, which forces even USB 2.0-capable devices to revert to the (correctly...
by millerpuckette
Sat Nov 24, 2012 4:36 am
Forum: Raspberry Pi OS
Topic: alsa audio-in with Pure Data and USB dongle
Replies: 12
Views: 9412

Re: alsa audio-in with Pure Data and USB dongle

Anyhow, I've got Pd running better on the Pi than it did before... there's a test version
compiled here: http://crca.ucsd.edu/~msp/software.html

cheers
Miller
by millerpuckette
Sat Nov 24, 2012 4:14 am
Forum: Raspberry Pi OS
Topic: alsa audio-in with Pure Data and USB dongle
Replies: 12
Views: 9412

Re: alsa audio-in with Pure Data and USB dongle

I've just been trying to get clean audio input and can't do it no matter what I try (Pd or audacity; Coby USB headset of Edirol USB interface) - this after bringing the Pi software and firmware up to date, and with audio output disabled, I still get wierdness on input. Working at 44100 Hx I get a sl...
by millerpuckette
Tue Nov 20, 2012 10:32 pm
Forum: Raspberry Pi OS
Topic: alsa audio-in with Pure Data and USB dongle
Replies: 12
Views: 9412

Re: alsa audio-in with Pure Data and USB dongle

Hmmm.. I'd love to fix this (trying myself without success to get audio into
PD on Pi). Any idea what specific alsa features Pd's using that SBCs don't
like?

The ALSA code in Pd is originally by Guenter Geiger (I believe) and my own
understanding of it is less than perfect :)
by millerpuckette
Thu Sep 27, 2012 4:29 am
Forum: Graphics, sound and multimedia
Topic: Crackly audio through 3.5mm jack
Replies: 95
Views: 48286

Re: Crackly audio through 3.5mm jack

2. Have you considered using any audio measurement tools to evaluate the quality as you experiment with changes to PWM/dither/etc? There are some free tools that may be helpful: - RightMark Audio Analyzer http://audio.rightmark.org/ RMAA uses test WAV files to measure frequency response, noise, THD...
by millerpuckette
Tue Sep 25, 2012 2:50 am
Forum: Graphics, sound and multimedia
Topic: Crackly audio through 3.5mm jack
Replies: 95
Views: 48286

Re: Crackly audio through 3.5mm jack

but I hesitate to suggest getting into it so deeply, particularly since I don't think I can test such an algorithm without first making (or being given) a special version of the firmware to run at 96K/10 bit instead of 48K/11 bit. The PWM clock is the same. Surely the only difference in the two cas...
by millerpuckette
Mon Sep 24, 2012 4:07 pm
Forum: Graphics, sound and multimedia
Topic: Crackly audio through 3.5mm jack
Replies: 95
Views: 48286

Re: Crackly audio through 3.5mm jack

Hi again and sorry for the slow followup... I tried the world's simplest dithering algo (just keeing some low bits from each sample that were truncated in conversion and adding them back into the next sample). You can hear the result by running the C code here: http://crca.ucsd.edu/~msp/tmp/mmap-si...
by millerpuckette
Mon Sep 24, 2012 3:04 am
Forum: Graphics, sound and multimedia
Topic: Crackly audio through 3.5mm jack
Replies: 95
Views: 48286

Re: Crackly audio through 3.5mm jack

Sure. I'd be interested to hear if you can get better quality out. Hi again and sorry for the slow followup... I tried the world's simplest dithering algo (just keeing some low bits from each sample that were truncated in conversion and adding them back into the next sample). You can hear the resul...
by millerpuckette
Tue Sep 18, 2012 7:43 pm
Forum: Graphics, sound and multimedia
Topic: Crackly audio through 3.5mm jack
Replies: 95
Views: 48286

Re: Crackly audio through 3.5mm jack

@millerpuckette Unfortunately it's all rather more complicated. Audioplus can handle multiple streams of ALSA + Openmax, all with different volumes/bit depths/sample rates. It all gets mixed on the fly, just before being DMA'd out. But, I've pushed out new firmware with the extra bit. Please test a...
by millerpuckette
Mon Sep 17, 2012 5:10 pm
Forum: Graphics, sound and multimedia
Topic: Crackly audio through 3.5mm jack
Replies: 95
Views: 48286

Re: Crackly audio through 3.5mm jack

Thanks. I can get the extra bit now. Unfortunately the "repeat last sample" bit helps with the popping, so without that, we get a louder click now. Might need to see if I can leave the audio outputting silence when not in use. Something to try that might bot be too hard (but I'm talking o...
by millerpuckette
Sun Sep 16, 2012 7:04 pm
Forum: Graphics, sound and multimedia
Topic: Crackly audio through 3.5mm jack
Replies: 95
Views: 48286

Re: Crackly audio through 3.5mm jack

Yes, I'm aware that there is a factor of two/one bit that is missing. You can run: /opt/vc/bin/vcgencmd measure_clock pwm frequency(25)=98304000 which is right. But if I set PWM_RANGE to 0x800 as I predicted I could, the audio comes out at half speed. Can you run with 0x800? Dig... http://crca.ucsd...
by millerpuckette
Sun Sep 16, 2012 6:49 pm
Forum: Graphics, sound and multimedia
Topic: Crackly audio through 3.5mm jack
Replies: 95
Views: 48286

Re: Crackly audio through 3.5mm jack

More technically: I see also that the PWM status register (which was riding at 0x634 before) now is at 0x630, i.e. there's no longer a write error bit set (although the two "GAP" bits 0x30 are constantly getting set even when I don't hear any audio errors; I don't know if this is worth wo...
by millerpuckette
Sun Sep 16, 2012 5:34 pm
Forum: Graphics, sound and multimedia
Topic: Crackly audio through 3.5mm jack
Replies: 95
Views: 48286

Re: Crackly audio through 3.5mm jack

This bug seems related: We play audio 0.4% fast, which ties up quite closely with 2 out of 512 samples being lost: http://www.raspberrypi.org/phpBB3/viewtopic.php?f=38&t=17127&p=174655#p174655 The other bug report is quite useful as it provides a test program that can identify the loss of s...
by millerpuckette
Sat Sep 15, 2012 6:56 pm
Forum: Graphics, sound and multimedia
Topic: Crackly audio through 3.5mm jack
Replies: 95
Views: 48286

Re: Crackly audio through 3.5mm jack

I'm curious why you chose 32-bit float samples instead of 16-bit signed ints. I assume this choice is influenced by your evident expertise in the realm of digital audio? [...] I can confirm that at 48kHz, 'aplay' is dropping 2 samples out of every 512; am working on uploading suitable test program ...
by millerpuckette
Sat Sep 15, 2012 6:34 pm
Forum: Graphics, sound and multimedia
Topic: Crackly audio through 3.5mm jack
Replies: 95
Views: 48286

Re: Crackly audio through 3.5mm jack

it reads raw floating-point 32-bit samples from the file I'm curious why you chose 32-bit float samples instead of 16-bit signed ints. I assume this choice is influenced by your evident expertise in the realm of digital audio? Well, my back-of-the-envelope calculation suggests that the PWM interfac...
by millerpuckette
Sat Sep 15, 2012 4:57 am
Forum: Graphics, sound and multimedia
Topic: Crackly audio through 3.5mm jack
Replies: 95
Views: 48286

Re: Crackly audio through 3.5mm jack

Just support a single raw format, e.g. 16-bit stereo. Use sox to convert wav or whatever into your raw format. OK... now http://crca.ucsd.edu/~msp/tmp/mmap-sinetest3.c -- if you give it a file name as a command line arg it reads raw floating-point 32-bit samples from the file, otherwise generates a...
by millerpuckette
Fri Sep 14, 2012 6:47 pm
Forum: Graphics, sound and multimedia
Topic: Crackly audio through 3.5mm jack
Replies: 95
Views: 48286

Re: Crackly audio through 3.5mm jack

Sure - grab http://crca.ucsd.edu/~msp/tmp/mmap-sinetest2.c - makes a 5 sec tone (I got tired of listening to all 10) and also writes it out as a floating-point WAV file named "tone5sec.wav" that can be played through ALSA via "aplay tone5sec.wav". Beware that ALSA has a volume c...
by millerpuckette
Fri Sep 14, 2012 4:12 pm
Forum: Graphics, sound and multimedia
Topic: Crackly audio through 3.5mm jack
Replies: 95
Views: 48286

Re: Crackly audio through 3.5mm jack

It works! You need to play something through ALSA first (I'm guessing to set up the PWM clock). This probably means the ALSA file you play should be the same samplerate. What would be ideal is to be able to play the same samples though ALSA and then your direct program, side by side for comparison....
by millerpuckette
Fri Sep 14, 2012 5:22 am
Forum: Graphics, sound and multimedia
Topic: Crackly audio through 3.5mm jack
Replies: 95
Views: 48286

Re: Crackly audio through 3.5mm jack

Wow - mmap() - that takes me back to '91 - I'd be happy to give this a try if only for nostalgia's sake! Is there a document (or sample code) that shows what address the registers live at and how they're interpreted by the 1-bit DAC controller? Many thanks. I think this has the info you need. http:...
by millerpuckette
Wed Sep 12, 2012 8:29 pm
Forum: Graphics, sound and multimedia
Topic: Crackly audio through 3.5mm jack
Replies: 95
Views: 48286

Re: Crackly audio through 3.5mm jack

Wow - mmap() - that takes me back to '91 - I'd be happy to give this a try if only for nostalgia's sake! Is there a document (or sample code) that shows what address the registers live at and how they're interpreted by the 1-bit DAC controller? Many thanks. I think this has the info you need. http:...
by millerpuckette
Tue Sep 11, 2012 11:26 pm
Forum: Graphics, sound and multimedia
Topic: Crackly audio through 3.5mm jack
Replies: 95
Views: 48286

Re: Crackly audio through 3.5mm jack

Wow - mmap() - that takes me back to '91 - I'd be happy to give this a try if only for nostalgia's sake! Is there a document (or sample code) that shows what address the registers live at and how they're interpreted by the 1-bit DAC controller? Many thanks. Just for a sneak preview, since you can on...
by millerpuckette
Tue Sep 11, 2012 5:22 am
Forum: Graphics, sound and multimedia
Topic: Crackly audio through 3.5mm jack
Replies: 95
Views: 48286

Re: Crackly audio through 3.5mm jack

Hi all - I did some testing on the analog output and found a couple of things: 1. somehow the audio output is getting quantized to about 10 bits (perhps the dithering algorithm is only using 10-bit numbers?) - this is causing audible harmonic distortion. 2. something is modulating the sound at a fre...

Go to advanced search