Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
ALSA and dmix buffers, skippy sound at times
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Multimedia
View previous topic :: View next topic  
Author Message
gspr
Tux's lil' helper
Tux's lil' helper


Joined: 07 Sep 2002
Posts: 127

PostPosted: Mon Aug 08, 2005 12:41 am    Post subject: ALSA and dmix buffers, skippy sound at times Reply with quote

Hi.

I recently tossed aRTS out my computer for good. I am now running an ALSA/dmix setup with the following asound.conf:
Code:
# This is ripped straight from the amarok wiki at http://amarok.kde.org/wiki/index.php/Setting_up_Dmix_for_ALSA
# I really should understand what's going on here!
# At any rate, this seems to work if programs with ALSA output are pointed to the "dmixer" mixer.

pcm.dmixer {
   type dmix
   ipc_key 1024
   slave {
       pcm "hw:0,0"            # make sure this matches the actual device
       #period_time 0          # not necessary since ALSA 1.0pre
       period_size 2048        # Use a power of 2
       buffer_size 32768       # must be a multiple of period_size
       #rate 44100             # not necessary; let alsa-lib handle this
   }
   bindings {
       0 0
       1 1                     # bind only the first 2 channels
   }
}
pcm.duplex
{
   type asym
   playback.pcm "dmixer"
   capture.pcm "dsnoop"
}
# Everything shall be dmixed, so redefine "default":
# Note that this is _not_ a good idea, since dmix doesn't allow mmap access currently
#pcm.!default {
#   type plug
#   slave.pcm "duplex"
#}
# OSS via aoss should d(mix)stroyed:
pcm.dsp0 {
   type plug
   slave.pcm "duplex"
}
ctl.dmixer {
   type hw
   card 0
}

(Anybody see anything wrong here?)

For my audio playing experience, I use amaroK with the Gstreamer backend. The computer is a Centrino laptop, and it dynamically clocks the CPU up and down as needed. This means that my CPU often runs at 600 MHz while playing music. If I start maximizing/minimizing windows, the audio will (sometimes) skip for a bit. The speedstepping daemon has some latency when it comes to clocking up to meet such fluctuating demands for processing power, and it could be causing the skips. However, I think running at the minimal 600 MHz oughta be enough for skip-free audio playback.

Any ideas? I've tried messing around with Gstreamer options in the amaroK config, but to no avail.

PS: Dmix has proven really hard for me to grasp. Anybody feel like explaining the meaning of the things in my asound.conf? I usually like to understand what's going on when something Just Works.
_________________
"People said I should accept the world. Bullshit! I don't accept the world." -- RMS.
"We are to admit no more causes of natural things than such as are both true and sufficient to explain their appearances." -- Newton.
Back to top
View user's profile Send private message
Tlaloc
Guru
Guru


Joined: 21 Feb 2005
Posts: 451
Location: Europe - Alps - Tyrol

PostPosted: Mon Aug 08, 2005 7:22 am    Post subject: Reply with quote

If I remember exactly you do not need an asound.conf anymore as alsa-1.09b does dmix by default. I have thrown mine away and playback is still fine. And in my experience the xine engine has given me much less problems regarding latency and skipping. If you do not have all your music in musepack format you should give the xine engine a try, it is more mature than gstreamer atm.
Bye, Valentin.


Last edited by Tlaloc on Mon Aug 08, 2005 2:24 pm; edited 1 time in total
Back to top
View user's profile Send private message
gspr
Tux's lil' helper
Tux's lil' helper


Joined: 07 Sep 2002
Posts: 127

PostPosted: Mon Aug 08, 2005 11:31 am    Post subject: Reply with quote

Very interesting. Thank you.
_________________
"People said I should accept the world. Bullshit! I don't accept the world." -- RMS.
"We are to admit no more causes of natural things than such as are both true and sufficient to explain their appearances." -- Newton.
Back to top
View user's profile Send private message
F-0_ICE
l33t
l33t


Joined: 06 Dec 2004
Posts: 679

PostPosted: Fri Sep 23, 2005 12:33 am    Post subject: Reply with quote

hi. do you use the kde notifications if so how did you get them working without arts :P ?
_________________
~AMD64
AMD: Athlon64 X2 3800+
2G PC3200
ATI: RADEON HD 4350
Linksys: WMP54G

True Knowledge is Best Acquired Through Experience.
Back to top
View user's profile Send private message
Tlaloc
Guru
Guru


Joined: 21 Feb 2005
Posts: 451
Location: Europe - Alps - Tyrol

PostPosted: Sun Sep 25, 2005 8:53 am    Post subject: Reply with quote

Code:
#!/bin/bash
   case `echo "$1" | sed -re "s/.*\.(.*)$/\1/"` in
   ogg)
   ogg123 -d alsa09 "$1" &
   ;;
   mp3|mpg|mpeg)
   mpg321 "$1" &
   ;;
   wav|au)
   aplay "$1" &
   ;;
   esac

Thats the bash script I set to call as external player in the Control Center under Sound & Multimedia -> System Notifications. Remember to compile kdelibs with the arts use flag.
Bye, Valentin.
Back to top
View user's profile Send private message
F-0_ICE
l33t
l33t


Joined: 06 Dec 2004
Posts: 679

PostPosted: Thu Sep 29, 2005 12:43 am    Post subject: Reply with quote

oh...man... and i finished updating my world to exclude the arts use flag not too long ago. when i use your script i don't have any audio from knotify. at any rate once kde 4.0 comes out this problem will no longer be of any concern to anyone. BTW thanks for the reply.

--UPDATE--
i found out the using /usr/bin/play worked great as an external player heres the thread
http://forums.gentoo.org/viewtopic-t-325888-highlight-.html and thanks for the help.
_________________
~AMD64
AMD: Athlon64 X2 3800+
2G PC3200
ATI: RADEON HD 4350
Linksys: WMP54G

True Knowledge is Best Acquired Through Experience.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Multimedia 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