Skip to contentSkip to conversation

Switch to dmix pure by default?

DISCUSSION Martin Pitt 6 participants 7 messages Oct 19, 2005 – Oct 23, 2005

lore
Share & tools
lore
#0 lore raw

Hi ALSA developers!

I'm Martin Pitt, one of Ubuntu's core developers, and I hacked a fair bit around a better audio support in our latest release. We currently use ALSA 1.0.9 (thus with dmix enabled by default) and use esd on top of that since dmix pure still does not work on too many cards (including the powermac driver on my iBook).

However, since esound sucks particularly in terms of A/V synchronisation and has annoying bugs, and the whole concept of a desktop sound daemon is more like a workaround than a sane piece in the software stack, we would like to drop esound entirely and just use ALSA by default in the future. I imagine that this is true for other Linux distros as well.

Now I have several questions:

1) Are you guys interested in reports about cards which do not work with dmix (at least not with the default configuration)?

2) Is there a document which describes dmix debugging, so that we can already pre-process bug reports, can sort them out faster, make it easier for you, and maybe even can help you with fixing?

3) As it appears to me, dmix is a pure software mixing plugin, thus from the mere concept, it seems hardware agnostic to me. Why does it fail on some hardware in the first place?

Thank you in advance, and have a nice day!

Martin

Signature · 5 lines
Martin Pitt        http://www.piware.de
Ubuntu Developer   http://www.ubuntu.com
Debian Developer   http://www.debian.org

In a world without walls and fences, who needs Windows and Gates?
#1 lore raw
Quoted 2 lines · Martin Pitt

1) Are you guys interested in reports about cards which do not work with dmix (at least not with the default configuration)?

at least snd-ice1724 lacks dmix and needs it

-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions, and more. http://solutions.newsforge.com/ibmarch.tmpl

#2 lore raw
In reply to Martin Pitt

At Wed, 19 Oct 2005 17:44:20 +0200,

Quoted 8 lines · Martin Pitt

Hi ALSA developers!

I'm Martin Pitt, one of Ubuntu's core developers, and I hacked a fair bit around a better audio support in our latest release. We currently use ALSA 1.0.9 (thus with dmix enabled by default) and use esd on top of that since dmix pure still does not work on too many cards (including the powermac driver on my iBook).

Oh, it already works on 1.0.10rc2.

Quoted 11 lines

However, since esound sucks particularly in terms of A/V synchronisation and has annoying bugs, and the whole concept of a desktop sound daemon is more like a workaround than a sane piece in the software stack, we would like to drop esound entirely and just use ALSA by default in the future. I imagine that this is true for other Linux distros as well.

Now I have several questions:

1) Are you guys interested in reports about cards which do not work with dmix (at least not with the default configuration)?

Most of these cards are not dmixized just because not confirmed to work - or known as non-workable. So, it would be helpful to point out that which cards work with dmix indeed.

Quoted 3 lines

2) Is there a document which describes dmix debugging, so that we can already pre-process bug reports, can sort them out faster, make it easier for you, and maybe even can help you with fixing?

Heh, documentation is always a problem ;) There is no general method for debugging dmix, AFAIK.

If you cannot play something, it's either a permission problem, a race among processes, or a remaining bug. In this case, running with strace would help a lot.

If it's the problem of output quality, use "hw" instead of "dmix" with the same configuration (rate, period/buffer size, etc), and compare.

If it's a latency problem, check the dmix period_size or period_time configuration.

Last but not least, try the latest version of ALSA. Many bugs have been fixed since 1.0.9 release.

Quoted 3 lines

3) As it appears to me, dmix is a pure software mixing plugin, thus from the mere concept, it seems hardware agnostic to me. Why does it fail on some hardware in the first place?

dmix uses mmap, and assumes fine enough periods. So, it wouldn't work well the cards supporting only 2 periods, for example.

This kind of limitation can be reduced by introducing a new timer interrupt syncing with PCM, but it's still under development (in other words, deep in my TODO list :)

Takashi

-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions, and more. http://solutions.newsforge.com/ibmarch.tmpl

