Overclock.net banner

How do I create audio devices using ALSA?

449 Views 6 Replies 3 Participants Last post by  Xaero252
Spent the better part of 10 hours trying to figure this out. Been reading how to use pulse audio, vsound, and ALSA. The how to steps are so convoluted can't figure out how to use any of them. I just need two virtual audio devices linked together so what the music player sends to one device gets output through a virtual mic like device, so teamspeak can use it. Similar to Virtual Audio Cables.
1 - 7 of 7 Posts
Quote:
Originally Posted by Sulljason View Post

Spent the better part of 10 hours trying to figure this out. Been reading how to use pulse audio, vsound, and ALSA. The how to steps are so convoluted can't figure out how to use any of them. I just need two virtual audio devices linked together so what the music player sends to one device gets output through a virtual mic like device, so teamspeak can use it. Similar to Virtual Audio Cables.
You want pulse loopback. I'll post an example config later, it should explain things well. Hopefully the loopback audio quality and mixing issues have been fixed, but it sounds like you want a single output stream looped to a single virtual input - no mixing required.
  • Rep+
Reactions: 1
That sounds right. Used a dual male 3.5mm cable (green to blue analog line in) then accidentally changed a setting some where. Idk where, sounds horrible now -.- so finicky. Virtual is preferred, so a config would be very much appreciated.
biggrin.gif


Edit: Some how the mic volume maxed it self to above 100% so it was getting amplified (horribly I might add). Virtual is still desired though.

Question: Will "no mixing" disable the "feature" where it lowers the volume on louder parts of the song to make it around the same volume as the beginning?
See less See more
Quote:
Originally Posted by Sulljason View Post

That sounds right. Used a dual male 3.5mm cable (green to blue analog line in) then accidentally changed a setting some where. Idk where, sounds horrible now -.- so finicky. Virtual is preferred, so a config would be very much appreciated.
biggrin.gif


Edit: Some how the mic volume maxed it self to above 100% so it was getting amplified (horribly I might add). Virtual is still desired though.

Question: Will "no mixing" disable the "feature" where it lowers the volume on louder parts of the song to make it around the same volume as the beginning?
Okay, so here's an excerpt from a config I never had working properly:

Code:

Code:
...
### Load audio drivers statically
### (it's probably better to not load these drivers manually, but instead
### use module-udev-detect -- see below -- for doing this automatically)
...
...
load-module module-null-sink sink_name=pamix
load-module module-loopback latency_msec=2 sink=pamix
load-module module-loopback latency_msec=2 sink=pamix
...
...
Notice that the lines above are very undescriptive - this is probably where I went wrong, looking into things for you, I may have realized how to fix my own problems;

The problem with the above is that I name a "null-sink" which you can think of as a "virtual audio device" and then route two audio sources to it with a 2msec delay. Problem: What audio sources?

Solution:

Code:

Code:
load-module module-null-sink sink_name=pamix
load-module module-loopback source=0 sink=pamix
load-module module-loopback source=2 sink=pamix
You can obviously use the names for your sources or their numeric identifiers...
To find out what the number is run the following:

Code:

Code:
pactl list | grep -A2 'Source #'
Obviously after making any changes to your /etc/pulse/default.pa you will need to restart pulse to test it; to accomplish this run the following:

Code:

Code:
pulseaudio -k && pulseaudio -D
Anyways hope this at least gets you pointed in the right direction.

Edit: You may be able to get by just loading the loopback module as then a new input device should appear in pavucontrol or whatever pulse control you use. Haven't tested this - also I'm unable to load the loopback module myself currently it just errors out. You may also need to enter the Pulse command line using "pacmd" and use list-sources to get proper source names or numbers. The command I posted should work.

Even more interesting I can load the loopback module in pacmd using load-module module-loopback.

Edit: success! kind of. I was able to get it working succesfully adding a "monitor of null output" input device, but only by doing the commands manual in pacmd. I'll see if I can get it working with the config later I have to leave for work.
See less See more
If you are curiouss to how to do it in pacmd here's the steps:

Code:

Code:
$pactl list | grep -A2 'Source #'
$pacmd
>>load-module module-null-sink sink_name=pamix
>>load-module module-loopback source=0 sink=pamix
>>load-module module-loopback source=2 sink=pamix
Note: this combines two streams into one. you can add as many as you need.
What about jack? Don't have it but might test it for ya, got time. Anyways, just wondering if that would do the same. My take on this is not setting up any virtual stuff but recording off the pcm stream. Pcm or wav, i know you can record off that. Or set it to a record channel, can you not select diff record channels in teamspeak?
I realize what I posted for my own personal config is a bit overkill for your purposes - you should be able to simply load-module null-sink-module and use the NULL output device in the music player - from there you can select the "Monitor of NULL audio device" as the input for teamspeak. My purpose is just more complicated - I want audio output by games, and desktop applications, as well as my voice from my microphone mixed into one single input stream - what most streaming gamers have in one way or another - just a lot higher quality. This helps when creating tutorials, streaming games, and other things.
@mushroomboy - JACK will also do this, but as he has an existing pulse/alsa setup there should be no need to go into a convoluted JACK/alsa setup, though JACK is *MUCH* better than pulse in pretty much every way - the only feature I would miss from pulse is the live command line interface to the backend (pacmd) which lets me play with modules and configuration options on the fly. Supposedly changes made in pacmd should carry over between reboots from the reading I've been doing - I just haven't had the time to test it.

Edit: just verified that the changes using pacmd worked - I'm going to test now if they are persistant through pulse restarts
Edit2: changes are persistent through both daemon restarts and full system reboots.
See less See more
1 - 7 of 7 Posts
This is an older thread, you may not receive a response, and could be reviving an old thread. Please consider creating a new thread.
Top