Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Audiophile 2496: resampling problem with ALSA [solved]
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
cyberpatrol
Apprentice
Apprentice


Joined: 18 Sep 2003
Posts: 161
Location: Germany

PostPosted: Fri Jul 06, 2007 3:04 pm    Post subject: Audiophile 2496: resampling problem with ALSA [solved] Reply with quote

Hi,

I've got an M-Audio Audiophile 2496 (ice1712) since a few weeks. When I installed this card everything was ok. I played a bit with envy24control, alsamixer, /etc/asound.conf, set the volumes, didn't lock the sample rate etc.

The first time every sound file was played with its own sample rate without resampling. If I played a file which was recorded at 44.1 kHz with e.g. Audacious or MOC the Actual Rate in envy24control showed 44100 and if I played a file which was recorded at 48 kHz the Actual Rate in envy24control showed 48000.

Everything incl. dmix worked perfectly without an ~/.asoundrc or /etc/asound.conf which doesn't seem to be necessary anymore as the ALSA documentation or the ebuild - I can't remember which one - tells.

Since a while, after playing a bit more with the envy24control, alsamixer and the file /etc/asound.conf where I always reset the settings to the working ones and after one or two `emerge -uDN world`, I'm having a big problem.

Now everything is played and recorded at 48 kHz, at least the Actual Rate in envy24control always switches to 48000, doesn't matter with which sample rate the file is recorded and to which rate I set the Master Clock. If I lock the rate to the file's sample rate the sound is played slower or faster and pitched depending on the file's and the locked sample rate. Btw., locking the sample rate wasn't an option anyway because I want a file to be played automatically in it's original sample rate without changing the sample rate for every file manually.

The Rate State option Reset in envy24control doesn't help either. Neither did help uninstalling every ALSA package, deleting the ALSA configfiles and remerging ALSA.

If I choose OSS as the output plugin in e.g. Audacious and MOC and therefore use the ALSA OSS plugin the files are played again in their original sample rate and the Actual Rate in envy24control changes to the particular sample rate as it is expected. But I have the impression that the sound quality with ALSA OSS plugin is worse than with the native ALSA.

And Audacious and MOC always show the original sample rates of the files. So I think that this is not a problem with the audio players but with ALSA.

I hope someone can help me and tell me how to fix this problem. Or should I file a bug report about this?

I'm actually using this software:

sys-kernel/gentoo-sources-2.6.21-r3
media-sound/alsa-headers-1.0.14
media-libs/alsa-lib-1.0.14a-r1
media-sound/alsa-utils-1.0.14
media-sound/alsa-tools-1.0.14
media-sound/audacious-1.3.2
media-sound/audacious-plugins-1.3.5
media-sound/moc-2.4.2

I'm of course using the in-kernel driver ice1712.


Last edited by cyberpatrol on Sat Jul 07, 2007 7:00 am; edited 1 time in total
Back to top
View user's profile Send private message
gimpel
Advocate
Advocate


Joined: 15 Oct 2004
Posts: 2720
Location: Munich, Bavaria

PostPosted: Fri Jul 06, 2007 5:54 pm    Post subject: Re: Audiophile 2496: resampling problem with ALSA Reply with quote

cyberpatrol wrote:
Now everything is played and recorded at 48 kHz, at least the Actual Rate in envy24control always switches to 48000, doesn't matter with which sample rate the file is recorded and to which rate I set the Master Clock. If I lock the rate to the file's sample rate the sound is played slower or faster and pitched depending on the file's and the locked sample rate. Btw., locking the sample rate wasn't an option anyway because I want a file to be played automatically in it's original sample rate without changing the sample rate for every file manually.


Same here. I only _guess_ that when using "default" device in the player, which means dmix, it gets reset to 48kHz, as dmix uses this internally.

Didn't try yet, but maybe setting hw:0 in the player lets the card itself do the conversion again? (This kills dmix, of course)
_________________
http://proaudio.tuxfamily.org/wiki - pro-audio software overlay
Back to top
View user's profile Send private message
cyberpatrol
Apprentice
Apprentice


Joined: 18 Sep 2003
Posts: 161
Location: Germany