#3 lore raw
Quoted 2 lines · Takashi Iwai

dmix uses mmap, and assumes fine enough periods. So, it wouldn't work well the cards supporting only 2 periods, for example.

Is that for performance? I don't really understand why dmix can't just, well, mix the streams together and then forward it on as a regular bytestream using the non-mmap interface. Esound works with any hardware, so couldn't dmix have a compatibility mode?

thanks -mike

-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions, and more. http://solutions.newsforge.com/ibmarch.tmpl

#4 lore raw

At Wed, 19 Oct 2005 19:17:37 +0100,

Quoted 9 lines · Mike Hearn
Quoted 2 lines · Takashi Iwai

dmix uses mmap, and assumes fine enough periods. So, it wouldn't work well the cards supporting only 2 periods, for example.

Is that for performance? I don't really understand why dmix can't just, well, mix the streams together and then forward it on as a regular bytestream using the non-mmap interface. Esound works with any hardware, so couldn't dmix have a compatibility mode?

The question is not doable or not. It's a completely different design.

The mix "server" like esound does:
- _read_ the data from clients
- mix them
- wright them to h/w
Because of this mechanism, it requires smaller period to achieve the low latency.

OTOH, dmix lets its processes mixing by themselves. There is no read or write server operation, i.e. there is no real mix "server". (In practice, dmix has a resource server, which is used only to pass
the file descriptor for mmap.)
Each client mmaps the very same h/w buffer, and add/sub the data on the buffer atomically as write.

Of course, it's possible to implement ALSA-mixing server a la esound/arts for the hardwares without mmappable buffers. But, it's just an idea and a plan, so far. Volunteers are always appreciated ;)

Takashi

-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions, and more. http://solutions.newsforge.com/ibmarch.tmpl

#5 lore raw

HI,

This has possibly become the most regularly requested feature. Is there a tasklist that has this as a priority?

Cheers.

Quoting Takashi Iwai <[email protected]>:

Quoted 38 lines

At Wed, 19 Oct 2005 19:17:37 +0100,

Quoted 9 lines · Mike Hearn
Quoted 2 lines · Takashi Iwai

dmix uses mmap, and assumes fine enough periods. So, it wouldn't work well the cards supporting only 2 periods, for example.

Is that for performance? I don't really understand why dmix can't just, well, mix the streams together and then forward it on as a regular bytestream using the non-mmap interface. Esound works with any hardware, so couldn't dmix have a compatibility mode?

The question is not doable or not. It's a completely different design.

The mix "server" like esound does:
- _read_ the data from clients
- mix them
- wright them to h/w
Because of this mechanism, it requires smaller period to achieve the low latency.

OTOH, dmix lets its processes mixing by themselves. There is no read or write server operation, i.e. there is no real mix "server". (In practice, dmix has a resource server, which is used only to pass the file descriptor for mmap.)
Each client mmaps the very same h/w buffer, and add/sub the data on the buffer atomically as write.

Of course, it's possible to implement ALSA-mixing server a la esound/arts for the hardwares without mmappable buffers. But, it's just an idea and a plan, so far. Volunteers are always appreciated ;)

Takashi

Quoted 9 lines

-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions, and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Alsa-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/alsa-devel

--
Patrick Shirkey - Boost Hardware Ltd. Http://www.boosthardware.com Http://www.djcj.org/ - The Linux Audio Users guide Http://www.djcj.org/gigs - Gigs Guide Korea
========================================

Being on stage with the band in front of crowds shouting, "Get off! No! We want normal music!", I think that was more like acting than anything I've ever done.

Goldie, 8 Nov, 2002
The Scotsman

-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course Free Certification Exam for All Training Attendees Through End of 2005 Visit http://www.jboss.com/services/certification for more information

#6 lore raw
Quoted 4 lines · Patrick Shirkey

HI,

This has possibly become the most regularly requested feature. Is there a tasklist that has this as a priority?

You mean dmix by default? It already works that way.

Lee

-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course Free Certification Exam for All Training Attendees Through End of 2005 Visit http://www.jboss.com/services/certification for more information