Hi all, and sorry for the late answer,
On Mon, Feb 04, 2008 at 05:02:01PM +0100, Jan Willies wrote:
Takashi Iwai wrote:
At Mon, 04 Feb 2008 16:46:44 +0100, Jan Willies wrote:
Takashi Iwai wrote:
At Mon, 04 Feb 2008 16:32:29 +0100, Jan Willies wrote:
[root@server ~]# alsaplayer --verbose -o alsa -d hw:1,0 Strong.mp3 AlsaPlayer 0.99.80 (C) 1999-2004 Andy Lo A Foe andy@alsaplayer.org and others. Output plugin: ALSA output v1.9.0beta12 error on set_format SND_PCM_FORMAT_S16 Unavailable hw params: ACCESS: RW_INTERLEAVED FORMAT: S16_BE
The device is supposed to be big-endian only. Try plughw:1,0 instead to convert endianness.
Yes, that seems to work! Only for analog output though. When I try with digital I get the same error again.
[jan@server ~]$ cat /proc/asound/devices 0: [ 0] : control 1: : sequencer 16: [ 0- 0]: digital audio playback 24: [ 0- 0]: digital audio capture 25: [ 0- 1]: digital audio capture 32: [ 1] : control 33: : timer 48: [ 1- 0]: digital audio playback 49: [ 1- 1]: digital audio playback
[root@server ~]# alsaplayer --verbose -o alsa -d plughw:1,1 Strong.mp3 AlsaPlayer 0.99.80 (C) 1999-2004 Andy Lo A Foe andy@alsaplayer.org and others. Output plugin: ALSA output v1.9.0beta12 error on set_format SND_PCM_FORMAT_S16 Unavailable hw params: ACCESS: RW_INTERLEAVED FORMAT: IEC958_SUBFRAME_BE [...]
The plug plugin doesn't handle the automatic conversion of IEC958-subframe formats. You'll likely need to create a PCM configuration to use iec958 plugin properly (better as a card-specific config stored in /usr/share/alsa/cards). Some config files there already use iec958 plugin, such as ATIIXP-SPDMA.conf.
There is already a /usr/share/alsa/cards/EM8300.conf with EM8300.pcm.iec958.0 {...} (http://pastebin.ca/raw/891351) from Ville Skyttä but I don't know how to use it. Neither how to create a PCM configuration for the iec958 plugin. I guess I'll wait for some dxr3 devs to join the party :-)
As Takashi Iwai noticed, the "EM8300 DAC" device only supports 16-bit big-endian 2-channel data, but it also has its channels swapped and lacks a volume control. Using plughw:1,0 does not unswap the channels or add a volume control.
As for the "EM8300 IEC958" device, it only supports big-endian IEC958 subframes, and needs specific values for its preambles.
For those reasons, I had to write a specific configuration file for EM8300 card (and fix some bugs in alsa-lib's iec958 plugin).
Using this file is pretty trivial: - for the "EM8300 DAC" device, use the "default:1" alsa device - for the "EM8300 IEC958" device, use the "iec958:1" alsa device
Not that, if I understand ALSA correctly, this is not EM8300-specifica at all, the same syntax should work with any card.
If you wish to add volume control and format conversion to your "EM8300 IEC958" device, create a ~/.asoundrc file with:
pcm.foobar { type plug slave.pcm { type softvol slave.pcm iec958:EM8300 control { name "IEC958 Playback Volume" card EM8300 } } }
and then use the "foobar" alsa device. (Note that there might be some syntax errors, since it is untested.)
Note that there's nothing specific to the EM8300 cards here, the same thing should work with any card that supports IEC958, just replace the two "EM8300" with the name or number of the card you want to use.
Hope this helps,
Nicolas
PS: any comment or suggestion for improvement is welcome, especially from ALSA experts (which I am not).