You are not logged in.

#1 2013-05-15 18:47:45

halfgaar
Member
Registered: 2010-05-22
Posts: 50

HD audio playback on Asus Xonar DX (AV200 chip)

I just installed my new Asus Xonar DX (AV200 chip). First thing I'd like to try is playing back HD audio. But when I use mplayer to do so, it says this:

==========================================================================
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
libavcodec version 54.71.100 (internal)
AUDIO: 96000 Hz, 2 ch, s32le, 0.1 kbit/0.00% (ratio: 16->768000)
Selected audio codec: [ffflac] afm: ffmpeg (FFmpeg FLAC audio)
==========================================================================
[AO OSS] audio_setup: Can't open audio device /dev/dsp: No such file or directory
AO: [alsa] 48000Hz 2ch s32le (4 bytes per sample)
Video: no video
Starting playback...

So why doesn't it play at 96000 Hz?

I use Alsa, no dmix, pulse or anything.

Last edited by halfgaar (2013-05-15 18:51:00)

Offline

#2 2013-05-15 20:42:52

mich41
Member
Registered: 2012-06-22
Posts: 796

Re: HD audio playback on Asus Xonar DX (AV200 chip)

Because dmix (an ALSA plugin which mixes sound from various applications) runs at 48kHz by default.

Nevermind, just read your edit. Are you really sure you don't have dmix enabled? What makes you think so?

I'd try one of these:

Add the following to ~/.asoundrc or /etc/asoundrc (for all users):

defaults.pcm.dmix.rate 44100  # change to whatever rate you want

Add this to ~/.mplayer/config to tell mplayer to play directly to the hardware (nothing else will be able to play sound at the same time):

ao=alsa:device=hw=0

Last edited by mich41 (2013-05-15 20:51:22)

Offline

#3 2013-05-15 21:55:31

halfgaar
Member
Registered: 2010-05-22
Posts: 50

Re: HD audio playback on Asus Xonar DX (AV200 chip)

Hmm, dmix is on by default, it would seem. I thought I didn't have dmix because:

  • I never needed to enable it before because I had an Audigy 2 card, which does internal resampling and hardware mixing, and I just plugged in my new Xonar DX.

  • I don't have anything about it in my asound.conf(s) or mplayer.conf

  • I couldn't play mplayer and audacious at the same time.

However:

  • I just found out that I can play two mplayers at the same time, so mplayer does use dmix, without me telling it to.

  • setting the dmix.rate actually does change at what rate mplayer plays.

This is weird to me.

The only thing I have in asound.conf are some jack things (which I don't use, actually):

ctl.jack40 {
     type hw
     card 0
}

pcm.jack40 {
     # "asym" allows for different
     # handling of in/out devices
     type asym
     playback.pcm {
          # route for mmap workaround
          type route
          slave.pcm surround40
          slave.channels 4
          ttable.0.0 1
          ttable.1.1 1
          ttable.2.2 1
          ttable.3.3 1
     }
     capture.pcm {
          # 2 channels only
          type hw
          card 0
     }
}

I want to make absolutely sure there is no resampling going on with any sound source (not just mplayer). So, either I don't have dmix at all and I have to accept that I can only play one sound source at a time, or dmix (or maybe Pulse?) should be smart and only resample when it's necessary.

How about those resampling algorithms? Are they smart enough not to resample when it's not necessary? Everybody always bashes Creative cards for always resampling, but now that we have cards that don't do it, and therefore lack the ability to hardware-mix, it would defeat the purpose if then the software does it all the time anyway.

edit: I found this here:

NOTE: For ALSA 1.0.9rc2 and higher you don't need to setup dmix for analogue output. Dmix is enabled by default for soundcards which don't support hardware mixing. You still need to set it up for digital outputs.

I guess it is on, but not fully, since mplayer can't play when I play music with Audacious.

And I think it's bizar it resamples to 48k, since it's a 192k card.

Last edited by halfgaar (2013-05-15 22:02:56)

Offline

#4 2013-05-15 22:05:26

mich41
Member
Registered: 2012-06-22
Posts: 796

Re: HD audio playback on Asus Xonar DX (AV200 chip)

It's the default output plugin on cards without hardware mixer and all programs use it unless configured otherwise. Apparently you've set audacious to play directly to the hardware.

I want to make absolutely sure there is no resampling going on with any sound source (not just mplayer). So, either I don't have dmix at all and I have to accept that I can only play one sound source at a time, or dmix (or maybe Pulse?) should be smart and only resample when it's necessary.

To disable any processing in all applications, override the default pcm in asoundrc:

pcm.default "hw:0"

As for dmix, it always resamples to defaults.pcm.dmix.rate. Any "smart" resampling would be problematic because all sources have to be resampled to the same frequency and sources appear and disappear at unpredictable times with unpredictable output formats. And you can't switch rate during playback (not without glitches, at least).

Last edited by mich41 (2013-05-15 22:13:15)

Offline

#5 2013-05-15 22:12:49

halfgaar
Member
Registered: 2010-05-22
Posts: 50

Re: HD audio playback on Asus Xonar DX (AV200 chip)

Setting the default worked. Audacious was set to 'default' BTW, no specific device selected.

I do wonder, though. How many users of this card think they play HD audio but actually don't... Perhaps I should take this up on the Alsa mailing list.

Offline

Board footer

Powered by FluxBB