PostPosted: Sat Jul 07, 2007 3:28 am    Post subject: Re: Audiophile 2496: resampling problem with ALSA Reply with quote

gimpel wrote:
Same here. I only _guess_ that when using "default" device in the player, which means dmix, it gets reset to 48kHz, as dmix uses this internally.


Is this behaviour new or is it a bug? Because in the first few weeks - I bought and installed the card about a month ago - it worked with the "default" device, so with dmix, and with the dynamic sample rate. At least I could hear the sound of two programs (Audacious and the KDE system sounds) at the same time and the sound was played with the original sample rate. Only since about a week everything is resampled to 48 kHz.

gimpel wrote:
Didn't try yet, but maybe setting hw:0 in the player lets the card itself do the conversion again? (This kills dmix, of course)


Thanks, gimpel. This works and kills dmix. But instead of hw:0 the device must be plughw:0,0 otherwise the players can't find the card. But the sound seems to be much better than with OSS and as well as it was in the first few weeks. Nevertheless I don't know if this shouldn't also work with the "default" device and dmix.
Back to top
View user's profile Send private message
gimpel
Advocate
Advocate


Joined: 15 Oct 2004
Posts: 2720
Location: Munich, Bavaria

PostPosted: Sat Jul 07, 2007 5:39 am    Post subject: Re: Audiophile 2496: resampling problem with ALSA Reply with quote

cyberpatrol wrote:
Is this behaviour new or is it a bug?
Yeah this was introduced with the latest alsa-lib, I guess. Not sure if it is a bug or a feature.
But it makes sense to reset it, as dmix resamples to 48kHz internally anyway, so doing it again in hardware makes no sense.

And if you want high quality sound, it's better to use jackd or hw directly anyway, not routed through a software mixer.
_________________
http://proaudio.tuxfamily.org/wiki - pro-audio software overlay
Back to top
View user's profile Send private message
cyberpatrol
Apprentice
Apprentice


Joined: 18 Sep 2003
Posts: 161
Location: Germany

PostPosted: Sat Jul 07, 2007 6:59 am    Post subject: Re: Audiophile 2496: resampling problem with ALSA Reply with quote

gimpel wrote:
Yeah this was introduced with the latest alsa-lib, I guess. Not sure if it is a bug or a feature.
But it makes sense to reset it, as dmix resamples to 48kHz internally anyway, so doing it again in hardware makes no sense.


Well, I have to admit that this makes sense. Didn't know much about dmix and the internal resampling. I just thought about dmix as a replacement for the hardware mixing of my old SB Live 5.1.

gimpel wrote:
And if you want high quality sound, it's better to use jackd or hw directly anyway, not routed through a software mixer.


Generally you're completely right and usually I don't need to listen to sounds from more than one source at the same time but sometimes it can be useful. But I guess in these few cases I can switch from plughw:0,0 to default in the players and live with the 48 kHz resampling.

As said above I'm one of those people who replaced their SB Live 5.1 by the Audiophile 2496. So I guess I still have to accustom myself to it a bit.

Thanks for the infos, gimpel!
Back to top
View user's profile Send private message
Akkara
Bodhisattva
Bodhisattva


Joined: 28 Mar 2006
Posts: 6702
Location: &akkara

PostPosted: Sat Jul 07, 2007 8:18 am    Post subject: Reply with quote

Thanks for asking this question!

I have the same audio card and I had noticed a change a while back as well but wasn't sure how to describe it.

One day when I was testing with tones around 15KHz or so, and they had all sorts of weird artifacts where I didn't recall having heard them before. The artifacts weren't there when I tried burning the tones to a CD and playing that on a regular CD player.

I suspected that it might have been related to sampling rate when I noticed that envy24mixer was showing 48KHz when it used to always show whatever sampling rate the song was recorded with. Even my 96KHz stuff was being played at 48K. Perhaps the artifacts I was hearing was related to the resampling. They are especially prominent at 19KHz.

(Aside: For something like dmix, it'd be good to have an option (maybe even the default option) that sets the sampling rate to whatever sound is about to be played. If a second sound then comes up needing mixing, that second sound is resampled, if needed, to the already playing sound's sampling rate. Since most of the time only one sound at a time is playing, this means that most of the time no resampling will take place.)
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