Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Only one program using ALSA at a time?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on PPC
View previous topic :: View next topic  
Author Message
AlphaBetaGamma
n00b
n00b


Joined: 12 Jun 2005
Posts: 6

PostPosted: Sun Jun 12, 2005 11:29 pm    Post subject: Only one program using ALSA at a time? Reply with quote

I have a weird problem, and I've searched all around for solutions, but I can't find anything. It might be a bug with Gaim/mplayer, but I'm not sure. Whenever I use mplayer, Gaim sounds don't work for the duration of whatever I'm playing, but instead queue up then all play after mplayer is finished, and when Gaim is currently playing a sound, mplayer gives errors about audio.

Any ideas?
Back to top
View user's profile Send private message
JoseJX
Retired Dev
Retired Dev


Joined: 28 Apr 2002
Posts: 2774

PostPosted: Sun Jun 12, 2005 11:45 pm    Post subject: Reply with quote

http://gentoo-wiki.com/HOWTO_ALSA_sound_mixer_aka_dmix

Basically you're not getting any hardware mixing with your sound card, you'll need to use software mixing instead.
_________________
Gentoo PPC FAQ: http://www.gentoo.org/doc/en/gentoo-ppc-faq.xml
Back to top
View user's profile Send private message
AlphaBetaGamma
n00b
n00b


Joined: 12 Jun 2005
Posts: 6

PostPosted: Mon Jun 13, 2005 2:42 am    Post subject: Reply with quote

Ah, alright. Sorry for the newbie problem.

EDIT: Apparently I don't already have dmix set up or something. I set up ALSA to be a 2.4 kernel module, so according to this Wiki page you've given me, it should already be working, no? I also tried using the new config file under "The other approach" on the Wiki page, but no go.
Back to top
View user's profile Send private message
Massimo B.
Veteran
Veteran


Joined: 09 Feb 2005
Posts: 1563
Location: Germany

PostPosted: Wed Sep 07, 2005 9:17 pm    Post subject: Reply with quote

Same problem here: While playing xmms I try to play with mplayer a wave file in the terminal.
I tried playing both with alsa or both with esound. (By the way esound gives a far better performance on my ibookG3 than alsa does).
But mplayer is mute.
If I try mplayer -ao alsa:device=dmix alert.wav there comes only noise from the speakers.

My goal is being informed by kismet's sound while listening to nice electronic music. As player I use /usr/bin/mplayer.
_________________
ppc:PowerBook5,8 15"(1440)-G4/1.67,2G|amd64:HP EliteBook 8560w,i7-2620M,16G|Acer Z5610 (Core2QuadQ8200),8G|amd64-prefix:OpenSuse|HP EliteDesk 800G1 i7-4790|HP Compaq Pro 6300 i7-3770
Lila-Theme
Back to top
View user's profile Send private message
gnomeza
Tux's lil' helper
Tux's lil' helper


Joined: 31 Dec 2003
Posts: 97

PostPosted: Fri Sep 09, 2005 6:46 pm    Post subject: Reply with quote

As an example, my .asoundrc for duplex software mixing is included below.
So you can use linphone while playing music...

If you get choppy audio, try experimenting with the buffer_size and period_size.
If you get no audio you might be trying to play audio at a sample rate your card can't support (alsa can fix that, but I'm not the person to ask about it ;)

Code:

# .asoundrc
#
# [Fri Sep  9 19:41:59 BST 2005]

pcm.card0 {
    type hw
    card 0
}


pcm.output {
    type dmix
    ipc_key 313          # must be unique!
    ipc_perm 0660         # sound for everybody (at least in your group)
    slave {
        pcm "card0"      # you cannot use a "plug" device here, darn.
        period_time 0
        period_size 4096  # must be power of 2
        buffer_size 16384  # dito. It
#        format "S16"
#        periods 128      # dito.
        rate 44100        # with rate 8000 you *will* hear,
                          # if ossmix is used :)
    }
    bindings {
        0 0
        1 1
    }

}

pcm.input {
    type dsnoop
    ipc_key 631
    ipc_perm 0660         # sound for everybody (at least in your group)
    slave {
        pcm "card0"
        period_time 0
        period_size 4096
        buffer_size 16384
        periods 128
        rate 44100
    }
    bindings {
        0 0
        1 1
    }
}

pcm.duplex {
    type asym
    playback.pcm "output"
    capture.pcm "input"
}

pcm.!default {
    type plug
    slave.pcm "duplex"
}

pcm.dsp0 {
    type plug
    slave.pcm "output"
}

ctl.dsp0 {
    type plug
    slave.pcm "card0"
}

ctl.mixer0 {
    type plug
    slave.pcm "card0"
}

_________________
http://markferry.net
Back to top
View user's profile Send private message
Massimo B.
Veteran
Veteran


Joined: 09 Feb 2005
Posts: 1563
Location: Germany

PostPosted: Sat Sep 10, 2005 10:24 pm    Post subject: Reply with quote

Sorry, what is .asoundrc? Sounds like alsasound? There is no file like this on my (alsa) system.
Or just another mixer such as esound?
_________________
ppc:PowerBook5,8 15"(1440)-G4/1.67,2G|amd64:HP EliteBook 8560w,i7-2620M,16G|Acer Z5610 (Core2QuadQ8200),8G|amd64-prefix:OpenSuse|HP EliteDesk 800G1 i7-4790|HP Compaq Pro 6300 i7-3770
Lila-Theme
Back to top
View user's profile Send private message
fafhrd
Retired Dev
Retired Dev


Joined: 14 May 2002
Posts: 431
Location: Williamstown, MA

PostPosted: Sun Sep 11, 2005 6:38 pm    Post subject: Reply with quote

.asoundrc (like the example above) can exist at:
~/.asoundrc
or
/etc/asound.conf

The first is per-user, the 2nd for the entire system. The files wouldn't be on your system yet; you must create them, if you want them.
_________________
jñanam bandha
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on PPC All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum