Unsolved Ubuntu Server - Virtual Sound Card
-
@scottalanmiller said in Ubuntu Server - Virtual Sound Card:
Did you ever find a good option for this? Or was this just one of those times to give up?
It died a death, Install a Windows VM to do this instead which has a lot more apps to do this kind of thing. Even silly OSx can do this so I was really surprised I could not find any Linuxy ways of doing it. Running on a Windows 10 VM at the moment working away at triple the price, not ideal but got it working.
@thwr said in Ubuntu Server - Virtual Sound Card:
What about http://www.alsa-project.org/main/index.php/Matrix%3AModule-dummy ?
In reading the docs, that sounds like it relies on a physical sound card being present, even at the motherboard level, most of these projects I've tried have needed some kind of physical audio interface to be present.
-
@Breffni-Potter Are you sure? snd-dummy represents a sound card on its own, with no specific hardware behind. I have no real use case for this, but this should work out of the box. If not, I may take a look into it.
The idea behind is simple:
snd-dummy represents the first (and only) soundcard. ALSA (or more likely PulseAudio) will "route" everything through it. From there, you should be able to grab a stream. -
@thwr said in Ubuntu Server - Virtual Sound Card:
@Breffni-Potter Are you sure? snd-dummy represents a sound card on its own, with no specific hardware behind. I have no real use case for this, but this should work out of the box. If not, I may take a look into it.
The idea behind is simple:
snd-dummy represents the first (and only) soundcard. ALSA (or more likely PulseAudio) will "route" everything through it. From there, you should be able to grab a stream.I gave up on that linux VM so can't test it but I tried many things under the sun involving ALSA and PulseAudio, I had a real Linux brain box helping me out with it and neither of us could get it working after a week of trying different things out.
If it works in testing by someone else, that'll be nice to know how to get it working.
-
@Breffni-Potter said in Ubuntu Server - Virtual Sound Card:
I gave up on that linux VM so can't test it but I tried many things under the sun involving ALSA and PulseAudio, I had a real Linux brain box helping me out with it and neither of us could get it working after a week of trying different things out.
So that's not urgent at all. You made me curious, so maybe I'll take a look into it during the next few days
-
@thwr said in Ubuntu Server - Virtual Sound Card:
@Breffni-Potter said in Ubuntu Server - Virtual Sound Card:
I gave up on that linux VM so can't test it but I tried many things under the sun involving ALSA and PulseAudio, I had a real Linux brain box helping me out with it and neither of us could get it working after a week of trying different things out.
So that's not urgent at all. You made me curious, so maybe I'll take a look into it during the next few days
Oh it was urgent 3 months ago
The fix was to bite the bullet and pay triple the cost for a Windows VM to do it.
-
Hehe. Is Ubuntu Server 16.04 ok for you?
-
@thwr said in Ubuntu Server - Virtual Sound Card:
Hehe. Is Ubuntu Server 16.04 ok for you?
Sure, whenever really, no rush.
-
@thwr said in Ubuntu Server - Virtual Sound Card:
...Good read! Wish I still had my blade in Chicago so I could test this out just for gits and shiggles.
Maybe finally time to renew that contract ... this time sans hosting clients. -
@chrisnbrooks said in Ubuntu Server - Virtual Sound Card:
@thwr said in Ubuntu Server - Virtual Sound Card:
...Good read! Wish I still had my blade in Chicago so I could test this out just for gits and shiggles.
Maybe finally time to renew that contract ... this time sans hosting clients.Just create a VM with no sound hardware
-
@thwr said in Ubuntu Server - Virtual Sound Card:
@chrisnbrooks said in Ubuntu Server - Virtual Sound Card:
@thwr said in Ubuntu Server - Virtual Sound Card:
...
Maybe finally time to renew that contract ... this time sans hosting clients.Just create a VM with no sound hardware
Hah! Nooo... Just take my money!!!
-
Ok, got it. It's actually pretty simple. Tried this in a fresh new Ubuntu 16.04.1 VM on VirtualBox. The VM does not have sound hardware (disabled in VirtualBox).
I had some problems with the recorded file, there was just white noise. Turned out something went wrong when I tried to record the output using arecord and pipe that to lame to get a MP3. Switched to WAV instead.Preparations:
sudo modprobe snd-aloop sudo apt-get install alsa
Check devices:
tw@ubuntu-snddummy:~$ sudo aplay -l **** List of PLAYBACK Hardware Devices **** Home directory not accessible: Permission denied card 0: Loopback [Loopback], device 0: Loopback PCM [Loopback PCM] Subdevices: 7/8 Subdevice #0: subdevice #0 Subdevice #1: subdevice #1 Subdevice #2: subdevice #2 Subdevice #3: subdevice #3 Subdevice #4: subdevice #4 Subdevice #5: subdevice #5 Subdevice #6: subdevice #6 Subdevice #7: subdevice #7 card 0: Loopback [Loopback], device 1: Loopback PCM [Loopback PCM] Subdevices: 8/8 Subdevice #0: subdevice #0 Subdevice #1: subdevice #1 Subdevice #2: subdevice #2 Subdevice #3: subdevice #3 Subdevice #4: subdevice #4 Subdevice #5: subdevice #5 Subdevice #6: subdevice #6 Subdevice #7: subdevice #7 tw@ubuntu-snddummy:~$
Play something
sudo aplay -D hw:0,0,0 sample.wav Playing WAVE 'sample.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
Record (different shell)
sudo arecord -D hw:0,1,0 -f cd record.wav
PS: Did everything as root to avoid any permission issues.
Source:
http://www.alsa-project.org/main/index.php/Matrix:Module-aloop -
Nice work, really good find.
Will remember to try this in the future.
-
Thanks, I was just curious Please report back if that works for you.
-
This got way more popular than I had been expecting it to be!
-
@scottalanmiller said in Ubuntu Server - Virtual Sound Card:
This got way more popular than I had been expecting it to be!
Now we just need to find use-cases for this
-
@thwr said in Ubuntu Server - Virtual Sound Card:
@scottalanmiller said in Ubuntu Server - Virtual Sound Card:
This got way more popular than I had been expecting it to be!
Now we just need to find use-cases for this
That's the bigger challenge
-
@thwr said in Ubuntu Server - Virtual Sound Card:
@scottalanmiller said in Ubuntu Server - Virtual Sound Card:
This got way more popular than I had been expecting it to be!
Now we just need to find use-cases for this
Back in the late 90s, a group of ~50 engineers and FEA people would have loved to have that available. We could do 3D remotely, but sound without an audio card, not so much.