E-MU 404 USB lacks softvol + asym in default alsa-lib definition

Bug #375993 reported by SPU
16
This bug affects 1 person
Affects Status Importance Assigned to Milestone
alsa-lib (Ubuntu)
Fix Released
Undecided
Daniel T Chen

Bug Description

Kubuntu 9.04 amd64
(libasound2 1.0.18-1ubuntu9)

I have E-MU 0404 USB locked to the 44100 on hardware level (but my problem isn't frequency dependent). This card has no hardware mixer, so I'm trying to get "working" software mixer, but with no luck.

The problem:
When I start aplay with default device or "emu" (see my config below) I have a clean sound like it must be (but no software mixing), when I use aplay with "emutest" device I have a noisy sound like it was in 8 bit.
May be dmix doesn't support S24_3LE output format which is only supported by current driver for my card and falls back to 8 bit format? But I don't get any warnings about unsupported format:

> aplay -D emutest /tmp/test.wav
Playing WAVE '/tmp/test.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo

hw_params:

access: MMAP_INTERLEAVED
format: S24_3LE
subformat: STD
channels: 2
rate: 44100 (44100/1)
period_size: 5513
buffer_size: 22050

My asound.conf:

pcm.emutest{
 type plug
 slave.pcm "emudmix"
}

pcm.emudmix {
 type dmix
 ipc_key 1234
 ipc_key_add_uid false
 ipc_perm 0666
 slave {
 pcm "hw:0,0"
 rate 44100
 period_size 5513
 buffer_size 22050
 }
 bindings {
            0 0
            1 1
        }
}

pcm.emu {
 type plug
 slave {
 pcm "hw:0"
 rate 44100
 }
}

pcm.!default {
 type plug
 slave.pcm hw
}

ctl.!default {
 type hw
 card 0
}

Revision history for this message
Daniel T Chen (crimsun) wrote :

Why are you creating an asoundrc? Does the existing 'default' (as shipped by alsa-lib) not suffice?

i.e., it should be sufficient to use "speaker-test -c2 -l2" without _any_ additional asoundrc created by you (or utility)

affects: alsa-plugins (Ubuntu) → alsa-lib (Ubuntu)
Changed in alsa-lib (Ubuntu):
assignee: nobody → Daniel T Chen (crimsun)
status: New → Incomplete
Revision history for this message
SPU (spbamdclub) wrote :

1. The same result. That's why I create my own config to figure out what happens and get soundcard working somehow.
2. By default alsa (soundcard driver) thinks that my card works with rate 48000, so I need to alter this in any case.
Driver for 0404 USB is totally incomplete, so you need an additional tricks to get it working as you want.

Revision history for this message
Daniel T Chen (crimsun) wrote :

Then your pcm.emudmix definition is a bit skewed. Remember that period_size needs to be a multiple of 2, generally a power of 2.

Also, you really ought to look at an existing template and just modify the necessary bits, e.g., http://package-import.ubuntu.com/a/alsa-lib/jaunty/annotate/head%3A/src/conf/cards/CA0106.conf

Note how CA0106.pcm.default wraps asym.

summary: - low sound quality using dmix
+ E-MU 404 USB lacks asym in default alsa-lib definition
summary: - E-MU 404 USB lacks asym in default alsa-lib definition
+ E-MU 404 USB lacks softvol + asym in default alsa-lib definition
Revision history for this message
SPU (spbamdclub) wrote :

Actually I took value for period_size from hw_params playing test wave file with simple config:
pcm.!default {
 type plug
 slave.pcm hw
}
so it's not my idea to use this value.
Anyway thanks for the tip.

Revision history for this message
SPU (spbamdclub) wrote :

I've tried next config:
defaults.pcm.dmix.rate 44100 #to avoid wrong rate
pcm.test {
    type asym
    playback.pcm {
 type plug
 slave.pcm "dmix:USB"
    }
    capture.pcm {
 type plug
 slave.pcm "dsnoop:USB"
    }
}
and got the same result... music sounds like 8 bit.
I can make test records on another PC to show what happens with sound.

Revision history for this message
SPU (spbamdclub) wrote :

Here is samples... I don't have a good cable, but the difference is cleanly audible.

Config was like in above comment (dmix.rate 44100 + pcm.test) plus "clean" pcm.emu:
pcm.emu {
 type plug
 slave {
 pcm "hw:0"
 rate 44100
 }
}

in attachment you can find:
1. "Sound_without_dmix.wav" recorded while running "aplay -D emu test.wav"
2. "Sound_with_dmix.wav" recorded while running "aplay -D test test.wav"

Revision history for this message
SPU (spbamdclub) wrote :
Revision history for this message
SPU (spbamdclub) wrote :

Sorry for a broken link. Here is the right one:

Dmix sound distortion fix:
https://bugtrack.alsa-project.org/alsa-bug/view.php?id=4577

Revision history for this message
SPU (spbamdclub) wrote :
Revision history for this message
Markus Lindenberg (markusl) wrote :

I can confirm that CannibalZerg's patches as posted by SPU fix the problem on my 0202USB as well.

Is ist possible to have this reviewed/pushed upstream by someone who knows this stuff asap?

Revision history for this message
Markus Lindenberg (markusl) wrote :

Looks like this one is gone in Karmic.
I had to use a patched 1.0.20-2ubuntu2 in Jaunty, now with 1.0.20-3ubuntu5 in Karmic it's gone. Can anyone confirm this?

Daniel T Chen (crimsun)
Changed in alsa-lib (Ubuntu):
status: Incomplete → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.