Overclock.net › Forums › Software, Programming and Coding › Operating Systems › Linux, Unix › How do I create audio devices using ALSA?
New Posts  All Forums:Forum Nav:

How do I create audio devices using ALSA?

post #1 of 7
Thread Starter 
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.
post #2 of 7
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.
    
CPUMotherboardGraphicsRAM
Core i7 920 D0 4.2ghz HT (1.3625v) Asus R3E 2xGTX 460 (non SLi, no overclock) 6x2gb G.skill @ 6-8-6-24-1T 
Hard DriveOptical DriveOSMonitor
WD-VR 300GBx1, 2xWD 1tb,2x60gb Agility Some crappy combo burner... Arch x64 3xDell U2410f rev A02 
KeyboardPowerCaseMouse
X-Armor U9BL TT Toughpower 1200w (NTB more efficient) Mountain Mods Pinnacle 24 CYO Roccat Kone (R.I.P. A4Tech x7) 
Mouse Pad
Steelpad Experience I-1 
  hide details  
Reply
    
CPUMotherboardGraphicsRAM
Core i7 920 D0 4.2ghz HT (1.3625v) Asus R3E 2xGTX 460 (non SLi, no overclock) 6x2gb G.skill @ 6-8-6-24-1T 
Hard DriveOptical DriveOSMonitor
WD-VR 300GBx1, 2xWD 1tb,2x60gb Agility Some crappy combo burner... Arch x64 3xDell U2410f rev A02 
KeyboardPowerCaseMouse
X-Armor U9BL TT Toughpower 1200w (NTB more efficient) Mountain Mods Pinnacle 24 CYO Roccat Kone (R.I.P. A4Tech x7) 
Mouse Pad
Steelpad Experience I-1 
  hide details  
Reply
post #3 of 7
Thread Starter 
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?
Edited by Sulljason - 8/5/13 at 12:36am
post #4 of 7
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:
...
### 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:
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:
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:
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.
Edited by Xaero252 - 8/5/13 at 1:31pm
    
CPUMotherboardGraphicsRAM
Core i7 920 D0 4.2ghz HT (1.3625v) Asus R3E 2xGTX 460 (non SLi, no overclock) 6x2gb G.skill @ 6-8-6-24-1T 
Hard DriveOptical DriveOSMonitor
WD-VR 300GBx1, 2xWD 1tb,2x60gb Agility Some crappy combo burner... Arch x64 3xDell U2410f rev A02 
KeyboardPowerCaseMouse
X-Armor U9BL TT Toughpower 1200w (NTB more efficient) Mountain Mods Pinnacle 24 CYO Roccat Kone (R.I.P. A4Tech x7) 
Mouse Pad
Steelpad Experience I-1 
  hide details  
Reply
    
CPUMotherboardGraphicsRAM
Core i7 920 D0 4.2ghz HT (1.3625v) Asus R3E 2xGTX 460 (non SLi, no overclock) 6x2gb G.skill @ 6-8-6-24-1T 
Hard DriveOptical DriveOSMonitor
WD-VR 300GBx1, 2xWD 1tb,2x60gb Agility Some crappy combo burner... Arch x64 3xDell U2410f rev A02 
KeyboardPowerCaseMouse
X-Armor U9BL TT Toughpower 1200w (NTB more efficient) Mountain Mods Pinnacle 24 CYO Roccat Kone (R.I.P. A4Tech x7) 
Mouse Pad
Steelpad Experience I-1 
  hide details  
Reply
post #5 of 7
If you are curiouss to how to do it in pacmd here's the steps:
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.
    
CPUMotherboardGraphicsRAM
Core i7 920 D0 4.2ghz HT (1.3625v) Asus R3E 2xGTX 460 (non SLi, no overclock) 6x2gb G.skill @ 6-8-6-24-1T 
Hard DriveOptical DriveOSMonitor
WD-VR 300GBx1, 2xWD 1tb,2x60gb Agility Some crappy combo burner... Arch x64 3xDell U2410f rev A02 
KeyboardPowerCaseMouse
X-Armor U9BL TT Toughpower 1200w (NTB more efficient) Mountain Mods Pinnacle 24 CYO Roccat Kone (R.I.P. A4Tech x7) 
Mouse Pad
Steelpad Experience I-1 
  hide details  
