GNU Radio: Use sound output as input source

帅比萌擦擦* 提交于 2019-12-19 03:42:24

问题


In gnuradio-companion I'm using the audio source block as my input signal for the next blocks. All works almost fine. The only little problem is that I'm getting the signal from my microphone (this is the normal behavior off course). I would rather like to get the audio signal being played directly without having to go through my speakers, the air from my room and the microphone.

All this generates signal losses and adds noise.

I know there is the file source block but this isn't a real solution for me.

I also know I could just plug a mini-jack cable from the output to the input from my sound-card. this isn't a solution either because it could damage the sound-card, and would still add distortion.

Currently I'm using Ubuntu and alsa as audio driver.

I know there are programs like jaaa and xoscope which are able to do this so I think what I'm asking for isn't that strange.


回答1:


You will need build a "monitor" ALSA device.

I found this ArchLinux wiki page which recommends the following procedure, which should apply to Ubuntu, too, as that also uses PulseAudio:

pactl list|grep monitor

pick the right monitor string, e.g. alsa_output.pci-0000_00_1b.0.analog-stereo.monitor. Then create (if it doesn't exist) and edit .asoundrc in your home directory:

gedit ~/.asoundrc

Add

pcm.pulse_monitor {
  type pulse
  device <device name from above>
}

ctl.pulse_monitor {
  type pulse
  device <device name from above>
}

to that file.

Now, use pulse_monitor as your device string in the Audio source. Works well for me (on Fedora 22):

EDIT:

Added a GNU Radio wiki page about this.



来源:https://stackoverflow.com/questions/32213443/gnu-radio-use-sound-output-as-input-source

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!