* Long-standing 5.1ch huge LFE/rear swap annoyance (ALSA vs. Windows!)
@ 2006-11-18 1:38 Andreas Mohr
2006-11-18 4:43 ` Daniel Yek
2006-11-20 14:06 ` Clemens Ladisch
0 siblings, 2 replies; 8+ messages in thread
From: Andreas Mohr @ 2006-11-18 1:38 UTC (permalink / raw)
To: alsa-devel; +Cc: Takashi Iwai
Hi,
as I'm trying to improve support for my el-cheapo USB audio adapter,
I found that one of the bigger issues is swapping of Center/LFE vs.
rear speakers, as can be seen when running
speaker-test -c 6 -D pcm.USBAudio
Having ALSA use different output assignment versus the printed labels
on the box is somewhat of a PITA, I'd say.
This doesn't only happen with my card, but with many many many many many
(yes, I did quite some research) other cards:
http://cvs.icculus.org/cvs/twilight/darkplaces/snd_main.c?rev=1.53
"// Our speaker layouts are based on ALSA. They differ from those
// Win32 and Mac OS X APIs use when there's more than 4 channels.
// (rear left + rear right, and front center + LFE are swapped).
"
(probably the most insightful comment on the entire web)
http://alsa.opensrc.org/SurroundSound
"Some of the six channel wave files that you can find on the web are in "wave
extensible" format, which have the interleaved channels in an order differing
from what Alsa expects (center and lfe come before left and right rear). It's a
MS thing. You can play those with sfplay, a simple command line player I
adapted from an example program in Erik de Castro Lopo's libsndfile
distribution. sfplay recognizes wave extensible files and flips the channel
order so they can be played using Alsa."
(second most insightful)
http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/2003-June/019180.html
http://blog.gmane.org/gmane.linux.alsa.devel/month=20051101
http://www.mythtvtalk.com/forum/viewtopic.php?t=1858&view=previous
http://www.nvnews.net/vbulletin/showthread.php?t=62108
http://www.cse.ohio-state.edu/~bondhugu/alsamch.shtml
http://ubuntuforums.org/showthread.php?t=253725&page=5
etc.pp. ad nauseam.
(search bug tracking for "swap" for two tons more reports of swapped channels)
One could even be brave enough to ask "are there *any* 5.1 cards which
work correctly on ALSA??" ;), as such we should think hard about adding
generic support to compensate for this, *automatically*.
[yes, I know about asoundrc hackery to semi-easily get this tweaked]
My theory is that since wave extensible is an established format with different
channel ordering that some soundcards chose to use this swapped ordering
in hardware.
And ALSA didn't care much since it didn't want to have to expensively remix samples
into correct order?
But OTOH *if* the comment above is correct and ALSA *does* employ a modified channel
order vs. Windows and Mac OS X, then it seems as if it might be speaker-test which
*doesn't* obey this ALSA ordering??? But that could probably be checked by playing
some public surround .wav samples or DVD playback or so.
Could we please try to put an end to this insanity?
Is there anyone who has extensive experience with 5.1 surround channel ordering status
of many different soundcards on ALSA? How many "ok", how many swapped?
Oh, and if the answer is that I should try to fix this on a per-driver (per-card)
basis, then could anyone tell me where the heck I'd have to tweak snd-usb-audio
for correct channel order?
Rather confused,
Andreas Mohr (a non-Surround user who still cares as much as even writing this whole mail)
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Long-standing 5.1ch huge LFE/rear swap annoyance (ALSA vs. Windows!)
2006-11-18 1:38 Long-standing 5.1ch huge LFE/rear swap annoyance (ALSA vs. Windows!) Andreas Mohr
@ 2006-11-18 4:43 ` Daniel Yek
2006-11-20 14:06 ` Clemens Ladisch
1 sibling, 0 replies; 8+ messages in thread
From: Daniel Yek @ 2006-11-18 4:43 UTC (permalink / raw)
To: Andreas Mohr, alsa-devel
Comment at the bottom...
At 05:38 PM 11/17/2006, Andreas Mohr wrote:
>Hi,
>
>as I'm trying to improve support for my el-cheapo USB audio adapter,
>I found that one of the bigger issues is swapping of Center/LFE vs.
>rear speakers, as can be seen when running
>
>speaker-test -c 6 -D pcm.USBAudio
>
>Having ALSA use different output assignment versus the printed labels
>on the box is somewhat of a PITA, I'd say.
>
>This doesn't only happen with my card, but with many many many many many
>(yes, I did quite some research) other cards:
>
>http://cvs.icculus.org/cvs/twilight/darkplaces/snd_main.c?rev=1.53
>"// Our speaker layouts are based on ALSA. They differ from those
>// Win32 and Mac OS X APIs use when there's more than 4 channels.
>// (rear left + rear right, and front center + LFE are swapped).
>"
>(probably the most insightful comment on the entire web)
>
>http://alsa.opensrc.org/SurroundSound
>"Some of the six channel wave files that you can find on the web are in "wave
>extensible" format, which have the interleaved channels in an order differing
>from what Alsa expects (center and lfe come before left and right rear).
>It's a
>MS thing. You can play those with sfplay, a simple command line player I
>adapted from an example program in Erik de Castro Lopo's libsndfile
>distribution. sfplay recognizes wave extensible files and flips the channel
>order so they can be played using Alsa."
>(second most insightful)
>
>http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/2003-June/019180.html
>http://blog.gmane.org/gmane.linux.alsa.devel/month=20051101
>http://www.mythtvtalk.com/forum/viewtopic.php?t=1858&view=previous
>http://www.nvnews.net/vbulletin/showthread.php?t=62108
>http://www.cse.ohio-state.edu/~bondhugu/alsamch.shtml
>http://ubuntuforums.org/showthread.php?t=253725&page=5
>etc.pp. ad nauseam.
>
>(search bug tracking for "swap" for two tons more reports of swapped channels)
>
>One could even be brave enough to ask "are there *any* 5.1 cards which
>work correctly on ALSA??" ;), as such we should think hard about adding
>generic support to compensate for this, *automatically*.
>
>[yes, I know about asoundrc hackery to semi-easily get this tweaked]
>
>My theory is that since wave extensible is an established format with
>different
>channel ordering that some soundcards chose to use this swapped ordering
>in hardware.
>And ALSA didn't care much since it didn't want to have to expensively
>remix samples
>into correct order?
>
>But OTOH *if* the comment above is correct and ALSA *does* employ a
>modified channel
>order vs. Windows and Mac OS X, then it seems as if it might be
>speaker-test which
>*doesn't* obey this ALSA ordering??? But that could probably be checked by
>playing
>some public surround .wav samples or DVD playback or so.
>
>Could we please try to put an end to this insanity?
>
>Is there anyone who has extensive experience with 5.1 surround channel
>ordering status
>of many different soundcards on ALSA? How many "ok", how many swapped?
>
>Oh, and if the answer is that I should try to fix this on a per-driver
>(per-card)
>basis, then could anyone tell me where the heck I'd have to tweak
>snd-usb-audio
>for correct channel order?
>
>Rather confused,
>
>Andreas Mohr (a non-Surround user who still cares as much as even writing
>this whole mail)
I have just dealt with this channel-swapping issue last month:
http://sourceforge.net/mailarchive/message.php?msg_id=37102586
Microsoft's Channel Ordering API is explained in this URL:
http://www.microsoft.com/whdc/device/audio/multichaud.mspx
Default Channel Ordering and dwChannelMask are what matter most.
As it is now, there appeared to have 5.1 channels media files in
Microsoft's channel ordering and there are others in ALSA's ordering.
There needs a systematic and comprehensive way to detect which of the two
ordering the clip is using. Suggestion would be great.
--
Daniel Yek
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Long-standing 5.1ch huge LFE/rear swap annoyance (ALSA vs. Windows!)
2006-11-18 1:38 Long-standing 5.1ch huge LFE/rear swap annoyance (ALSA vs. Windows!) Andreas Mohr
2006-11-18 4:43 ` Daniel Yek
@ 2006-11-20 14:06 ` Clemens Ladisch
2006-11-20 14:31 ` Takashi Iwai
1 sibling, 1 reply; 8+ messages in thread
From: Clemens Ladisch @ 2006-11-20 14:06 UTC (permalink / raw)
To: Andreas Mohr, alsa-devel
Andreas Mohr wrote:
> as I'm trying to improve support for my el-cheapo USB audio adapter,
> I found that one of the bigger issues is swapping of Center/LFE vs.
> rear speakers, as can be seen when running
>
> speaker-test -c 6 -D pcm.USBAudio
>
> My theory is that since wave extensible is an established format with different
> channel ordering that some soundcards chose to use this swapped ordering in hardware.
Some do, some don't.
> And ALSA didn't care much since it didn't want to have to expensively remix samples
> into correct order?
Rerouting channels is actually quite cheap.
> But OTOH *if* the comment above is correct and ALSA *does* employ a modified channel
> order vs. Windows and Mac OS X, then it seems as if it might be speaker-test which
> *doesn't* obey this ALSA ordering???
speaker-test _does_ obey the ALSA ordering. However, USB devices do not,
and there is not yet an ALSA configuration file for remapping channels
on USB devices.
This is a bug in the ALSA library.
> Could we please try to put an end to this insanity?
I'm working on this.
> Is there anyone who has extensive experience with 5.1 surround channel ordering status
> of many different soundcards on ALSA? How many "ok", how many swapped?
AFAIK USB devices are the only ones where channels are swapped.
> Oh, and if the answer is that I should try to fix this on a per-driver (per-card)
> basis, then could anyone tell me where the heck I'd have to tweak snd-usb-audio
> for correct channel order?
You would have to write /usr/share/alsa/cards/USB-Audio.conf.
HTH
Clemens
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Long-standing 5.1ch huge LFE/rear swap annoyance (ALSA vs. Windows!)
2006-11-20 14:06 ` Clemens Ladisch
@ 2006-11-20 14:31 ` Takashi Iwai
2006-11-20 19:51 ` Andreas Mohr
2006-11-21 10:21 ` Clemens Ladisch
0 siblings, 2 replies; 8+ messages in thread
From: Takashi Iwai @ 2006-11-20 14:31 UTC (permalink / raw)
To: Clemens Ladisch; +Cc: Andreas Mohr, alsa-devel
At Mon, 20 Nov 2006 15:06:50 +0100,
Clemens Ladisch wrote:
>
> > But OTOH *if* the comment above is correct and ALSA *does* employ a modified channel
> > order vs. Windows and Mac OS X, then it seems as if it might be speaker-test which
> > *doesn't* obey this ALSA ordering???
>
> speaker-test _does_ obey the ALSA ordering. However, USB devices do not,
> and there is not yet an ALSA configuration file for remapping channels
> on USB devices.
>
> This is a bug in the ALSA library.
I'd call it rather a configuration bug.
> > Could we please try to put an end to this insanity?
>
> I'm working on this.
What solution in sight?
> > Is there anyone who has extensive experience with 5.1 surround channel ordering status
> > of many different soundcards on ALSA? How many "ok", how many swapped?
>
> AFAIK USB devices are the only ones where channels are swapped.
Possibly some ice172x-based devices may have similar problems.
There are many untested boards.
Takashi
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Long-standing 5.1ch huge LFE/rear swap annoyance (ALSA vs. Windows!)
2006-11-20 14:31 ` Takashi Iwai
@ 2006-11-20 19:51 ` Andreas Mohr
2006-11-20 19:55 ` Lee Revell
2006-11-21 10:21 ` Clemens Ladisch
1 sibling, 1 reply; 8+ messages in thread
From: Andreas Mohr @ 2006-11-20 19:51 UTC (permalink / raw)
To: Takashi Iwai; +Cc: Andreas Mohr, alsa-devel
Hi,
On Mon, Nov 20, 2006 at 03:31:04PM +0100, Takashi Iwai wrote:
> At Mon, 20 Nov 2006 15:06:50 +0100,
> Clemens Ladisch wrote:
> >
> > > But OTOH *if* the comment above is correct and ALSA *does* employ a modified channel
> > > order vs. Windows and Mac OS X, then it seems as if it might be speaker-test which
> > > *doesn't* obey this ALSA ordering???
> >
> > speaker-test _does_ obey the ALSA ordering. However, USB devices do not,
> > and there is not yet an ALSA configuration file for remapping channels
> > on USB devices.
> >
> > This is a bug in the ALSA library.
>
> I'd call it rather a configuration bug.
>
>
> > > Could we please try to put an end to this insanity?
> >
> > I'm working on this.
>
> What solution in sight?
Sorry for the strong wording ;)
I'll have a look at getting done an USB-Audio channel config.
> > > Is there anyone who has extensive experience with 5.1 surround channel ordering status
> > > of many different soundcards on ALSA? How many "ok", how many swapped?
> >
> > AFAIK USB devices are the only ones where channels are swapped.
>
> Possibly some ice172x-based devices may have similar problems.
> There are many untested boards.
To me it sounded like that scope is far bigger than USB-only, from internet
research (and bug tracker).
I also had a quick visit to #ubuntu (openprojects) where I was absolutely SHOCKED
about the amount of sound config issues. Those even exceeded the amount of
wireless configuration requests. At least 3 sound/mixer issues within the
one hour that I was in there (weirdly swapped channels on surround,
almost no sound or none at all, ...).
Thus I think there should be more effort towards getting currently implemented
chipset drivers to work on all those cards easily.
Of course this is much easier said than done...
Andreas Mohr
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Long-standing 5.1ch huge LFE/rear swap annoyance (ALSA vs. Windows!)
2006-11-20 19:51 ` Andreas Mohr
@ 2006-11-20 19:55 ` Lee Revell
0 siblings, 0 replies; 8+ messages in thread
From: Lee Revell @ 2006-11-20 19:55 UTC (permalink / raw)
To: andi; +Cc: Takashi Iwai, Andreas Mohr, alsa-devel
On Mon, 2006-11-20 at 20:51 +0100, Andreas Mohr wrote:
> I also had a quick visit to #ubuntu (openprojects) where I was
> absolutely SHOCKED about the amount of sound config issues. Those even
> exceeded the amount of wireless configuration requests. At least 3
> sound/mixer issues within the one hour that I was in there (weirdly
> swapped channels on surround, almost no sound or none at all, ...).
>
> Thus I think there should be more effort towards getting currently
> implemented chipset drivers to work on all those cards easily.
> Of course this is much easier said than done...
It would help tremendously if the Ubuntu people could push these
upstream. Bugs that end up in the ALSA bug tracker do get addressed.
Sometimes I think that the distro people assume that ALSA developers
must know about all these issues, which is impossible because of the
amount of hardware out there.
Lee
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Long-standing 5.1ch huge LFE/rear swap annoyance (ALSA vs. Windows!)
2006-11-20 14:31 ` Takashi Iwai
2006-11-20 19:51 ` Andreas Mohr
@ 2006-11-21 10:21 ` Clemens Ladisch
2006-11-21 10:34 ` Takashi Iwai
1 sibling, 1 reply; 8+ messages in thread
From: Clemens Ladisch @ 2006-11-21 10:21 UTC (permalink / raw)
To: Takashi Iwai; +Cc: Andreas Mohr, alsa-devel
Takashi Iwai wrote:
> Clemens Ladisch wrote:
> > ...
> > and there is not yet an ALSA configuration file for remapping channels
> > on USB devices.
> > ...
> > I'm working on this.
>
> What solution in sight?
Creating a surround51 device with a route plugin is trivial.
Selecting device-specific device definitions can be done with a new
card_shortname configuration function and lots of indirections.
The biggest problem is dmix. I do no want to impose some default sample
rate/format on unknown devices because this would break most USB
headsets or other unusual devices. I think the best solution would be
to add an option to dmix to automatically select some suitable sample
format when it's first opened.
Regards,
Clemens
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Long-standing 5.1ch huge LFE/rear swap annoyance (ALSA vs. Windows!)
2006-11-21 10:21 ` Clemens Ladisch
@ 2006-11-21 10:34 ` Takashi Iwai
0 siblings, 0 replies; 8+ messages in thread
From: Takashi Iwai @ 2006-11-21 10:34 UTC (permalink / raw)
To: Clemens Ladisch; +Cc: Andreas Mohr, alsa-devel
At Tue, 21 Nov 2006 11:21:19 +0100,
Clemens Ladisch wrote:
>
> Takashi Iwai wrote:
> > Clemens Ladisch wrote:
> > > ...
> > > and there is not yet an ALSA configuration file for remapping channels
> > > on USB devices.
> > > ...
> > > I'm working on this.
> >
> > What solution in sight?
>
> Creating a surround51 device with a route plugin is trivial.
>
> Selecting device-specific device definitions can be done with a new
> card_shortname configuration function and lots of indirections.
OK. My initial thought is to use USB IDs, but shortname should be
enough, too.
For a long term solution, we can create an API for the driver to
provide the channel-mapping information. This could be done, for
example, by a special read-only control element, or via a new ioctl.
IIRC, usb descriptor contains the channel-mapping information, so this
process could be (partly) automated instead of device-base
configuration.
> The biggest problem is dmix. I do no want to impose some default sample
> rate/format on unknown devices because this would break most USB
> headsets or other unusual devices. I think the best solution would be
> to add an option to dmix to automatically select some suitable sample
> format when it's first opened.
Agreed. For example, we can change the dmix code to accept the rate
option as a list instead of an integer. When it's a list, dmix tries
to choose the first matching one via hw_params call.
Takashi
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2006-11-21 10:34 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-18 1:38 Long-standing 5.1ch huge LFE/rear swap annoyance (ALSA vs. Windows!) Andreas Mohr
2006-11-18 4:43 ` Daniel Yek
2006-11-20 14:06 ` Clemens Ladisch
2006-11-20 14:31 ` Takashi Iwai
2006-11-20 19:51 ` Andreas Mohr
2006-11-20 19:55 ` Lee Revell
2006-11-21 10:21 ` Clemens Ladisch
2006-11-21 10:34 ` Takashi Iwai
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.