Re: [Alsa-user] Higher quality dmix resampling
I get a lot of static-like noise when dmix resamples audio with a USB DAC I'm trying out. When I have mpd resample internally with libsamplerate, it sounds perfect. Can I get dmix to use libsamplerate or disable dmix? One of the main programs I use with audio is miro which doesn't allow you to specify an audio ouput device. I tried this in /etc/asound.conf to disable dmix: pcm.!default { type hw card 0 } ctl.!default { type hw card 0 } and tested with mplayer but that yielded no sound at all. I also tried this: defaults.pcm.rate_converter samplerate but that also yielded no sound from mplayer. Can I get around this static? - Grant The following patch completely fixes this problem. https://bugtrack.alsa-project.org/alsa-bug/view.php?id=4577 Does anyone know when this patch might show up in alsa-lib? - Grant -- Crystal Reports - New Free Runtime and 30 Day Trial Check out the new simplified licensing option that enables unlimited royalty-free distribution of the report engine for externally facing server and web deployment. http://p.sf.net/sfu/businessobjects ___ Alsa-user mailing list Alsa-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/alsa-user
Re: [Alsa-user] Higher quality dmix resampling
On Tue, 16 Jun 2009, Grant wrote: I get a lot of static-like noise when dmix resamples audio with a USB DAC I'm trying out. When I have mpd resample internally with libsamplerate, it sounds perfect. Can I get dmix to use libsamplerate or disable dmix? One of the main programs I use with audio is miro which doesn't allow you to specify an audio ouput device. I tried this in /etc/asound.conf to disable dmix: pcm.!default { type hw card 0 } ctl.!default { type hw card 0 } and tested with mplayer but that yielded no sound at all. I also tried this: defaults.pcm.rate_converter samplerate but that also yielded no sound from mplayer. Can I get around this static? - Grant The following patch completely fixes this problem. https://bugtrack.alsa-project.org/alsa-bug/view.php?id=4577 Does anyone know when this patch might show up in alsa-lib? I applied this patch. It will be in next alsa-lib release. Jaroslav - Jaroslav Kysela pe...@perex.cz Linux Kernel Sound Maintainer ALSA Project, Red Hat, Inc. -- Crystal Reports - New Free Runtime and 30 Day Trial Check out the new simplified licensing option that enables unlimited royalty-free distribution of the report engine for externally facing server and web deployment. http://p.sf.net/sfu/businessobjects___ Alsa-user mailing list Alsa-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/alsa-user
Re: [Alsa-user] Higher quality dmix resampling
I get a lot of static-like noise when dmix resamples audio with a USB DAC I'm trying out. When I have mpd resample internally with libsamplerate, it sounds perfect. Can I get dmix to use libsamplerate or disable dmix? One of the main programs I use with audio is miro which doesn't allow you to specify an audio ouput device. I tried this in /etc/asound.conf to disable dmix: pcm.!default { type hw card 0 } ctl.!default { type hw card 0 } and tested with mplayer but that yielded no sound at all. I also tried this: defaults.pcm.rate_converter samplerate but that also yielded no sound from mplayer. Can I get around this static? - Grant The following patch completely fixes this problem. https://bugtrack.alsa-project.org/alsa-bug/view.php?id=4577 Does anyone know when this patch might show up in alsa-lib? I applied this patch. It will be in next alsa-lib release. Jaroslav Thank you. - Grant -- Crystal Reports - New Free Runtime and 30 Day Trial Check out the new simplified licensing option that enables unlimited royalty-free distribution of the report engine for externally facing server and web deployment. http://p.sf.net/sfu/businessobjects ___ Alsa-user mailing list Alsa-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/alsa-user
Re: [Alsa-user] Higher quality dmix resampling
If it's the latter (as usually is on modern systems), then its just the input interface that changes, you're goin' trough ALSA anyway. Also, I should mention something that contradicts this. When I define a format for dmix in /etc/asound.conf that my DAC doesn't like, no ALSA apps will play sound. However, if I choose to output via OSS in those apps, I get sound. Here is an example of an asound.conf that causes apps set to ALSA to not play sound at all, and apps set to OSS to play sound perfectly as always: well, that does only mean that the OSS-emulation interface does not obey asound.conf (and/or .asoundrc) rules but use some different general setup. This of course makes perfect sense, as OSS provided only a simple device file interface: there would be no reason for the emulated OSS interface to provide anything different... Thus, I would say that what this means is that the underlying low- level driver (at least in some conditions) does work, but either the default setup on your installation is somewhat screwed or the driver does not work properly in all possible modes (that is, yet another snd_hda* bug...). Just to avoid confusion, mine is a USB DAC and it uses snd_usb_audio. hda was the card that blog post mentioned. I have another USB DAC which uses the same driver on the same system and does not produce static. I should also mention that the static varies from very quiet to loud depending on which file I'm playing. BTW, since I'm here I'm attaching the .asoundrc I'm using on my HTPC. I'm not 100% sure whether it's completely correct, but for sure playing to the default device (which goes to the on-board HDA) as well as to the HD192 HD176 does work perfectly. I'm also quite sure that indeed ALSA does obey the defaults.pcm.rate_converter setting (yes, also for the HDnnn resampling inputs to the Juli@). Another thing that makes me wonder about defaults.pcm.rate_converter on my system is the fact that using samplerate_best in asound.conf uses no CPU, but when I use it in mpd it maxes the CPU. Removing all the (still experimental) parts used to distribute the signal to various outputs (I did that mainly for testing purpouses...) and the duplicate parts for different settings, all that matters is basically just this: # ~/.asoundrc defaults.pcm.rate_converter speexrate_best # Give our card(s) some friendly aliases. # pcm.Juli12 front:CARD=Juli,DEV=0 # # This is Julia channels 12 (analog stereo tapped I2S out) # device name front:CARD=Juli,DEV=0 obtained with aplay -L I get: # aplay -L null Discard all samples (playback) or generate zero samples (capture) # aplay -l List of PLAYBACK Hardware Devices card 0: USBDAC [Proton USBDAC], device 0: USB Audio [USB Audio] Subdevices: 0/1 Subdevice #0: subdevice #0 I suppose the next thing to do is try a LiveCD. I'll do that ASAP. - Grant -- Crystal Reports - New Free Runtime and 30 Day Trial Check out the new simplified licensing option that enables unlimited royalty-free distribution of the report engine for externally facing server and web deployment. http://p.sf.net/sfu/businessobjects ___ Alsa-user mailing list Alsa-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/alsa-user
Re: [Alsa-user] Higher quality dmix resampling
On Friday 15 May 2009, Grant wrote: So how come that you don't get 'em with mpd?! In mpd I specify oss instead of alsa. If I specify alsa and involve dmix, I get static in mpd too. you say OSS... but was that the real oss (does it still exist for modern kernels/hardware?!) or was it just the ALSA oss emulation? If it's the latter (as usually is on modern systems), then its just the input interface that changes, you're goin' trough ALSA anyway. On the other end, if it really was the former (real OSS stack), then likely you have a problem with mixed+conflicting drivers... ALSA and real OSS can NOT coexist on a system. again, I believe that your problem is completely unrelated to the resampling algorithm used. [...] Well, there is a blog post under A little hint for hda ALSA users which says: if you own an hda-based soundcard and you head crackling sound while playing mp3s or similar, the problem is probably due to the bad samplerate conversion from 44100 to 48000. Sorry, I won't believe that. AFAIK ALSA is a layered stack where higher level functions such as dmix and resampling are implemented in their own layer which is sitting on top of the lover level ones (such as hardware drivers). Obviously the higher level functions are not implemented within the hardware-specific low level drivers and -AFAIK- they remain the same whatever low level driver is in use. So how/why something like any given ALSA resampling algorithm could work differently when paired with different hardware? BTW, on my HTPC (which by chance is the machine I'm on now) I have an Intel DP35DP. That have an ICH9 HD Audio Controller. Which I use when playing to the HDTV own speakers (rather than the HiFi system, for which as said I use a Juli@). Needless to say, it works perfectly with any resampling algorithm, using either analog or digital outputs at whatever sampling rate. I also have an old laptop with ICH4, my office desktop which have ICH5, another laptop with ICH7, ... not counting the large number of other Linux machines I manage at work. I believe I can say to have seen quite some different hardware/software combinations. In some 10+ years of Linux system management I have had troubles with unsupported hardware, incomplete and/or broken drivers, etc, but have never experienced static noise or otherwise broken audio due to poor resampling using the default ALSA config. On the other end, your referenced blog says explicitely: http://blog.flameeyes.eu/tag/alsa/page/2 although I admit I haven’t tried it first hand, as I don’t have any hda-based soundcard beside the laptop who should I believe? my own experience or his 2nd hand rumors? ;-) Only once you've got the default config to work properly you may start experimenting with more sophisticated options. That sounds good, but what else can I try? what I'd do as a first step is trying to get your own distribution / installation / customizations out of the mix. So get some proven Live CD/DVD (NOT Gentoo-based!) and try with those. I'd try with Ubuntu 9.04, then perhaps Mandriva 2009, good old Knoppix, etc. Try to get systems with several different kernel/alsa version combinations, and report what happen... maybe it'll turn out that you'll have to file a bug report. Ciao, Paolo. -- Skype: Paolo.Saggese http://borex.lngs.infn.it/saggese You can still escape from the GATES of hell: Use Linux! -- Ciao, Paolo. -- Skype: Paolo.Saggese http://borex.lngs.infn.it/saggese You can still escape from the GATES of hell: Use Linux! -- Crystal Reports - New Free Runtime and 30 Day Trial Check out the new simplified licensing option that enables unlimited royalty-free distribution of the report engine for externally facing server and web deployment. http://p.sf.net/sfu/businessobjects ___ Alsa-user mailing list Alsa-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/alsa-user
Re: [Alsa-user] Higher quality dmix resampling
So how come that you don't get 'em with mpd?! In mpd I specify oss instead of alsa. If I specify alsa and involve dmix, I get static in mpd too. you say OSS... but was that the real oss (does it still exist for modern kernels/hardware?!) or was it just the ALSA oss emulation? If it's the latter (as usually is on modern systems), then its just the input interface that changes, you're goin' trough ALSA anyway. On the other end, if it really was the former (real OSS stack), then likely you have a problem with mixed+conflicting drivers... ALSA and real OSS can NOT coexist on a system. I don't have real OSS compiled into the kernel but I do have ALSA and the ALSA OSS emulation. When I switch mplayer to OSS, the static disappears. When I go back to ALSA with mplayer, the static returns. I have the exact same experience with mpd. So I think that's a big clue. What it means, I'm not sure. again, I believe that your problem is completely unrelated to the resampling algorithm used. [...] Well, there is a blog post under A little hint for hda ALSA users which says: if you own an hda-based soundcard and you head crackling sound while playing mp3s or similar, the problem is probably due to the bad samplerate conversion from 44100 to 48000. Sorry, I won't believe that. AFAIK ALSA is a layered stack where higher level functions such as dmix and resampling are implemented in their own layer which is sitting on top of the lover level ones (such as hardware drivers). Obviously the higher level functions are not implemented within the hardware-specific low level drivers and -AFAIK- they remain the same whatever low level driver is in use. So how/why something like any given ALSA resampling algorithm could work differently when paired with different hardware? BTW, on my HTPC (which by chance is the machine I'm on now) I have an Intel DP35DP. That have an ICH9 HD Audio Controller. Which I use when playing to the HDTV own speakers (rather than the HiFi system, for which as said I use a Juli@). Needless to say, it works perfectly with any resampling algorithm, using either analog or digital outputs at whatever sampling rate. I also have an old laptop with ICH4, my office desktop which have ICH5, another laptop with ICH7, ... not counting the large number of other Linux machines I manage at work. I believe I can say to have seen quite some different hardware/software combinations. In some 10+ years of Linux system management I have had troubles with unsupported hardware, incomplete and/or broken drivers, etc, but have never experienced static noise or otherwise broken audio due to poor resampling using the default ALSA config. On the other end, your referenced blog says explicitely: http://blog.flameeyes.eu/tag/alsa/page/2 although I admit I haven’t tried it first hand, as I don’t have any hda-based soundcard beside the laptop who should I believe? my own experience or his 2nd hand rumors? ;-) Only once you've got the default config to work properly you may start experimenting with more sophisticated options. That sounds good, but what else can I try? what I'd do as a first step is trying to get your own distribution / installation / customizations out of the mix. So get some proven Live CD/DVD (NOT Gentoo-based!) and try with those. I'd try with Ubuntu 9.04, then perhaps Mandriva 2009, good old Knoppix, etc. Try to get systems with several different kernel/alsa version combinations, and report what happen... maybe it'll turn out that you'll have to file a bug report. OK, I'll try a Live CD. - Grant -- Crystal Reports - New Free Runtime and 30 Day Trial Check out the new simplified licensing option that enables unlimited royalty-free distribution of the report engine for externally facing server and web deployment. http://p.sf.net/sfu/businessobjects ___ Alsa-user mailing list Alsa-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/alsa-user
Re: [Alsa-user] Higher quality dmix resampling
So how come that you don't get 'em with mpd?! In mpd I specify oss instead of alsa. If I specify alsa and involve dmix, I get static in mpd too. you say OSS... but was that the real oss (does it still exist for modern kernels/hardware?!) or was it just the ALSA oss emulation? If it's the latter (as usually is on modern systems), then its just the input interface that changes, you're goin' trough ALSA anyway. Also, I should mention something that contradicts this. When I define a format for dmix in /etc/asound.conf that my DAC doesn't like, no ALSA apps will play sound. However, if I choose to output via OSS in those apps, I get sound. Here is an example of an asound.conf that causes apps set to ALSA to not play sound at all, and apps set to OSS to play sound perfectly as always: pcm.!default { type plug slave.pcm { type dmix ipc_key 1024 slave { pcm hw:0,0 format S24_LE rate 96000 } } } - Grant -- Crystal Reports - New Free Runtime and 30 Day Trial Check out the new simplified licensing option that enables unlimited royalty-free distribution of the report engine for externally facing server and web deployment. http://p.sf.net/sfu/businessobjects ___ Alsa-user mailing list Alsa-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/alsa-user
Re: [Alsa-user] Higher quality dmix resampling
On Saturday 16 May 2009, Grant wrote: If it's the latter (as usually is on modern systems), then its just the input interface that changes, you're goin' trough ALSA anyway. Also, I should mention something that contradicts this. When I define a format for dmix in /etc/asound.conf that my DAC doesn't like, no ALSA apps will play sound. However, if I choose to output via OSS in those apps, I get sound. Here is an example of an asound.conf that causes apps set to ALSA to not play sound at all, and apps set to OSS to play sound perfectly as always: well, that does only mean that the OSS-emulation interface does not obey asound.conf (and/or .asoundrc) rules but use some different general setup. This of course makes perfect sense, as OSS provided only a simple device file interface: there would be no reason for the emulated OSS interface to provide anything different... Thus, I would say that what this means is that the underlying low- level driver (at least in some conditions) does work, but either the default setup on your installation is somewhat screwed or the driver does not work properly in all possible modes (that is, yet another snd_hda* bug...). BTW, since I'm here I'm attaching the .asoundrc I'm using on my HTPC. I'm not 100% sure whether it's completely correct, but for sure playing to the default device (which goes to the on-board HDA) as well as to the HD192 HD176 does work perfectly. I'm also quite sure that indeed ALSA does obey the defaults.pcm.rate_converter setting (yes, also for the HDnnn resampling inputs to the Juli@). Removing all the (still experimental) parts used to distribute the signal to various outputs (I did that mainly for testing purpouses...) and the duplicate parts for different settings, all that matters is basically just this: # ~/.asoundrc defaults.pcm.rate_converter speexrate_best # Give our card(s) some friendly aliases. # pcm.Juli12 front:CARD=Juli,DEV=0 # # This is Julia channels 12 (analog stereo tapped I2S out) # device name front:CARD=Juli,DEV=0 obtained with aplay -L # Upsampling slave(s) # pcm.HD192 { type plug slave { pcm Juli12 format S32_LE rate 192000 } } # that's all To use the upsampled output, just use HD192 as the name for the alsa output device in applications (e.g. I always use that to play music on my main HiFi system with Amarok). If you want to try that, just replace Juli with the name of your target device and change rate format to whatever it can support. Yet again, should it work this way IMHO it does so by chance: the default MUST work just fine as well. That is, there must be a bug somewhere... Ciao, Paolo. -- Skype: Paolo.Saggese http://borex.lngs.infn.it/saggese You can still escape from the GATES of hell: Use Linux! #defaults.pcm.rate_converter lavcrate #defaults.pcm.rate_converter lavcrate_higher #defaults.pcm.rate_converter samplerate #defaults.pcm.rate_converter samplerate_best #defaults.pcm.rate_converter speexrate defaults.pcm.rate_converter speexrate_best # Give our cards some friendly aliases. # Intel HDA analog # pcm.hda default:CARD=Intel # Intel HDA digital # pcm.hdad iec958:CARD=Intel,DEV=0 # Julia channels 12 (analog tapped I2S out) # pcm.Juli12 front:CARD=Juli,DEV=0 # Julia channels 34 (optical out) # pcm.Juli34 iec958:CARD=Juli,DEV=0 # 'multi' plugin allows us to create many slave devices and then distribute # the stream's channels between the slaves. # # Here we define Slave a for Julia ch 12 (analog I2S) and Slave b for # HDA S/PDIF. Then we use channel binding to send channels 0 1 to the # Juli@ and channels 2 3 to the Intel HDA. # pcm.multi4 { type multi slaves.a { pcm Juli12 channels 2 } slaves.b { pcm hda channels 2 } bindings.0.slave a bindings.0.channel 0 bindings.1.slave a bindings.1.channel 1 bindings.2.slave b bindings.2.channel 0 bindings.3.slave b bindings.3.channel 1 } # Here we define Slave a for Julia ch 12 (analog I2S) # and Slave b for 34 (S/PDIF). # Then we use channel binding to send channels 0 1 to # analog/I2S and channels 2 3 to S/PDIF. # pcm.multi6 { type multi slaves.a { pcm Juli12 channels 2 } slaves.b { pcm Juli34 channels 2 } slaves.c { pcm hda channels 2 } bindings.0.slave a bindings.0.channel 0
Re: [Alsa-user] Higher quality dmix resampling
Le Thu, 14 May 2009 08:12:59 -0700, Grant emailgr...@gmail.com a écrit : (BTW: in Debian /etc/asound.conf does not even exists... are you sure your distribution is setup to use that file?) I'm using Gentoo and I know /etc/asound.conf works because defining dmix's sample rate there lights up the corresponding LED on the USB DAC. I tried moving the config to ~/.asoundrc with no change. On gentoo, /etc/asound.conf is for system wide configuration. As long that you are not running your sound related programs as root, it is much better to use ~/.asoundrc. With this last file, you don't have to restart alsa, it is enough to just restart your programs. Ciao, Dominique -- Crystal Reports - New Free Runtime and 30 Day Trial Check out the new simplified licensing option that enables unlimited royalty-free distribution of the report engine for externally facing server and web deployment. http://p.sf.net/sfu/businessobjects ___ Alsa-user mailing list Alsa-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/alsa-user
Re: [Alsa-user] Higher quality dmix resampling
On Thursday 14 May 2009, Grant wrote: I've tried S24_3LE, S24LE, S24_BE, S24_3BE, FLOAT_LE, and FLOAT_BE. None of them produce sound except for S24_3LE. S16_LE works, but stills suffers from the static problem. Is there another format I should try? try the U (unsigned) ones... i.e. U16_LE, U24_3LE, etc. BTW: what if you remove everything from asound.conf and just play to plughw:0,0 as per default? I did that by removing /etc/asound.conf and doing 'aplay file.wav', but it produces the same static problem. that's strange! So how come that you don't get 'em with mpd?! what is it using for output? I really think dmix is not using the specified samplerate or speexrate. again, I believe that your problem is completely unrelated to the resampling algorithm used. For the sake of curiosity I've tried them all and can guarantee you that all of them produces quite acceptable results. IME *none* of the ALSA resampling algorithms (not even the worst ones) ever produce any static (or other obvious nasty artifacts for that matter). The perceived sound quality may be different - and indeed it is if you have an audio system which is good enough to notice - but that's all. Your problem can NOT be due to a poor resampling algorithm: it must be a plain BUG somewhere! For the moment I urge you to forget about resampling algorithms and seek for the real source of your problems instead. Trying to keep things as simple as possible (that is, all defaults, no resampling) to make debugging easier. Only once you've got the default config to work properly you may start experimenting with more sophisticated options. Ciao, Paolo. -- Skype: Paolo.Saggese http://borex.lngs.infn.it/saggese You can still escape from the GATES of hell: Use Linux! -- Crystal Reports - New Free Runtime and 30 Day Trial Check out the new simplified licensing option that enables unlimited royalty-free distribution of the report engine for externally facing server and web deployment. http://p.sf.net/sfu/businessobjects ___ Alsa-user mailing list Alsa-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/alsa-user
Re: [Alsa-user] Higher quality dmix resampling
Nevertheless, I guess these static problem is not related to the resample algorithm you are using - unless the problem is related to insufficient system resources. What CPU do you have? I'm using an AMD64 Athlon 3.1ghz CPU. that one should have more than enough horsepower... (well, at least it is unless you're decoding some 1080p stream at the same time... 8:-) I was wondering if you were using some low-power/embedded system or the like. Clearly this is not the case. When I bypass dmix in mpd there is no static, and when I don't there is static, so I don't think it's performance related. surely it's not. (stupid question: do you really need dmix? 8-) I think I do. If I do this to disable dmix I get no sound: pcm.!default { type hw card 0 } ctl.!default { type hw card 0 } Again, what if you play directly to plughw:x,y with both /etc/asound.conf and ~/.asoundrc empty? Do you mean run 'aplay file.wav' with those files empty? I do get static from that. Oh, one more thing... it might be that the problem is that you are resampling in the wrong place. I remember I've got a problem *possibly* similar to your one (at least I've also got something similar to static like noise) when I tried to duplicate my output stream and send it to two different devices (sound cards) at the same time. Everything worked perfectly as far as I kept the output sample rate the same. As soon as I tried to upsample only one of the two streams (which unfortunately was exactly my ultimate goal), I got static. :-( (maybe there is a solution to that too, but I was short of time and just gave up trying). BTW: isn't it possible to tell dmix to run itself at some specific (e.g. 96K) sample rate? I've tried that like this with static: pcm.!default { type plug slave.pcm { type dmix ipc_key 1024 slave { pcm hw:0,0 format S24_3LE rate 96000 } } } - Grant May be the source of your problems can be the resampling done in the wrong place. Of course Dmix has to run at some fixed rate and resample all incoming streams to that rate anyway to do his own job. Thus, instead of writing any custom/special rule (which is quite an error-prone thing, unfortunately), likely you may simply use defaults and only give some options to dmix to tell it which sample rate (and algorithm) to use. Check the alsa docs for an option like default.rate, dmix.rate or such... there should be one. BTW: what if you disable (in the BIOS) and/or remove the alsa modules for your on-board sound card, if any? Perhaps you're incurring in a problem similar to mine: AFAIK there is only one dmix, thus in a sense you too are trying to feed two different cards at two different rates at once... :-? Ciao, Paolo. -- Crystal Reports - New Free Runtime and 30 Day Trial Check out the new simplified licensing option that enables unlimited royalty-free distribution of the report engine for externally facing server and web deployment. http://p.sf.net/sfu/businessobjects ___ Alsa-user mailing list Alsa-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/alsa-user
Re: [Alsa-user] Higher quality dmix resampling
(BTW: in Debian /etc/asound.conf does not even exists... are you sure your distribution is setup to use that file?) I'm using Gentoo and I know /etc/asound.conf works because defining dmix's sample rate there lights up the corresponding LED on the USB DAC. I tried moving the config to ~/.asoundrc with no change. On gentoo, /etc/asound.conf is for system wide configuration. As long that you are not running your sound related programs as root, it is much better to use ~/.asoundrc. With this last file, you don't have to restart alsa, it is enough to just restart your programs. Ciao, Dominique Thanks Dominique. Not restarting alsasound will be nice. - Grant -- Crystal Reports - New Free Runtime and 30 Day Trial Check out the new simplified licensing option that enables unlimited royalty-free distribution of the report engine for externally facing server and web deployment. http://p.sf.net/sfu/businessobjects ___ Alsa-user mailing list Alsa-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/alsa-user
Re: [Alsa-user] Higher quality dmix resampling
I've tried S24_3LE, S24LE, S24_BE, S24_3BE, FLOAT_LE, and FLOAT_BE. None of them produce sound except for S24_3LE. S16_LE works, but stills suffers from the static problem. Is there another format I should try? try the U (unsigned) ones... i.e. U16_LE, U24_3LE, etc. BTW: what if you remove everything from asound.conf and just play to plughw:0,0 as per default? I did that by removing /etc/asound.conf and doing 'aplay file.wav', but it produces the same static problem. that's strange! So how come that you don't get 'em with mpd?! In mpd I specify oss instead of alsa. If I specify alsa and involve dmix, I get static in mpd too. what is it using for output? I really think dmix is not using the specified samplerate or speexrate. again, I believe that your problem is completely unrelated to the resampling algorithm used. For the sake of curiosity I've tried them all and can guarantee you that all of them produces quite acceptable results. IME *none* of the ALSA resampling algorithms (not even the worst ones) ever produce any static (or other obvious nasty artifacts for that matter). Well, there is a blog post under A little hint for hda ALSA users which says: if you own an hda-based soundcard and you head crackling sound while playing mp3s or similar, the problem is probably due to the bad samplerate conversion from 44100 to 48000. http://blog.flameeyes.eu/tag/alsa/page/2 My DAC isn't hda but I think this demonstrates that dmix's default resampling algorithm can produce audible artifacts. He says switching dmix to the samplerate resampler fixes it, and I've defined that, but I'm not sure it's taking affect. The perceived sound quality may be different - and indeed it is if you have an audio system which is good enough to notice - but that's all. Your problem can NOT be due to a poor resampling algorithm: it must be a plain BUG somewhere! For the moment I urge you to forget about resampling algorithms and seek for the real source of your problems instead. Trying to keep things as simple as possible (that is, all defaults, no resampling) to make debugging easier. Only once you've got the default config to work properly you may start experimenting with more sophisticated options. That sounds good, but what else can I try? - Grant -- Crystal Reports - New Free Runtime and 30 Day Trial Check out the new simplified licensing option that enables unlimited royalty-free distribution of the report engine for externally facing server and web deployment. http://p.sf.net/sfu/businessobjects ___ Alsa-user mailing list Alsa-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/alsa-user
Re: [Alsa-user] Higher quality dmix resampling
On Wednesday 13 May 2009, Grant wrote: defaults.pcm.rate_converter speexrate_best in /etc/asound.conf and I restarted alsa, but I still have the static problem. what do you have in your ~/.asoundrc ? usually that's the best place to put your customizations. (BTW: in Debian /etc/asound.conf does not even exists... are you sure your distribution is setup to use that file?) Nevertheless, I guess these static problem is not related to the resample algorithm you are using - unless the problem is related to insufficient system resources. What CPU do you have? I say this 'cause e.g. with my old laptop (PIIIM 1.2GHz) basically I could not use anything better than the default. Trying just about any other algorithm caused problems such as underruns, skips, errors, etc. Assuming this is not your case, your static problem may be due to inappropriate sample rate and/or format of the data sent to the sound card. Are you sure that e.g. you are not trying to feed a 44.1KHz stream to a card which supports only 48KHz ? Ciao, Paolo. -- Skype: Paolo.Saggese http://borex.lngs.infn.it/saggese You can still escape from the GATES of hell: Use Linux! -- The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your production scanning environment may not be a perfect world - but thanks to Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700 Series Scanner you'll get full speed at 300 dpi even with all image processing features enabled. http://p.sf.net/sfu/kodak-com ___ Alsa-user mailing list Alsa-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/alsa-user
Re: [Alsa-user] Higher quality dmix resampling
I'm playing a video in miro and I get: # lsof|grep speex miro.real 9019 user mem REG 8,3 108992 28197654 /usr/lib64/libspeex.so.1.4.0 Does this mean dmix is using speex? If so, what else could be causing my static problem? I basically hear static whenever dmix is involved. If I have mpd resample with libsamplerate, I get no static. - Grant Yes, you are using speex. I don't think my defaults.pcm.rate_converter is being obeyed. I switched from speexrate_best to samplerate_best and also tried removing the definition entirely, but lsof still says whichever program is playing audio is opening the speex file and not the libsamplerate file. I also tried removing speex from the system and speex disappeared from lsof, but the static remained. I suggest first of all to temporarily leave 'miro' aside - it's a non-trivial piece of SW which might have its own quirks. I suggest to start from very basic 'aplay' with .wav files - just to make sure ALSA works OK. I can definitely confirm static with aplay .wav files that doesn't exist in mpd. If I don't have mpd bypass dmix I get static there too. Where should I go from here? # lsof|grep aplay [snip] - Grant Then, say, 'mplayer' with .flac, .mp3. You can try to increase ALSA buffers size, but I do not remember how to do this, though I remember it was easy. Regards, Sergei. Then start from very basic things: 1) choose direct HW output; 2) choose sample rate supported by HW - if necessary, resample your input file by high quality stand-alone resampler; 3) also take care of number of bits if necessary; 4) start playing with ALSA buffer size. For resampling/format conversion you can use 'ecasound' or 'sox'. Disclaimer: I am not an ALSA developer, so my recommendation are from end user point of view. Regards, Sergei. I added this to /etc/asound.conf: pcm.!default { type plug slave.pcm { type dmix ipc_key 1024 slave { pcm hw:0 format S24_3LE rate 96000 } } } I can see that it works because the 96k LED lights up on the DAC, but the static remains. I've also tried it in combination with: defaults.pcm.rate_converter samplerate_best I also tried various values of buffer_size and it caused some skipping but didn't affect the static at all. - Grant -- The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your production scanning environment may not be a perfect world - but thanks to Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700 Series Scanner you'll get full speed at 300 dpi even with all image processing features enabled. http://p.sf.net/sfu/kodak-com ___ Alsa-user mailing list Alsa-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/alsa-user
Re: [Alsa-user] Higher quality dmix resampling
defaults.pcm.rate_converter speexrate_best in /etc/asound.conf and I restarted alsa, but I still have the static problem. what do you have in your ~/.asoundrc ? usually that's the best place to put your customizations. (BTW: in Debian /etc/asound.conf does not even exists... are you sure your distribution is setup to use that file?) I'm using Gentoo and I know /etc/asound.conf works because defining dmix's sample rate there lights up the corresponding LED on the USB DAC. I tried moving the config to ~/.asoundrc with no change. Nevertheless, I guess these static problem is not related to the resample algorithm you are using - unless the problem is related to insufficient system resources. What CPU do you have? I'm using an AMD64 Athlon 3.1ghz CPU. When I bypass dmix in mpd there is no static, and when I don't there is static, so I don't think it's performance related. I say this 'cause e.g. with my old laptop (PIIIM 1.2GHz) basically I could not use anything better than the default. Trying just about any other algorithm caused problems such as underruns, skips, errors, etc. Assuming this is not your case, your static problem may be due to inappropriate sample rate and/or format of the data sent to the sound card. Are you sure that e.g. you are not trying to feed a 44.1KHz stream to a card which supports only 48KHz ? I'm sure. I've lit up all 4 frequency LEDs on the DAC and they all have static when dmix is involved. I still think the static problem is due to dmix's default resampling algorithm. I haven't seen any evidence that my defaults.pcm.rate_converter is being obeyed. With it set to samplerate_best I get the same 'lsof|grep aplay' output I posted before. There is no mention of libsamplerate or speex and there is static in the sound produced by aplay. - Grant -- The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your production scanning environment may not be a perfect world - but thanks to Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700 Series Scanner you'll get full speed at 300 dpi even with all image processing features enabled. http://p.sf.net/sfu/kodak-com ___ Alsa-user mailing list Alsa-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/alsa-user
Re: [Alsa-user] Higher quality dmix resampling
On Thursday 14 May 2009, Grant wrote: I added this to /etc/asound.conf: pcm.!default { type plug slave.pcm { type dmix ipc_key 1024 slave { pcm hw:0 format S24_3LE rate 96000 } } } are you sure S24_3LE is the proper format for your card? even if it is a 24-96 card, it may require something like U/S32_?? or FLOAT*_?? format. In principle trying to feed it with an unsupported format should cause an error, but who knows... BTW: what if you remove everything from asound.conf and just play to plughw:0,0 as per default? If that works, next step is trying to upsample but using the default plughw for output, that is something like this (*): pcm.up96k { type plug slave { pcm plughw:0,0 rate 96000 } } (*) N.B.: written on the fly. I am by no means an alsa/asoundrc expert, so... check the syntax! Ciao, Paolo. -- You can still escape from the GATES of hell: Use Linux! -- The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your production scanning environment may not be a perfect world - but thanks to Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700 Series Scanner you'll get full speed at 300 dpi even with all image processing features enabled. http://p.sf.net/sfu/kodak-com ___ Alsa-user mailing list Alsa-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/alsa-user
Re: [Alsa-user] Higher quality dmix resampling
On Thursday 14 May 2009, Grant wrote: Nevertheless, I guess these static problem is not related to the resample algorithm you are using - unless the problem is related to insufficient system resources. What CPU do you have? I'm using an AMD64 Athlon 3.1ghz CPU. that one should have more than enough horsepower... (well, at least it is unless you're decoding some 1080p stream at the same time... 8:-) I was wondering if you were using some low-power/embedded system or the like. Clearly this is not the case. When I bypass dmix in mpd there is no static, and when I don't there is static, so I don't think it's performance related. surely it's not. (stupid question: do you really need dmix? 8-) Again, what if you play directly to plughw:x,y with both /etc/asound.conf and ~/.asoundrc empty? Oh, one more thing... it might be that the problem is that you are resampling in the wrong place. I remember I've got a problem *possibly* similar to your one (at least I've also got something similar to static like noise) when I tried to duplicate my output stream and send it to two different devices (sound cards) at the same time. Everything worked perfectly as far as I kept the output sample rate the same. As soon as I tried to upsample only one of the two streams (which unfortunately was exactly my ultimate goal), I got static. :-( (maybe there is a solution to that too, but I was short of time and just gave up trying). BTW: isn't it possible to tell dmix to run itself at some specific (e.g. 96K) sample rate? May be the source of your problems can be the resampling done in the wrong place. Of course Dmix has to run at some fixed rate and resample all incoming streams to that rate anyway to do his own job. Thus, instead of writing any custom/special rule (which is quite an error-prone thing, unfortunately), likely you may simply use defaults and only give some options to dmix to tell it which sample rate (and algorithm) to use. Check the alsa docs for an option like default.rate, dmix.rate or such... there should be one. BTW: what if you disable (in the BIOS) and/or remove the alsa modules for your on-board sound card, if any? Perhaps you're incurring in a problem similar to mine: AFAIK there is only one dmix, thus in a sense you too are trying to feed two different cards at two different rates at once... :-? Ciao, Paolo. -- Skype: Paolo.Saggese http://borex.lngs.infn.it/saggese You can still escape from the GATES of hell: Use Linux! -- The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your production scanning environment may not be a perfect world - but thanks to Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700 Series Scanner you'll get full speed at 300 dpi even with all image processing features enabled. http://p.sf.net/sfu/kodak-com ___ Alsa-user mailing list Alsa-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/alsa-user
Re: [Alsa-user] Higher quality dmix resampling
At Tue, 12 May 2009 12:35:48 -0700, Grant wrote: I get a lot of static-like noise when dmix resamples audio with a USB DAC I'm trying out. When I have mpd resample internally with libsamplerate, it sounds perfect. Can I get dmix to use libsamplerate or disable dmix? One of the main programs I use with audio is miro which doesn't allow you to specify an audio ouput device. I tried this in /etc/asound.conf to disable dmix: pcm.!default { type hw card 0 } ctl.!default { type hw card 0 } You don't need this, but ... and tested with mplayer but that yielded no sound at all. I also tried this: defaults.pcm.rate_converter samplerate Add just this one. BTW, did you install alsa-plugins-pph or so? It's a resampler from speex, and it's usually much faster and good enough. Takashi -- The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your production scanning environment may not be a perfect world - but thanks to Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700 Series Scanner you'll get full speed at 300 dpi even with all image processing features enabled. http://p.sf.net/sfu/kodak-com ___ Alsa-user mailing list Alsa-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/alsa-user
Re: [Alsa-user] Higher quality dmix resampling
I get a lot of static-like noise when dmix resamples audio with a USB DAC I'm trying out. When I have mpd resample internally with libsamplerate, it sounds perfect. Can I get dmix to use libsamplerate or disable dmix? One of the main programs I use with audio is miro which doesn't allow you to specify an audio ouput device. I tried this in /etc/asound.conf to disable dmix: pcm.!default { type hw card 0 } ctl.!default { type hw card 0 } You don't need this, but ... and tested with mplayer but that yielded no sound at all. I also tried this: defaults.pcm.rate_converter samplerate Add just this one. BTW, did you install alsa-plugins-pph or so? It's a resampler from speex, and it's usually much faster and good enough. Takashi I've installed the alsa-plugins package on Gentoo which includes speex and libsamplerate and rebooted, but I can't seem to set defaults.pcm.rate_converter. My /etc/asound.conf file only contains that line and I don't have an .asoundrc. Even with: defaults.pcm.rate_converter samplerate_best I still get static and my CPU is idle. When I use samplerate_best in mpd my CPU is maxed. I've also tried samplerate, samplerate_medium, speex, and speex-float-3. Do you know why this setting isn't taking affect? - Grant -- The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your production scanning environment may not be a perfect world - but thanks to Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700 Series Scanner you'll get full speed at 300 dpi even with all image processing features enabled. http://p.sf.net/sfu/kodak-com ___ Alsa-user mailing list Alsa-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/alsa-user
Re: [Alsa-user] Higher quality dmix resampling
On Wednesday 13 May 2009, Takashi Iwai wrote: BTW, did you install alsa-plugins-pph or so? It's a resampler from speex, and it's usually much faster and good enough. upsampling to 24/192 (to an hi-end external DAC connected via I2S from a Juli@) IME speexrate_best actually sounds even better than samplerate_best (subjectively speaking I got smoother, less edgy, more natural sound). Of course YMMV. Ciao, Paolo. -- Skype: Paolo.Saggese http://borex.lngs.infn.it/saggese You can still escape from the GATES of hell: Use Linux! -- The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your production scanning environment may not be a perfect world - but thanks to Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700 Series Scanner you'll get full speed at 300 dpi even with all image processing features enabled. http://p.sf.net/sfu/kodak-com ___ Alsa-user mailing list Alsa-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/alsa-user
Re: [Alsa-user] Higher quality dmix resampling
BTW, did you install alsa-plugins-pph or so? It's a resampler from speex, and it's usually much faster and good enough. upsampling to 24/192 (to an hi-end external DAC connected via I2S from a Juli@) IME speexrate_best actually sounds even better than samplerate_best (subjectively speaking I got smoother, less edgy, more natural sound). Of course YMMV. Ciao, Paolo. Is there any way to tell which resampler dmix is using? I have: defaults.pcm.rate_converter speexrate_best in /etc/asound.conf and I restarted alsa, but I still have the static problem. - Grant -- The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your production scanning environment may not be a perfect world - but thanks to Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700 Series Scanner you'll get full speed at 300 dpi even with all image processing features enabled. http://p.sf.net/sfu/kodak-com ___ Alsa-user mailing list Alsa-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/alsa-user
Re: [Alsa-user] Higher quality dmix resampling
On Wed, 13 May 2009 12:40:39 -0700 Grant emailgr...@gmail.com wrote: BTW, did you install alsa-plugins-pph or so? It's a resampler from speex, and it's usually much faster and good enough. upsampling to 24/192 (to an hi-end external DAC connected via I2S from a Juli@) IME speexrate_best actually sounds even better than samplerate_best (subjectively speaking I got smoother, less edgy, more natural sound). Of course YMMV. Ciao, Paolo. Is there any way to tell which resampler dmix is using? I have: defaults.pcm.rate_converter speexrate_best in /etc/asound.conf and I restarted alsa, but I still have the static problem. - Grant Look at output of 'lsof'. Regards, Sergei. -- The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your production scanning environment may not be a perfect world - but thanks to Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700 Series Scanner you'll get full speed at 300 dpi even with all image processing features enabled. http://p.sf.net/sfu/kodak-com ___ Alsa-user mailing list Alsa-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/alsa-user
Re: [Alsa-user] Higher quality dmix resampling
BTW, did you install alsa-plugins-pph or so? It's a resampler from speex, and it's usually much faster and good enough. upsampling to 24/192 (to an hi-end external DAC connected via I2S from a Juli@) IME speexrate_best actually sounds even better than samplerate_best (subjectively speaking I got smoother, less edgy, more natural sound). Of course YMMV. Ciao, Paolo. Is there any way to tell which resampler dmix is using? I have: defaults.pcm.rate_converter speexrate_best in /etc/asound.conf and I restarted alsa, but I still have the static problem. - Grant Look at output of 'lsof'. Regards, Sergei. I'm playing a video in miro and I get: # lsof|grep speex miro.real 9019 user mem REG8,3108992 28197654 /usr/lib64/libspeex.so.1.4.0 Does this mean dmix is using speex? If so, what else could be causing my static problem? I basically hear static whenever dmix is involved. If I have mpd resample with libsamplerate, I get no static. - Grant -- The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your production scanning environment may not be a perfect world - but thanks to Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700 Series Scanner you'll get full speed at 300 dpi even with all image processing features enabled. http://p.sf.net/sfu/kodak-com ___ Alsa-user mailing list Alsa-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/alsa-user
Re: [Alsa-user] Higher quality dmix resampling
On Wed, 13 May 2009 14:46:26 -0700 Grant emailgr...@gmail.com wrote: I'm playing a video in miro and I get: # lsof|grep speex miro.real 9019 user mem REG8,3108992 28197654 /usr/lib64/libspeex.so.1.4.0 Does this mean dmix is using speex? If so, what else could be causing my static problem? I basically hear static whenever dmix is involved. If I have mpd resample with libsamplerate, I get no static. - Grant Yes, you are using speex. I suggest first of all to temporarily leave 'miro' aside - it's a non-trivial piece of SW which might have its own quirks. I suggest to start from very basic 'aplay' with .wav files - just to make sure ALSA works OK. Then, say, 'mplayer' with .flac, .mp3. You can try to increase ALSA buffers size, but I do not remember how to do this, though I remember it was easy. Regards, Sergei. -- The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your production scanning environment may not be a perfect world - but thanks to Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700 Series Scanner you'll get full speed at 300 dpi even with all image processing features enabled. http://p.sf.net/sfu/kodak-com ___ Alsa-user mailing list Alsa-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/alsa-user
Re: [Alsa-user] Higher quality dmix resampling
I'm playing a video in miro and I get: # lsof|grep speex miro.real 9019 user mem REG 8,3 108992 28197654 /usr/lib64/libspeex.so.1.4.0 Does this mean dmix is using speex? If so, what else could be causing my static problem? I basically hear static whenever dmix is involved. If I have mpd resample with libsamplerate, I get no static. - Grant Yes, you are using speex. I don't think my defaults.pcm.rate_converter is being obeyed. I switched from speexrate_best to samplerate_best and also tried removing the definition entirely, but lsof still says whichever program is playing audio is opening the speex file and not the libsamplerate file. I also tried removing speex from the system and speex disappeared from lsof, but the static remained. I suggest first of all to temporarily leave 'miro' aside - it's a non-trivial piece of SW which might have its own quirks. I suggest to start from very basic 'aplay' with .wav files - just to make sure ALSA works OK. I can definitely confirm static with aplay .wav files that doesn't exist in mpd. If I don't have mpd bypass dmix I get static there too. Where should I go from here? # lsof|grep aplay aplay 2734 marant cwd DIR8,3 4096 52765471 /home/user aplay 2734 marant rtd DIR8,3 4096 2 / aplay 2734 user txt REG8,353376 28837169 /usr/bin/aplay aplay 2734 user mem REG8,335656 29108038 /lib64/librt-2.9.so aplay 2734 user mem REG8,3 1383600 29108047 /lib64/libc-2.9.so aplay 2734 user mem REG8,3 137030 29107546 /lib64/libpthread-2.9.so aplay 2734 user mem REG8,314512 29108011 /lib64/libdl-2.9.so aplay 2734 user mem REG8,3 534648 29108000 /lib64/libm-2.9.so aplay 2734 user mem REG8,3 850624 30818799 /usr/lib64/libasound.so.2.0.0 aplay 2734 user mem REG8,3 123160 29108031 /lib64/ld-2.9.so aplay 2734 user DEL REG0,7 1998858 /SYSV0401 aplay 2734 user mem CHR 116,16 371 /dev/snd/pcmC0D0p aplay 2734 user DEL REG0,7 1966089 /SYSV0400 aplay 2734 user0u CHR 136,0 0t0 2 /dev/pts/0 aplay 2734 user1u CHR 136,0 0t0 2 /dev/pts/0 aplay 2734 user2u CHR 136,0 0t0 2 /dev/pts/0 aplay 2734 user3r CHR 116,33 0t0 866 /dev/snd/timer aplay 2734 user4u CHR 116,16 0t0 371 /dev/snd/pcmC0D0p aplay 2734 user5r REG8,3 86699108 39968801 /home/user/file.wav - Grant Then, say, 'mplayer' with .flac, .mp3. You can try to increase ALSA buffers size, but I do not remember how to do this, though I remember it was easy. Regards, Sergei. -- The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your production scanning environment may not be a perfect world - but thanks to Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700 Series Scanner you'll get full speed at 300 dpi even with all image processing features enabled. http://p.sf.net/sfu/kodak-com ___ Alsa-user mailing list Alsa-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/alsa-user
Re: [Alsa-user] Higher quality dmix resampling
On Wed, 13 May 2009 17:50:04 -0700 Grant emailgr...@gmail.com wrote: I'm playing a video in miro and I get: # lsof|grep speex miro.real 9019 user mem REG 8,3 108992 28197654 /usr/lib64/libspeex.so.1.4.0 Does this mean dmix is using speex? If so, what else could be causing my static problem? I basically hear static whenever dmix is involved. If I have mpd resample with libsamplerate, I get no static. - Grant Yes, you are using speex. I don't think my defaults.pcm.rate_converter is being obeyed. I switched from speexrate_best to samplerate_best and also tried removing the definition entirely, but lsof still says whichever program is playing audio is opening the speex file and not the libsamplerate file. I also tried removing speex from the system and speex disappeared from lsof, but the static remained. I suggest first of all to temporarily leave 'miro' aside - it's a non-trivial piece of SW which might have its own quirks. I suggest to start from very basic 'aplay' with .wav files - just to make sure ALSA works OK. I can definitely confirm static with aplay .wav files that doesn't exist in mpd. If I don't have mpd bypass dmix I get static there too. Where should I go from here? # lsof|grep aplay aplay 2734 marant cwd DIR8,3 4096 52765471 /home/user aplay 2734 marant rtd DIR8,3 4096 2 / aplay 2734 user txt REG8,353376 28837169 /usr/bin/aplay aplay 2734 user mem REG8,335656 29108038 /lib64/librt-2.9.so aplay 2734 user mem REG8,3 1383600 29108047 /lib64/libc-2.9.so aplay 2734 user mem REG8,3 137030 29107546 /lib64/libpthread-2.9.so aplay 2734 user mem REG8,314512 29108011 /lib64/libdl-2.9.so aplay 2734 user mem REG8,3 534648 29108000 /lib64/libm-2.9.so aplay 2734 user mem REG8,3 850624 30818799 /usr/lib64/libasound.so.2.0.0 aplay 2734 user mem REG8,3 123160 29108031 /lib64/ld-2.9.so aplay 2734 user DEL REG0,7 1998858 /SYSV0401 aplay 2734 user mem CHR 116,16 371 /dev/snd/pcmC0D0p aplay 2734 user DEL REG0,7 1966089 /SYSV0400 aplay 2734 user0u CHR 136,0 0t0 2 /dev/pts/0 aplay 2734 user1u CHR 136,0 0t0 2 /dev/pts/0 aplay 2734 user2u CHR 136,0 0t0 2 /dev/pts/0 aplay 2734 user3r CHR 116,33 0t0 866 /dev/snd/timer aplay 2734 user4u CHR 116,16 0t0 371 /dev/snd/pcmC0D0p aplay 2734 user5r REG8,3 86699108 39968801 /home/user/file.wav - Grant Then, say, 'mplayer' with .flac, .mp3. You can try to increase ALSA buffers size, but I do not remember how to do this, though I remember it was easy. Regards, Sergei. Then start from very basic things: 1) choose direct HW output; 2) choose sample rate supported by HW - if necessary, resample your input file by high quality stand-alone resampler; 3) also take care of number of bits if necessary; 4) start playing with ALSA buffer size. For resampling/format conversion you can use 'ecasound' or 'sox'. Disclaimer: I am not an ALSA developer, so my recommendation are from end user point of view. Regards, Sergei. -- The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your production scanning environment may not be a perfect world - but thanks to Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700 Series Scanner you'll get full speed at 300 dpi even with all image processing features enabled. http://p.sf.net/sfu/kodak-com ___ Alsa-user mailing list Alsa-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/alsa-user