Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Multimedia
  • Search

ALSA and dmix buffers, skippy sound at times

Help with creation, editing, or playback of sounds, images, or video. Amarok, audacious, mplayer, grip, cdparanoia and anything else that makes a sound or plays a video.
Post Reply
Advanced search
6 posts • Page 1 of 1
Author
Message
gspr
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 127
Joined: Sat Sep 07, 2002 12:22 pm

ALSA and dmix buffers, skippy sound at times

  • Quote

Post by gspr » Mon Aug 08, 2005 12:41 am

Hi.

I recently tossed aRTS out my computer for good. I am now running an ALSA/dmix setup with the following asound.conf:

Code: Select all

# 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.
Top
Tlaloc
Guru
Guru
User avatar
Posts: 451
Joined: Mon Feb 21, 2005 12:59 pm
Location: Europe - Alps - Tyrol

  • Quote

Post by Tlaloc » Mon Aug 08, 2005 7:22 am

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.
Top
gspr
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 127
Joined: Sat Sep 07, 2002 12:22 pm

  • Quote

Post by gspr » Mon Aug 08, 2005 11:31 am

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.
Top
F-0_ICE
l33t
l33t
User avatar
Posts: 679
Joined: Mon Dec 06, 2004 2:20 pm

  • Quote

Post by F-0_ICE » Fri Sep 23, 2005 12:33 am

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.
Top
Tlaloc
Guru
Guru
User avatar
Posts: 451
Joined: Mon Feb 21, 2005 12:59 pm
Location: Europe - Alps - Tyrol

  • Quote

Post by Tlaloc » Sun Sep 25, 2005 8:53 am

Code: Select all

#!/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.
Top
F-0_ICE
l33t
l33t
User avatar
Posts: 679
Joined: Mon Dec 06, 2004 2:20 pm

  • Quote

Post by F-0_ICE » Thu Sep 29, 2005 12:43 am

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-32 ... ight-.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.
Top
Post Reply

6 posts • Page 1 of 1

Return to “Multimedia”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic