pkrakow
Posts: 15
Joined: Sat May 25, 2013 4:26 pm

Audio Input w/ Pure Data: Frustratingly Close

Sun Feb 23, 2014 6:24 pm

Hi. I've been trying to get Audio Input and Output working on Pure Data for almost a year now (on and off with lots of frustration between sessions). I'm very close to getting it running, but I can't seem to get all the pieces working at once. I'd like some help.


Here's a quick status on my setup:

- I have the latest distribution of Raspian Wheezy.
- I have an logilink UA0053 USB soundcard (http://elinux.org/RPi_VerifiedPeriphera ... ound_Cards)
- I can get glitch-free audio output from Pure Data: [osc~ 440] ---- [dac~]
- I can record glitch-free audio using the following commands:
amixer sset Mic Capture 100%
arecord -d 4 -f dat /tmp/test.wav
aplay /tmp/test.wav
- I can get Pure Data to pick-up input from the microphone and route it to my soundcard, but the sound is really glitchy. This is with the exact same settings as the audio output test (ALSA)
- If I use QjackCtl to enable JACK, all audio stops working (see attached image)

Any thoughts or ideas? I'm pretty flummoxed by how difficult it is to get this working on the Pi.
Attachments
pdMicrophone JACK (Silent).gif
pdMicrophone JACK (Silent).gif (46.58 KiB) Viewed 3997 times

pkrakow
Posts: 15
Joined: Sat May 25, 2013 4:26 pm

Re: Audio Input w/ Pure Data: Frustratingly Close

Tue Feb 25, 2014 5:32 am

So I played around with QJackCtl settings this evening (see attached image), and I've made some progress. I can now get glitch free audio going from the microphone to the speakers (which is a major milestone). The only problem is that I've still got ~300ms of latency from the microphone to the speakers (which is way too much for my application).

I've emulated the Jack settings from the low latency audio page: http://wiki.linuxaudio.org/wiki/raspberrypi but the audio is still laggy. I'm going to play around with some other system settings this evening to see if I can tackle this tonight.
Attachments
pdMicrophone JACK (Delayed Loopback).gif
Updated QJackCtl Settings
pdMicrophone JACK (Delayed Loopback).gif (11.48 KiB) Viewed 3948 times

evanfeenstra
Posts: 1
Joined: Fri Feb 28, 2014 5:17 am

Re: Audio Input w/ Pure Data: Frustratingly Close

Fri Feb 28, 2014 5:21 am

Have you added dwc_otg.speed=1 to the cmdline.txt file? Audio input has to use usb speed 1 for some reason...

With this line added I have been able to record quality audio into puredata using ALSA

pkrakow
Posts: 15
Joined: Sat May 25, 2013 4:26 pm

Re: Audio Input w/ Pure Data: Frustratingly Close

Sat Mar 01, 2014 10:52 pm

Yup. I've done that. I've been running PD through a VNC client. I'm going to try running it in headless mode, but for some reason jackd won't work from the command line. I get an error saying "JackServer::Open failed with -1"
"Failed to open server"

J__
Posts: 7
Joined: Thu Apr 10, 2014 2:03 pm

Re: Audio Input w/ Pure Data: Frustratingly Close

Thu Apr 10, 2014 2:08 pm

Hello

Can you give any information about how did you manage to get audio out working fine on puredata?
[osc~ 440] ---- [dac~] makes a terrible glitch for me.
Same for the input, big crackles.

I run a creative sound blaster play;
I tried with usb speed 1. Audio works fine when I'm testing playing a single file
(aplay /usr/share/scratch/Media/Sounds/Vocals/Singer1.wav )

thanks for your advices,
J.

pkrakow
Posts: 15
Joined: Sat May 25, 2013 4:26 pm

Re: Audio Input w/ Pure Data: Frustratingly Close

Thu Sep 18, 2014 4:58 am

I finally got everything working, and it was super easy. Here's what I did:

1) I bought a Wolfson Audio Card:
http://www.element14.com/community/comm ... wolfson_pi

2) I downloaded a Raspbian image that has the Wolfson drivers:
http://www.element14.com/community/mess ... oad#107186

3) I Installed Pure Data

J__
Posts: 7
Joined: Thu Apr 10, 2014 2:03 pm

Re: Audio Input w/ Pure Data: Frustratingly Close

Thu Sep 18, 2014 9:13 am

I did the following to get it working:

USB 1 and turbo mode off, plus the following cmdline:
dwc_otg.speed=1 dwc_otg.microframe_schedule=1 dwc_otg.fiq_fix_enable=1 dwc_otg.lpm_enable=0 smsc95xx.turbo_mode=N sdhci-bcm2708.sync_after_dma=0 sdhci-bcm2708.enable_llm=1 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait

and changing the input to 1 channel instead of 2 (pd -nogui -inchannels 1 -r 44100 )

User avatar
RaTTuS
Posts: 10741
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK
Contact: Twitter YouTube

Re: Audio Input w/ Pure Data: Frustratingly Close

Thu Sep 18, 2014 9:20 am

use 48khz audio data instead of 44.1Khz
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

Return to “Graphics, sound and multimedia”