Reply
    
CPUMotherboardGraphicsRAM
Core i7 920 D0 4.2ghz HT (1.3625v) Asus R3E 2xGTX 460 (non SLi, no overclock) 6x2gb G.skill @ 6-8-6-24-1T 
Hard DriveOptical DriveOSMonitor
WD-VR 300GBx1, 2xWD 1tb,2x60gb Agility Some crappy combo burner... Arch x64 3xDell U2410f rev A02 
KeyboardPowerCaseMouse
X-Armor U9BL TT Toughpower 1200w (NTB more efficient) Mountain Mods Pinnacle 24 CYO Roccat Kone (R.I.P. A4Tech x7) 
Mouse Pad
Steelpad Experience I-1 
  hide details  
Reply
post #6 of 7
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?
Current Rig
(14 items)
 
  
CPUMotherboardGraphicsRAM
FX-8350 4.6GHz@1.44v GA-990FXA-UD3 R4.0 HD 7950 (1100/1450) 8G Muskin DDR3 1866@8CLS 
Hard DriveOptical DriveOSMonitor
1TB WD LiteOn DVD-RW DL Linux/Windows 19" Phillips TV 1080p 
PowerCaseMouseMouse Pad
OCZ 600W Generic Junk Logitech MX400 Generic Junk 
Audio
SBL 5.1 
  hide details  
Reply
Current Rig
(14 items)
 
  
CPUMotherboardGraphicsRAM
FX-8350 4.6GHz@1.44v GA-990FXA-UD3 R4.0 HD 7950 (1100/1450) 8G Muskin DDR3 1866@8CLS 
Hard DriveOptical DriveOSMonitor
1TB WD LiteOn DVD-RW DL Linux/Windows 19" Phillips TV 1080p 
PowerCaseMouseMouse Pad
OCZ 600W Generic Junk Logitech MX400 Generic Junk 
Audio
SBL 5.1 
  hide details  
Reply
post #7 of 7
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.
Edited by Xaero252 - 8/6/13 at 12:27am
    
CPUMotherboardGraphicsRAM
Core i7 920 D0 4.2ghz HT (1.3625v) Asus R3E 2xGTX 460 (non SLi, no overclock) 6x2gb G.skill @ 6-8-6-24-1T 
Hard DriveOptical DriveOSMonitor
WD-VR 300GBx1, 2xWD 1tb,2x60gb Agility Some crappy combo burner... Arch x64 3xDell U2410f rev A02 
KeyboardPowerCaseMouse
X-Armor U9BL TT Toughpower 1200w (NTB more efficient) Mountain Mods Pinnacle 24 CYO Roccat Kone (R.I.P. A4Tech x7) 
Mouse Pad
Steelpad Experience I-1 
  hide details  
Reply
    
CPUMotherboardGraphicsRAM
Core i7 920 D0 4.2ghz HT (1.3625v) Asus R3E 2xGTX 460 (non SLi, no overclock) 6x2gb G.skill @ 6-8-6-24-1T 
Hard DriveOptical DriveOSMonitor
WD-VR 300GBx1, 2xWD 1tb,2x60gb Agility Some crappy combo burner... Arch x64 3xDell U2410f rev A02 
KeyboardPowerCaseMouse
X-Armor U9BL TT Toughpower 1200w (NTB more efficient) Mountain Mods Pinnacle 24 CYO Roccat Kone (R.I.P. A4Tech x7) 
Mouse Pad
Steelpad Experience I-1 
  hide details  
Reply
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Linux, Unix
Overclock.net › Forums › Software, Programming and Coding › Operating Systems › Linux, Unix › How do I create audio devices using ALSA?