Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 218641 - First part of sound cut off when using dmix with alsa-*-1.0.16
Summary: First part of sound cut off when using dmix with alsa-*-1.0.16
Status: RESOLVED NEEDINFO
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo ALSA team
URL: http://hg-mirror.alsa-project.org/als...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-04-20 19:58 UTC by Mark Purtill
Modified: 2010-01-08 01:53 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
My version of the patch (test.patch,641 bytes, patch)
2008-04-27 05:59 UTC, Mark Purtill
Details | Diff
upstream patch (dmix_skipping_first_samples.patch,1.18 KB, patch)
2008-05-18 19:14 UTC, Andreas Berg
Details | Diff
Modifies ebuild to use upstream patch (alsa-lib-1.0.16.ebuild.patch,284 bytes, patch)
2008-09-03 06:10 UTC, Dan Ziemba
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Purtill 2008-04-20 19:58:01 UTC
Using alsa-headers-1.0.16 alsa-lib-1.0.16 alsa-tools-1.0.16 and alsa-utils-1.0.16, aplay clips the first few tenths of a second off a sound when it goes thru the dmix plugin (aplay -Dplug:dmix ...) but not when played directly (aplay -Dfront).  This does not happen if I revert to alsa-headers-1.0.14 alsa-lib-1.0.14a-r1 alsa-tools-1.0.14 and alsa-utils-1.0.14.  (I'm not sure if it's safe to mix those.) 

This may be related to 

<https://bugtrack.alsa-project.org/alsa-bug/bug_view_advanced_page.php?bug_id=3763>

(which says the length of cutoff is 0.3 seconds, which seems about right) but I don't have multiple sound cards, just a VIA 8233A built-in to the motherboard (which doesn't match either card in that bug).

% emerge --info
Portage 2.1.4.4 (default-linux/x86/2007.0/desktop, gcc-4.1.2, glibc-2.6.1-r0, 2.6.24-gentoo-r5 i686)
=================================================================
System uname: 2.6.24-gentoo-r5 i686 AMD Athlon(tm) XP 1900+
Timestamp of tree: Sat, 19 Apr 2008 15:45:01 +0000
app-shells/bash:     3.2_p17-r1
dev-java/java-config: 1.3.7, 2.1.4
dev-lang/python:     2.4.4-r9
dev-python/pycrypto: 2.0.1-r6
sys-apps/baselayout: 1.12.11.1
sys-apps/sandbox:    1.2.18.1-r2
sys-devel/autoconf:  2.13, 2.61-r1
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.1
sys-devel/binutils:  2.16.1-r3, 2.17, 2.17.50.0.9, 2.17.50.0.10, 2.17.50.0.11, 2.17.50.0.12, 2.17.50.0.13, 2.17.50.0.14, 2.17.50.0.15, 2.17.50.0.16, 2.18-r1
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   1.5.26
virtual/os-headers:  2.6.23-r3
ACCEPT_KEYWORDS="x86"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-ggdb -O2"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.2/share/config /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/config"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/revdep-rebuild /etc/terminfo /etc/udev/rules.d"
CXXFLAGS="-ggdb -O2"
DISTDIR="/usr/portage/distfiles"
FEATURES="distlocks fixpackages metadata-transfer nostrip sandbox sfperms strict unmerge-orphans userfetch userpriv usersandbox"
GENTOO_MIRRORS="ftp://213.186.33.38/gentoo-distfiles/ ftp://ftp.sh.cvut.cz/MIRRORS/gentoo/gentoo http://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror/ ftp://ftp.belnet.be/mirror/rsync.gentoo.org/gentoo/ http://gentoo.osuosl.org/ "
LINGUAS="en ja"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_EXTRA_OPTS="--timeout=300"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/portage/local/layman/gentoo-gis /usr/portage/local/layman/xemacs /usr/portage/local/layman/sunrise /usr/local/portage"
SYNC="rsync://rsync.namerica.gentoo.org/gentoo-portage"
USE="3dnow 3dnowext X Xaw3d a52 aac aalib acl acpi alsa arts berkdb bluetooth bzip2 cairo canna cdr cjk cli cracklib crypt cups dbus debug doc dri dts dvd dvdr dvdread emboss encode esd evo fam firefox fortran freetype freewnn gdbm gif gnome gpm gstreamer gtk hal iconv imagemagick immqt-bc ipv6 isdnlog java joystick jpeg kde kdexdeltas kerberos ldap lm_sensors mad maildir matroska mbox midi mikmod mmx mmxext mng mozsvg mp3 mpeg mplayer mudflap mule ncurses nls nodrm nptl nptlonly ogg opengl openmp oss pam pcre pdf perl pic png pppd python qt qt3 qt3support qt4 quicktime readline reflection ruby scanner sdl session spell spl sse ssl svg tcltk tcpd tetex tiff truetype unicode usb vcd vorbis win32codecs wmf x264 x86 xine xinerama xml xorg xv zlib" ALSA_CARDS="via82xx" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CAMERAS="ptp2" ELIBC="glibc" INPUT_DEVICES="keyboard mouse joystick" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en ja" USERLAND="GNU" VIDEO_CARDS="mga vesa fbdev"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, MAKEOPTS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS
Comment 1 Tony Vroon (RETIRED) gentoo-dev 2008-04-20 22:55:45 UTC
This is not related to your soundcard. This is related to the dmix plugin itself. The bug has been identified by Mike Gorse and his patch is already in the upstream ALSA tree. I expect it to be pulled into 1.0.17-rc1.
I've linked it in the URL field. Could you confirm that this resolves the problem for you? If it does, we'll locally patch for you in an 1.0.16-r1.
Comment 2 Mark Purtill 2008-04-21 06:31:48 UTC
Okay, I'll give that a try and see if it helps.  I should be able to report back in a day or two.
Comment 3 Mark Purtill 2008-04-27 05:59:24 UTC
Created attachment 151097 [details, diff]
My version of the patch

Sorry for the delay.  The change in the patch does appear to fix the problem.  (I was unable to get the patch from the web-site to apply for reasons I don't understand (patch would not be able to find the file to patch or complain that the patch was malformed); eventually, I gave up and made the fix by hand and created my own patch, which is attached on the off chance it's of use.)
Comment 4 Andreas Berg 2008-05-18 19:14:36 UTC
Created attachment 153583 [details, diff]
upstream patch
Comment 5 Andreas Berg 2008-05-18 19:19:17 UTC
The upstream patch applies cleanly and I can confirm that it does resolve the problem, too. 
Comment 6 Dan Ziemba 2008-09-03 05:14:01 UTC
I modified the 1.0.16 ebuild to apply the upstream patch, then reinstalled alsa-lib-1.0.16.  The patch applied cleanly, and my sound problem is solved.  I had the same issue as the original poster.  Perhaps this should be added to portage?
Comment 7 Dan Ziemba 2008-09-03 06:10:38 UTC
Created attachment 164440 [details, diff]
Modifies ebuild to use upstream patch

Patch showing the simple change I made to the ebuild.
Comment 8 Steve Dibb (RETIRED) gentoo-dev 2009-08-13 17:04:28 UTC
(In reply to comment #7)
> Created an attachment (id=164440) [edit]
> Modifies ebuild to use upstream patch
> 
> Patch showing the simple change I made to the ebuild.
> 

If this was fixed upstream, I assume by now (1.0.20) should have the fixes, right?
Comment 9 Steve Dibb (RETIRED) gentoo-dev 2010-01-08 01:53:01 UTC
Lemme know if this still an issue, thanks guys