Re: [Alsa-user] "plug" refuses to play audio at normal sample rates
> Well, as far as I know LADSPA - it's very difficult, if not impossible, > to not detect sample rate correctly. > > Did you look into the plugin source ? I've had a look through it, but I can't see where the code is that does sample rate conversion. > Can it be that ALSA calls the plugin initialization routine with > wrong sample rate ? > > Can it be that ALSA calls the plugin initialization routine only once > and not on each sample rate change ? Since it works properly with unusual sampling rates (like 60kHz) I don't think it's an ALSA issue. It only fails when using a sampling rate directly supported by the underlying hardware - in that case it still needs to do resampling, but for whatever reason the audio is *not* resampled and playback fails. At some point there is a sample rate check, and instead of checking what sample rates the next *plugin* in the chain supports, the code incorrectly checks what sampling rates the *hardware* supports. The hardware supports four different sample rates, the plugin only supports one - so sometimes the audio isn't being resampled when it should be. Cheers, Adam. - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace ___ Alsa-user mailing list Alsa-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/alsa-user
Re: [Alsa-user] "plug" refuses to play audio at normal sample rates
On Mon, 07 Jan 2008 09:42:28 +1000 Adam Nielsen <[EMAIL PROTECTED]> wrote: > > Try removing the EQ from the chain. If that does not work revert to > > the default ALSA config files. > > That's interesting. If I remove the EQ then everything works as > expected. The bug must be in the LADSPA plugin - not detecting sample > rates correctly. > Well, as far as I know LADSPA - it's very difficult, if not impossible, to not detect sample rate correctly. Did you look into the plugin source ? Can it be that ALSA calls the plugin initialization routine with wrong sample rate ? Can it be that ALSA calls the plugin initialization routine only once and not on each sample rate change ? Regards, Sergei. - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Alsa-user mailing list Alsa-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/alsa-user
Re: [Alsa-user] "plug" refuses to play audio at normal sample rates
On Jan 5, 2008 9:08 PM, Adam Nielsen <[EMAIL PROTECTED]> wrote: > > /etc/asound.conf is below. > Try removing the EQ from the chain. If that does not work revert to the default ALSA config files. Lee - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Alsa-user mailing list Alsa-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/alsa-user
Re: [Alsa-user] "plug" refuses to play audio at normal sample rates
> Try removing the EQ from the chain. If that does not work revert to > the default ALSA config files. That's interesting. If I remove the EQ then everything works as expected. The bug must be in the LADSPA plugin - not detecting sample rates correctly. If I revert to the default ALSA config then I can only open ALSA devices at 48kHz (the dmix freq) so like this *all* sample rates are converted to 48k. Cheers, Adam. - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Alsa-user mailing list Alsa-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/alsa-user
Re: [Alsa-user] "plug" refuses to play audio at normal sample rates
>> As soon as I enable dmix, I can't play audio at certain >> sampling rates. > > What about if you run Jack at 192khtz then all other > sample rates would be upsampled to 192k (I presume) > and therefor all play back at the same time. I haven't tried Jack, I'll have to look into it - but with the current config everything *is* upsampled to 192kHz, except 48kHz and 96kHz. 48.1kHz is fine, as is 95.9kHz, just those precise frequencies that are natively supported by my card aren't upsampled, leading me to believe there's a bug in the samplerate conversion code somewhere. Cheers, Adam. - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Alsa-user mailing list Alsa-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/alsa-user
Re: [Alsa-user] "plug" refuses to play audio at normal sample rates
On Sunday 06 January 2008 12:59:28 Adam Nielsen wrote: > > I would like to be able to play 48k, 96k *and* 192k > > at the same time! I have ALC883: > > ... > > All DACs support 44.1k/48k/96k/192kHz sample rate > > All ADCs support 44.1k/48k/96kHz sample rate > > Oh the hardware is capable of playing those sample rates, > but dmix doesn't seem to be able to mix those rates together. > ... > As soon as I enable dmix, I can't play audio at certain > sampling rates. What about if you run Jack at 192khtz then all other sample rates would be upsampled to 192k (I presume) and therefor all play back at the same time. --markc - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Alsa-user mailing list Alsa-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/alsa-user
Re: [Alsa-user] "plug" refuses to play audio at normal sample rates
>> I would like to be able to play 48k, 96k *and* 192k at the same time! > I have ALC883: > > http://www.realtek.com.tw/products/productsView.aspx?Langid=1&PFid=28&Level=5&Conn=4&ProdID=44 > : > > " > ... > All DACs support 44.1k/48k/96k/192kHz sample rate > All ADCs support 44.1k/48k/96kHz sample rate > ... > ". > > So, I am sure that HW supports these rates to the extent I can be > sure Realtek is not cheating on the above page. Oh the hardware is capable of playing those sample rates, but dmix doesn't seem to be able to mix those rates together. If I remove dmix then I can play any sample rate without any problems, but of course I can only play one sound at a time. As soon as I enable dmix, I can't play audio at certain sampling rates. Cheers, Adam. (sorry, forgot to CC the list) - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Alsa-user mailing list Alsa-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/alsa-user
Re: [Alsa-user] "plug" refuses to play audio at normal sample rates
On Sun, 06 Jan 2008 12:42:24 +1000 Adam Nielsen <[EMAIL PROTECTED]> wrote: > Hi Sergei, > > > Well, I managed to change sample rate by editing as root my > > > > /usr/share/alsa/alsa.conf > > > > file, this line in it: > > > > defaults.pcm.dmix_rate 48000 > > Yes, I have added that line to /etc/asound.conf and it overrides the > main one. The problem is, if I set it to 48000 then I can play 48kHz > audio, but not 96kHz or 192kHz. If I set to to 96000 then I can play > 96kHz audio but not 48k or 192k. If I set it to 192000 then I can play > 192k but not 48k or 96k. > > I would like to be able to play 48k, 96k *and* 192k at the same time! > > Whatever it is set to, I can always play "unusual" rates like 49kHz, > 50kHz, 51kHz, etc. > > > The fact that HDA_INTEL cards mixers do not have sample rate control > > is a bug IMO - because, say, M-Audio Revolution mixer _does_ have > > such a mixer control. > > Are you sure this isn't just a limitation of the hardware? I know this > used to work fine on my old SB Audigy, but I didn't have to use dmix on > that because the hardware supported mixing. > > Cheers, > Adam. > > - > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2005. > http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ > ___ > Alsa-user mailing list > Alsa-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/alsa-user > I have ALC883: http://www.realtek.com.tw/products/productsView.aspx?Langid=1&PFid=28&Level=5&Conn=4&ProdID=44 : " ... All DACs support 44.1k/48k/96k/192kHz sample rate All ADCs support 44.1k/48k/96kHz sample rate ... ". So, I am sure that HW supports these rates to the extent I can be sure Realtek is not cheating on the above page. Regards, Sergei. - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Alsa-user mailing list Alsa-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/alsa-user
Re: [Alsa-user] "plug" refuses to play audio at normal sample rates
Hi Sergei, > Well, I managed to change sample rate by editing as root my > > /usr/share/alsa/alsa.conf > > file, this line in it: > > defaults.pcm.dmix_rate 48000 Yes, I have added that line to /etc/asound.conf and it overrides the main one. The problem is, if I set it to 48000 then I can play 48kHz audio, but not 96kHz or 192kHz. If I set to to 96000 then I can play 96kHz audio but not 48k or 192k. If I set it to 192000 then I can play 192k but not 48k or 96k. I would like to be able to play 48k, 96k *and* 192k at the same time! Whatever it is set to, I can always play "unusual" rates like 49kHz, 50kHz, 51kHz, etc. > The fact that HDA_INTEL cards mixers do not have sample rate control > is a bug IMO - because, say, M-Audio Revolution mixer _does_ have > such a mixer control. Are you sure this isn't just a limitation of the hardware? I know this used to work fine on my old SB Audigy, but I didn't have to use dmix on that because the hardware supported mixing. Cheers, Adam. - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Alsa-user mailing list Alsa-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/alsa-user
Re: [Alsa-user] "plug" refuses to play audio at normal sample rates
On Sun, 06 Jan 2008 12:08:40 +1000 Adam Nielsen <[EMAIL PROTECTED]> wrote: > Hi everyone, > > I'm having quite a bit of trouble trying to get dmix working with a > LADSPA EQ plugin. I think I've narrowed it down to "plug" incorrectly > detecting sample rates. > > For example, my sound card (Intel HDA) can play audio at 48000, 96000 > and 192000 Hz. When dmix is set to mix at 48000, I can play audio at > 48kHz, as well as other rates my sound card doesn't natively support, > e.g. 88.2kHz, 100kHz, etc. If I try to play audio at a frequency my > card *does* support (e.g. 96kHz), ALSA bombs out with an "Invalid > argument" error. > > If I change the dmix rate, e.g. to 192000 which I would like, then I am > able to play audio at 192kHz, but not 48kHz or 96kHz (I can play audio > at 50kHz and 100kHz though.) > > To me it seems that something in the chain is looking to see what sample > rates my sound card is capable of playing, and not bothering to convert > audio being played at those sample rates. Unfortunately something in > the chain (dmix?) only supports one sample rate, so when the sample rate > isn't being converted, playback fails. > > In other words, when I try to play 96kHz audio ALSA sees my card can > play 96kHz audio, so it passes it through unchanged to dmix, which then > barfs because it only accepts 48kHz audio. If I play 100kHz audio > instead, ALSA sees my card isn't capable of playing that, so it checks > to see what rates are supported, dmix returns that only 48kHz is > allowed, so ALSA down converts the audio to 48kHz where it plays without > any problems. > > Is there any way to override this behaviour so I can have all audio > streams dmixed, even those that have a sample rate natively supported by > my sound card? > > /etc/asound.conf is below. > > Thanks, > Adam. > > > ## Begin ALSA config ## > > defaults.pcm.dmix.rate 192000 > > > > pcm.eq { > > > type ladspa > > > > slave.pcm "plug:dmix" > > > > plugins [ > > > { > > > id 1197 > > > input { > > >controls [ -5 -5 -5 -5 -5 -10 -20 -15 -10 -10 -10 -10 -10 -3 -2 ] > > > } > > > } > > > ] > } > > pcm.!default > > > { > > > type plug > > > slave.pcm "eq" > > > } > > ## End ALSA config ## > > - > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2005. > http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ > ___ > Alsa-user mailing list > Alsa-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/alsa-user > Well, I managed to change sample rate by editing as root my /usr/share/alsa/alsa.conf file, this line in it: defaults.pcm.dmix_rate 48000 . The fact that HDA_INTEL cards mixers do not have sample rate control is a bug IMO - because, say, M-Audio Revolution mixer _does_ have such a mixer control. I haven't yet had time to file the bug, but I'm getting closer ... Regards, Sergei. - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Alsa-user mailing list Alsa-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/alsa-user
[Alsa-user] "plug" refuses to play audio at normal sample rates
Hi everyone, I'm having quite a bit of trouble trying to get dmix working with a LADSPA EQ plugin. I think I've narrowed it down to "plug" incorrectly detecting sample rates. For example, my sound card (Intel HDA) can play audio at 48000, 96000 and 192000 Hz. When dmix is set to mix at 48000, I can play audio at 48kHz, as well as other rates my sound card doesn't natively support, e.g. 88.2kHz, 100kHz, etc. If I try to play audio at a frequency my card *does* support (e.g. 96kHz), ALSA bombs out with an "Invalid argument" error. If I change the dmix rate, e.g. to 192000 which I would like, then I am able to play audio at 192kHz, but not 48kHz or 96kHz (I can play audio at 50kHz and 100kHz though.) To me it seems that something in the chain is looking to see what sample rates my sound card is capable of playing, and not bothering to convert audio being played at those sample rates. Unfortunately something in the chain (dmix?) only supports one sample rate, so when the sample rate isn't being converted, playback fails. In other words, when I try to play 96kHz audio ALSA sees my card can play 96kHz audio, so it passes it through unchanged to dmix, which then barfs because it only accepts 48kHz audio. If I play 100kHz audio instead, ALSA sees my card isn't capable of playing that, so it checks to see what rates are supported, dmix returns that only 48kHz is allowed, so ALSA down converts the audio to 48kHz where it plays without any problems. Is there any way to override this behaviour so I can have all audio streams dmixed, even those that have a sample rate natively supported by my sound card? /etc/asound.conf is below. Thanks, Adam. ## Begin ALSA config ## defaults.pcm.dmix.rate 192000 pcm.eq { type ladspa slave.pcm "plug:dmix" plugins [ { id 1197 input { controls [ -5 -5 -5 -5 -5 -10 -20 -15 -10 -10 -10 -10 -10 -3 -2 ] } } ] } pcm.!default { type plug slave.pcm "eq" } ## End ALSA config ## - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Alsa-user mailing list Alsa-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/alsa-user