LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   Alsa sound multiple streams (http://www.linuxquestions.org/questions/slackware-14/alsa-sound-multiple-streams-4175457750/)

bmarley83 04-10-2013 11:05 PM

Alsa sound multiple streams
 
Hello I've been having a sound problem since I installed Slackware 14 x64 that I have not found a solution for after scouring the web and I was hope someone could help me. My sound device is onboard ALC888 that reports as Intel HDA in in kmix and alsamix. My problem is that without some code that I added to .asoundrc in my home directory I cannot get sound to play back on multiple programs at the same time (i.e. playing youtube video while playing vlc while using painobar etc...). In fact I cant even play pianobar and watch youtube at the same time with out that script because when one is playing the other reports a device or resource busy. Now with the code in the script first off my kmix crashes and wont load. Also my wine games wont load at all and steam games wont load. If I disable the script and logout and login again steam games play but I get skipping audio and buffer overflow errors reported in terminal from steam. So I'm at a loss its either load the script and kmix crashes and I cant play any games... :( boohoo you poor boy lol, or I dont and games work except tf2 in steam witch gives me buffer overflow errors from the soundcard and audio skips, and if I play youtube in ff then try to play vlc player or pianobar they report device busy and dont playback.

}
pcm.internalDmixed {
type dmix
ipc_key 1024
ipc_key_add_uid false
ipc_perm 0666
slave {
pcm "internal"
period_time 0
period_size 2048
channels 4
}
bindings {
0 0
1 1
2 2
3 3
}

there is my .asoundrc, wth am I doing wrong here?

dugan 04-11-2013 02:00 AM

To get software mixing that always works, all I do is edit /etc/rc.d/rc.alsa and comment out the load_alsa_oss_modules lines. That will prevent anything from running in OSS Emulation mode. Anything running in OSS emulation mode would get exclusive use of the sound card and block everything else from using it. Anything not running in OSS emulation mode gets software mixing, and that's been true for quite a few years.

bmarley83 04-11-2013 06:29 PM

Thank you, Dugan! I'm still learning Slackware obviously and I appreciate you taking the time to answer my question. Now that my sound works perfectly for everything including TF2 in Steam :D... I am working on optimizing my Slackware machine for optimal performance (which I now realize I should have considered the first steps of optimization before installing! XD ). This will just give me a chance to practice backing up my system. Anyway, your solution solved all my audio problems! Thanks.

Geremia 05-09-2013 04:49 PM

Quote:

Originally Posted by dugan (Post 4929576)
To get software mixing that always works, all I do is edit /etc/rc.d/rc.alsa and comment out the load_alsa_oss_modules lines. That will prevent anything from running in OSS Emulation mode. Anything running in OSS emulation mode would get exclusive use of the sound card and block everything else from using it. Anything not running in OSS emulation mode gets software mixing, and that's been true for quite a few years.

I'm using Slackware, and I commented out all instances of load_alsa_oss_modules and this in rc.alsa:
Code:

# A function to load the ALSA OSS compat modules:                                                                           
# load_alsa_oss_modules() {                                                                                                 
#  if modprobe -c | tr _ - | grep -wq snd-pcm-oss ; then                                                                   
#    if ! cat /proc/modules | tr _ - | grep -wq snd-pcm-oss ; then                                                         
#      echo "Loading OSS compatibility modules for ALSA."                                                                   
#      modprobe snd-pcm-oss                                                                                                 
#      modprobe snd-seq-oss                                                                                                 
#      modprobe snd-mixer-oss                                                                                               
#    fi                                                                                                                     
#  fi                                                                                                                       
# }

Yet, I still can't mix multiple applications' sound together. (I've rebooted and everything.)

E.g., if I try playing audio in two difference instances of VLC, VLC gives me an error about how the "default" audio device cannot be used because the device or resource is busy.

Paulo2 05-10-2013 11:20 AM

Quote:

Originally Posted by Geremia (Post 4948151)
Yet, I still can't mix multiple applications' sound together. (I've rebooted and everything.)

I was having the same problem.
Be sure you've selected "default" on VLC audio out configuration (or "alsa" in SMPlayer).

My other problem was that I have this in "~/.asoundrc", this is for equalization launched by "alsamixer -D equal"
Code:

ctl.equal {
  type equal;
}

pcm.plugequal {
  type equal;
  # Modify the line below if you don't
  # want to use sound card 0.
  slave.pcm "plughw:0,0";
  # or if you want to use with multiple applications output to dmix
  slave.pcm "plug:dmix"
}

#pcm.equal {
  # Or if you want the equalizer to be your
  # default soundcard uncomment the following
  # line and comment the above line.
 pcm.!default {
  type plug;
  slave.pcm plugequal;
}

The line "slave.pcm "plug:dmix"" was commented, preventing two streams at the same time.

I would like to say thank you to dugan for the helpful post :hattip:


I was thinking that could be a problem with groups and permissions, according to this post
http://www.linuxquestions.org/questi...a-dmix-823255/
but it wasn't the case.

Excuse me for any english erros.

dimm0k 05-10-2013 11:31 AM

Wow, I have to give thanks to dugan and the OP for this thread. Didn't know it was so simple to get mixing to work as I have always had a pretty lengthy .asoundrc to force things. Good to know!

Geremia 05-11-2013 12:04 AM

Quote:

Originally Posted by Paulo2 (Post 4948630)
Be sure you've selected "default" on VLC audio out configuration (or "alsa" in SMPlayer).

Yes, "default" is selected.
Quote:

Originally Posted by Paulo2 (Post 4948630)
My other problem was that I have this in "~/.asoundrc", this is for equalization launched by "alsamixer -D equal"

I don't even have this file…
thanks for the help

dugan 05-11-2013 01:20 AM

Here's something else you can try:

http://www.linuxquestions.org/questi...0/#post4945999

Geremia 05-17-2013 11:05 AM

Quote:

Originally Posted by dugan (Post 4948961)

I ended up deleting /etc/asound.conf and rebooting, and now it works!


All times are GMT -5. The time now is 10:05 PM.