alsa dmix via82xx limitations? - Linux

This is a discussion on alsa dmix via82xx limitations? - Linux ; So I think I've got this correctly. But I can't seem to have armagetron play sound while another sound application is using the device. I can however have mplayer play a .flac, while xmms plays a cd while using the ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: alsa dmix via82xx limitations?

  1. alsa dmix via82xx limitations?

    So I think I've got this correctly. But I can't seem to have armagetron
    play sound while another sound application is using the device. I can
    however have mplayer play a .flac, while xmms plays a cd while using the
    cdread plugin to read it digitally, which used to lock the pcm device. So
    dmix seems to be working to some limited extent.

    Is there a dmixdsp app? like artsdsp -m or esddsp -m wrappers
    to get armagetron to share sound without using another wrapper. Using
    esddsp causes roughly a full second lag in the sound. Which can be
    annoying when trying to play a game.

    I'm on a 800MHz duron laptop. I get 302fps in glxgears using the mach64
    dri module on xorg 6.8.2. /proc/cpuinfo says 1595.80 bogomips.

    Machine: sony vaio pcg-fx215
    Distro: debian (sid)
    Kernel: 2.4.29
    Alsa: 1.0.8
    Card: via82xx - VIA VT82C686 AC97 Audio Controller (rev 20)
    Vendorevice: 1106:3058

    -----

    /etc/modules.conf (alsa extract)
    #--- ALSA ---#
    alias char-major-116 snd
    alias snd-card-0 snd-via82xx
    #--- OSS ---#
    alias char-major-14 soundcore
    alias sound-slot-0 snd-card-0
    #--- ALSA - CARD ---#
    options snd cards_limit=1
    #--- ALSA - OSS ---#
    alias sound-service-0-0 snd-mixer-oss
    alias sound-service-0-1 snd-seq-oss
    alias sound-service-0-3 snd-pcm-oss
    alias sound-service-0-8 snd-seq-oss
    alias sound-service-0-12 snd-pcm-oss
    #--- ALSA - /dev (OSS) ---#
    alias /dev/sequencer* snd-seq-oss
    alias /dev/dsp* snd-pcm-oss
    alias /dev/mixer* snd-mixer-oss
    alias /dev/midi* snd-seq-oss

    -----

    /etc/asound.conf
    pcm.dmixer {
    type dmix
    ipc_key 1024
    ipc_key_add_uid true
    slave {
    pcm "hw:0,0"
    period_time 0
    period_size 1024
    buffer_size 8192
    rate 44100
    }
    bindings {
    0 0
    1 1
    }
    }

    pcm.asymed {
    type asym
    playback.pcm "dmixer"
    capture.pcm "hw:0,0"
    }

    pcm.dsp0 { type plug slave.pcm "asymed" }
    pcm.!default { type plug slave.pcm "asymed" }
    pcm.default { type plug slave.pcm "asymed" }
    ctl.mixer0 { type hw card 0 }

    -----

    jackd seems to favor 44100 as the rate and 16 bit with a capture and
    playback channel. Although some lower quality sound files require jackd
    to run at a rate 22050. I don't normally run any sound daemon.

    cat /proc/asound/pcm
    00-00: VIA82C686A/B rev20 : VIA 82C686A/B rev20 : playback 1 : capture 1

    cat /proc/asound/devices
    16: [0- 0]: digital audio playback
    24: [0- 0]: digital audio capture
    0: [0- 0]: ctl
    33: : timer

    -----

    If I start xgalaga before anything it has sound, but sound apps launched
    after it don't have access to the sound device /dev/dsp. The same holds
    true with armagetron. If I launch the games second, they have no sound.

    Is there anything I missed in the configuration of dmix, or is this the
    natural order of things for cards that don't have hardware mixing and/or
    multiple channels out?

    Shadow_7


  2. Re: alsa dmix via82xx limitations?

    > /etc/asound.conf
    > pcm.dmixer {
    > type dmix
    > ipc_key 1024
    > ipc_key_add_uid true
    > slave {
    > pcm "hw:0,0"
    > period_time 0
    > period_size 1024
    > buffer_size 8192
    > rate 44100
    > }
    > bindings {
    > 0 0
    > 1 1
    > }
    > }


    I just noticed the buffer_size issue for my card. snd-via82xx
    http://alsa.opensrc.org/index.php?page=DmixPlugin

    But how do I determine the correct buffersize for my card?
    /proc/asound/card0/pcm0p/sub0/hw_params
    returns varying results based on what's being run. jackd / esd / artsd /
    alsa / oss. And lspci -vv is rather cryptic with [size=256] / [size=4]
    stuff. Is that bytes? kilobytes? pages? nibbles? registers?
    megabytes?

    I seem to be getting a lot of alsa xruns with my current configuration.
    It looks like my buffer might be 2048, but how do I tell for sure?

    Shadow_7


  3. Re: alsa dmix via82xx limitations?

    On a slightly related note. I got rosegarden4 to playback through jackd
    and timidity. Which was really cool and really beats exporting .mid files
    to run through timidity on the cli.

    in one term:
    jackd -d alsa -S -H -r 11025 -d hw:0

    in another term:
    timidity -Oj -iA

    And run rosegarden4 of course.

    At 11025 most playback takes up about 25% cpu with jackd and timidity
    running in userland. At 22050 it's about 60% cpu. You can do 44100 but
    on complex playback you'll get a lot of alsa xruns and otherwise max out
    my 800MHz duron chip. At 44100 with a simple single note melody line
    it'll only take about 90% cpu.

    With running tuxracer through esddsp the .mid type background music keeps
    pitch but seems to play at half speed. Which I thought was odd. It looks
    like tuxracer uses 16 bit with a 22050 rate.

    I'm not sure how to improve on this though. I've got most things fine
    tuned for my hardware. Short of going out and doubling my ram I seems to
    have run out of options. I seemed to have settled on 1024 period size and
    1024 buffer size and 11025 rate. Which seems to have the best latency
    with the least cpu impact and almost no alsa xruns.

    Shadow_7


+ Reply to Thread