2

I want to route (clone) my audio output (all sounds that are leaving the system through hdmi) to an virtual input device so I can capture the output (virtual audio cable). As said the output is hdmi and I'm using kodi for playback.

I've searched a lot but couldn't find the perfect solution. I want a config which affects my actual system as little as possible. Also I have to say that I use passthrough in kodi.

I know it could be possible with Jack but couldn't find a solution. Also I know it could be possible with "plain" alsa and a loopback interface and finally it could be possible with pulseaudio but everything is so much confusing especially with hdmi.

Right now I'm using alsa.

1 Answers1

2

It's actually really easy to do that with Pulseaudio, so if you want a config that affects your actual system as little as possible, it's the ideal solution.

Under Pulseaudio, every sink (e.g. your HDMI output) has a corresponding monitor source (same name, but with .monitor at the end). You just have to record audio from this source, using any application you like, and you can capture the output that leaves your system through this sink. You can point applicatons to specific sources either with the pavucontrol utility, or using command line switches etc. of the application, e.g. arecord -d your-hdmi-device.monitor.

For ALSA, you have to use the snd-aloop kernel module, set up a virtual soundcard, duplicate your HDMI sound output with the dshare plugin, route it to the virtual soundcard, and then record from this soundcard. Which is a good deal more complicated than the Pulseaudio solution, and I'd have to expirement with .asoundrc myself to get that right.

dirkt
  • 17,461