4

I'm trying to route an audio signal from an Airplay source (with Shairport-sync) to Puredata. To do so, I created a Loopback Device in Alsa. Then I set this virtual device as Shairport's output like this (hw:2 is the loopback device) :

shairplay-sync -a -Airplay -- -d hw:2

But when I try to set the loopback device as Puredata's input I get the following message :

audio I/O stuck... closing audio

I wondered if this issue could come from my .asoundrc file ? Here it is :

# playback PCM device: using loopback subdevice 0,0
pcm.amix {
  type dmix
  ipc_key 219345
  slave {
  pcm "hw:Loopback,0,0"
  period_size 1024
        buffer_size 2048
        rate 44100
  }
}

# capture PCM device: using loopback subdevice 0,1
pcm.asnoop {
  type dsnoop
  ipc_key 219346
  slave.pcm "hw:Loopback,0,1"
}

# duplex device combining our PCM devices defined above
pcm.aduplex {
  type asym
  playback.pcm "amix"
  capture.pcm "asnoop"
}

# ------------------------------------------------------
# for jack alsa_in and alsa_out: looped-back signal at other ends
pcm.ploop {
  type plug
  slave.pcm "hw:Loopback,1,1"
}

pcm.cloop {
  type dsnoop
  ipc_key 219348
  slave {
  pcm "hw:Loopback,1,0"
  period_size 1024
        buffer_size 2048
        rate 44100
  }
}

# ------------------------------------------------------
# default device

pcm.!default {
  type plug
  slave.pcm "aduplex"
}

Should I add things about format or anything else ?

FYI, the Loopback device works well when used with jack audio. Pure data too. I'd like not to use Jack because It looks like It uses too much ressources (I was not able to make Jack, Puredata and the loopback device work together, it crashes each time...)

Thank you for the help!

0

Just FYI, Shairport Sync can now give you the audio feed directly without the need of an ALSA loopback device. You can compile it to output the audio to a pipe or to stdout.

  • Thanks for this information. I'm looking at your new version of shairport-sync (2.6). (I really appreciate the metadata) Indeed I can route the signal to a pipe but I don't understand the way this works... It's kind of dusk to me ! I read the man, saying that to output to a pipe I need to specify a path for it. OK, but how can I get the audio then in another software ? Is it a special path needed or can I create one path in /home/pi or /tmp ? Thanks for your feedback ! – Corentoulf Oct 31 '15 at 12:12
  • Okay, I think I understood the pipe concept. I got it working when looking for the audio from aplay using : aplay -f cd /tmp/shairport-pipe. Not sure this is possible in pure data though. I'll look for this! Thanks – Corentoulf Oct 31 '15 at 14:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.