Asus Xonar XD, the first attempt!

OSS specific Solaris discussion (x86/SPARC)

Moderators: hannu, dev, kodachi, cesium

Asus Xonar XD, the first attempt!

Postby Tomservo » Fri Apr 04, 2008 1:37 pm

Just so that one thing's clear, the device works fine in Windows Vista. So it's not faulty.

Ok, here's the deal: That card is simply a CMI8788 behind a PCIe bridge (of type PEX8112). OSS finds the card and attaches the driver, but that's it.

Operating system is Solaris Nevada snv_76. Next upgrade happens when snv_86 is released, preferably the Project Indiana build.

Mainboard is an Asus A8N-E with Nforce4 Ultra chipset. There might be the small chance of the mainboard acting up, because moving my Intel PCIe network card to a different PCIe 1x slot prevents it from working. The Xonar is seated in a PCIe 4x slot, because the chipset cooling grill is in the way, it won't fit in any of the 1x slots because of that. I was going to upgrade anyway, the parts are ordered but not yet here. If it's a chipset/mainboard issue, I'll know once that happened.

Doing ossdetect multiple times with the Xonar inserted will cause Solaris to blow up at some point.

Posted here, because I'm using Solaris and don't have disk space to install a Linux to see whether it happens there, too, or if this is solely some issue within Solaris.

--edit: The Xonar DX has CirrusLogin CS4398 DACs for the front output, the other outputs have CS4362A DACs. It appears that the D2(X) ones have TI Burr-Brown PCM1796 ones for all outputs. Dabbling in the ALSA driver source code, it appears that DACs are controlled from within the driver. I guess the Xonar DACs aren't supported in the current CMI driver.

--edit2: The OSS CMI driver seems to drive AK4396 DACs like the ALSA ones. Hrm.

ossdetect run, rebooted, ossinfo output:
Code: Select all
bigmclargehuge:~ > osstest
Sound subsystem and version: OSS 4.0 (b1011/200712201212) (0x00040003)
Platform: SunOS/i86pc 5.11 snv_76

*** Scanning sound adapter #-1 ***
/dev/oss/cmi87880/pcm0 (audio engine 0): CMedia CMI8788 (MultiChannel)
- Performing audio playback test... /dev/oss/cmi87880/pcm0: No such device or address
There are no sound devices available.
The most likely reason is that the device you have
is malfunctioning or it's not supported by OSS.
It's also possible that you are trying to use wrong device file.
Please fill the problem report at
http://www.opensound.com/support.cgi
Can't open the device
/dev/oss/cmi87880/pcm1 (audio engine 2): CMedia CMI8788 (SPDIF)
- Performing audio playback test... /dev/oss/cmi87880/pcm1: No such device or address
There are no sound devices available.
The most likely reason is that the device you have
is malfunctioning or it's not supported by OSS.
It's also possible that you are trying to use wrong device file.
Please fill the problem report at
http://www.opensound.com/support.cgi
Can't open the device

*** Some errors were detected during the tests ***
bigmclargehuge:~ >

Things to notice, the mixer device being -1. Then the "no such device" stuff.

No such device?
Code: Select all
bigmclargehuge:~ > ll /dev/oss/cmi87880/*   
lrwxrwxrwx   1 root     root          82 Apr  4 15:04 /dev/oss/cmi87880/mix-1 -> ../../../devices/pci@0,0/pci10de,5d@b/pci10b5,8112@0/pci1043,8275@4:cmi87880,mix-1
lrwxrwxrwx   1 root     sys           81 Apr  4 14:55 /dev/oss/cmi87880/mix0 -> ../../../devices/pci@0,0/pci10de,5d@b/pci10b5,8112@0/pci1043,8275@4:cmi87880,mix0
lrwxrwxrwx   1 root     sys           81 Apr  4 14:55 /dev/oss/cmi87880/mix1 -> ../../../devices/pci@0,0/pci10de,5d@b/pci10b5,8112@0/pci1043,8275@4:cmi87880,mix1
lrwxrwxrwx   1 root     sys           81 Apr  4 14:55 /dev/oss/cmi87880/pcm0 -> ../../../devices/pci@0,0/pci10de,5d@b/pci10b5,8112@0/pci1043,8275@4:cmi87880,pcm0
lrwxrwxrwx   1 root     sys           81 Apr  4 14:55 /dev/oss/cmi87880/pcm1 -> ../../../devices/pci@0,0/pci10de,5d@b/pci10b5,8112@0/pci1043,8275@4:cmi87880,pcm1
bigmclargehuge:~ > ll /devices/pci\@0\,0/pci10de\,5d\@b/pci10b5\,8112\@0
/devices/pci@0,0/pci10de,5d@b/pci10b5,8112@0/pci1043,8275@4:cmi87880,mix1: No such device or address
/devices/pci@0,0/pci10de,5d@b/pci10b5,8112@0/pci1043,8275@4:cmi87880,mix0: No such device or address
/devices/pci@0,0/pci10de,5d@b/pci10b5,8112@0/pci1043,8275@4:cmi87880,pcm1: No such device or address
/devices/pci@0,0/pci10de,5d@b/pci10b5,8112@0/pci1043,8275@4:cmi87880,pcm0: No such device or address
total 2
drwxr-xr-x   2 root     sys          512 Apr  4 14:19 pci1043,8275@4
bigmclargehuge:~ > ls /devices/pci\@0\,0/pci10de\,5d\@b/pci10b5\,8112\@0
pci1043,8275@4                pci1043,8275@4:cmi87880,pcm0
pci1043,8275@4:cmi87880,mix0  pci1043,8275@4:cmi87880,pcm1
pci1043,8275@4:cmi87880,mix1
bigmclargehuge:~ >

The nodes are there, but Solaris bails on me when I do ls -l. So uhm.

ossdetect during runtime:
Code: Select all
bigmclargehuge:~ > su
Password:
bigmclargehuge:~ > ossdetect -v

Detected pci1043,8275: CMedia CMI8788 (driver=cmi8788)
Install module 'cmi8788' (pci13f6,8788)
rem_drv osscore
rem_drv cmi8788
rem_drv vmix
unloaded osscommon
add_drv -m '* 0666 root sys' osscore
add_drv -m '* 0666 root sys' -i '"pci13f6,8788"' cmi8788
add_drv -m '* 0666 root sys' vmix
add_drv -m '* 0666 root sys' sadasupport
bigmclargehuge:~ > ossinfo
Version info: OSS 4.0 (b1011/200712201212) (0x00040003)
Platform: SunOS/i86pc 5.11 snv_76 (bigmclargehuge)

Number of audio devices:        2
Number of audio engines:        11
Number of mixer devices:        2


Device objects
0: osscore0 OSS common devices
1: cmi87880 CMedia CMI8788 interrupts=3 (4)
2: vmix0 OSS transparent virtual support
3: sadasupport0 SADA compatibility layer


Mixer devices
CMedia CMI8788 (Mixer 0 of device object 1)
AC97 Input Mixer (CMI9780) (Mixer 1 of device object 1)

Audio devices
CMedia CMI8788 (MultiChannel)     /dev/oss/cmi87880/pcm0  (device index 0)
CMedia CMI8788 (SPDIF)            /dev/oss/cmi87880/pcm1  (device index 1)
bigmclargehuge:~ >
"*p
bigmclargehuge:~ > osstest
Sound subsystem and version: OSS 4.0 (b1011/200712201212) (0x00040003)
Platform: SunOS/i86pc 5.11 snv_76

*** Scanning sound adapter #-1 ***
/dev/oss/cmi87880/pcm0 (audio engine 0): CMedia CMI8788 (MultiChannel)
- Performing audio playback test... /dev/oss/cmi87880/pcm0: No such device or address
There are no sound devices available.
The most likely reason is that the device you have
is malfunctioning or it's not supported by OSS.
It's also possible that you are trying to use wrong device file.
Please fill the problem report at
http://www.opensound.com/support.cgi
Can't open the device
/dev/oss/cmi87880/pcm1 (audio engine 2): CMedia CMI8788 (SPDIF)
- Performing audio playback test... /dev/oss/cmi87880/pcm1: No such device or address
There are no sound devices available.
The most likely reason is that the device you have
is malfunctioning or it's not supported by OSS.
It's also possible that you are trying to use wrong device file.
Please fill the problem report at
http://www.opensound.com/support.cgi
Can't open the device

*** Some errors were detected during the tests ***
bigmclargehuge:~ >

At least the mixer device IDs are fixed, osstest still balks. Obviously due to faulty device nodes.

ossinfo -v9 after ossdetect:
Code: Select all
bigmclargehuge:~ > ossinfo -v9
Version info: OSS 4.0 (b1011/200712201212) (0x00040003)
Platform: SunOS/i86pc 5.11 snv_76 (bigmclargehuge)

Number of audio devices:        2
Number of audio engines:        11
Number of mixer devices:        2


Device objects
0: osscore0 OSS common devices
1: cmi87880 CMedia CMI8788 interrupts=3 (4)
2: vmix0 OSS transparent virtual support
3: sadasupport0 SADA compatibility layer


Mixer devices
CMedia CMI8788 (Mixer 0 of device object 1)
    Device file /dev/oss/cmi87880/mix0, Legacy device /dev/mixer2
    Priority: 10
    Caps:
    Device handle: PCI82751043-0-mx01
    Device priority: 10

AC97 Input Mixer (CMI9780) (Mixer 1 of device object 1)
    Device file /dev/oss/cmi87880/mix1, Legacy device /dev/mixer3
    Priority: 2
    Caps:
    Device handle: PCI82751043-0-mx02
    Device priority: 2


Audio devices
CMedia CMI8788 (MultiChannel)     /dev/oss/cmi87880/pcm0  (device index 0)
    Legacy device /dev/dsp0
    Caps: DUPLEX TRIGGER
    Modes: IN/OUT
      Engine      1: 0/CMedia CMI8788 (MultiChannel)
                     Available for use
      Engine      2: 3/CMedia CMI8788 (MultiChannel) (VMIX0)
                     Available for use
      Engine      3: 4/CMedia CMI8788 (MultiChannel) (VMIX0)
                     Available for use
      Engine      4: 5/CMedia CMI8788 (MultiChannel) (VMIX0)
                     Available for use
      Engine      5: 6/CMedia CMI8788 (MultiChannel) (VMIX0)
                     Available for use
      Engine      6: 7/CMedia CMI8788 (MultiChannel) (VMIX0)
                     Available for use
      Engine      7: 8/CMedia CMI8788 (MultiChannel) (VMIX0)
                     Available for use
      Engine      8: 9/CMedia CMI8788 (MultiChannel) (VMIX0)
                     Available for use
      Engine      9: 10/CMedia CMI8788 (MultiChannel) (VMIX0)
                     Available for use
      Engine     10: 1/CMedia CMI8788 (Multichannel)
                     Available for use
    Input formats (0x00001010):
      AFMT_S16_LE       - 16 bit signed little endian
      AFMT_S32_LE       - 32 bit signed little endian
    Output formats (0x00001010):
      AFMT_S16_LE       - 16 bit signed little endian
      AFMT_S32_LE       - 32 bit signed little endian
    Device handle: PCI82751043-0-au01
    Related mixer dev: -1
    Sample rate source: 0
    Preferred channel configuration: Not indicated
    Supported number of channels (min - max): 2 - 8
    Native sample rates (min - max): 32000 - 192000
    HW Type: Not indicated.
    Minimum latency: Not indicated

CMedia CMI8788 (SPDIF)            /dev/oss/cmi87880/pcm1  (device index 1)
    Legacy device /dev/dsp1
    Caps: DUPLEX TRIGGER
    Modes: IN/OUT
      Engine      1: 2/CMedia CMI8788 (SPDIF)
                     Available for use
    Input formats (0x00001410):
      AFMT_S16_LE       - 16 bit signed little endian
      AFMT_AC3          - AC3 (Dolby Digital) encoded audio
      AFMT_S32_LE       - 32 bit signed little endian
    Output formats (0x00001410):
      AFMT_S16_LE       - 16 bit signed little endian
      AFMT_AC3          - AC3 (Dolby Digital) encoded audio
      AFMT_S32_LE       - 32 bit signed little endian
    Device handle: PCI82751043-0-au02
    Related mixer dev: -1
    Sample rate source: 0
    Preferred channel configuration: Not indicated
    Supported number of channels (min - max): 2 - 2
    Native sample rates (min - max): 32000 - 192000
    HW Type: Not indicated.
    Minimum latency: Not indicated

bigmclargehuge:~ >


prtconf -v
http://www.tomservo.eu/prtconf.txt

Other stuff of interest (from /var/adm/messages)
Code: Select all
Apr  4 15:17:25 bigmclargehuge osscommon: [ID 578250 kern.notice] NOTICE: Forceload error 6
Last edited by Tomservo on Fri Apr 04, 2008 5:59 pm, edited 2 times in total.
Solaris 4 lyfe
Tomservo
 
Posts: 40
Joined: Sat May 05, 2007 8:15 pm

Postby Tomservo » Fri Apr 04, 2008 5:43 pm

Turns out the CMI8788 on the Xonar is not so much the same. The Linux ALSA folks have a seperate driver for the Xonar, based on the existing CMI8788 one. That's kind of strange, because the same time, you can drive it with the regular CMI8788 driver in Windows.
Solaris 4 lyfe
Tomservo
 
Posts: 40
Joined: Sat May 05, 2007 8:15 pm

Postby Tomservo » Sun Apr 06, 2008 5:31 pm

Newer Solaris build (OpenSolaris Developer Preview 2) and the driver now works. There's actually no output at all because it's the wrong DAC, I'm poking with a stick at it, but to no avail yet. I'm taking clues from the ALSA driver, but as of yet, I haven't managed to make it output sound.
Solaris 4 lyfe
Tomservo
 
Posts: 40
Joined: Sat May 05, 2007 8:15 pm

Postby dev » Sun Apr 06, 2008 5:38 pm

Tomservo wrote:Newer Solaris build (OpenSolaris Developer Preview 2) and the driver now works. There's actually no output at all because it's the wrong DAC, I'm poking with a stick at it, but to no avail yet. I'm taking clues from the ALSA driver, but as of yet, I haven't managed to make it output sound.



Hi,

run ossxmix -d1 and see if you can get the AC97 mixer working. Perhaps you need to connect the speakers to the front jacks which are controlled by AC97.




regards
Dev Mazumdar
dev
 
Posts: 576
Joined: Fri Sep 12, 2003 6:08 am
Location: Culver City, CA

Postby cladisch » Mon Apr 07, 2008 8:26 am

Tomservo wrote:The Linux ALSA folks have a seperate driver for the Xonar, based on the existing CMI8788 one. That's kind of strange, because the same time, you can drive it with the regular CMI8788 driver in Windows.

The Windows Xonar driver has been modifed by Asus (without changing the file name); the regular CMI8788 driver wouldn't work.
cladisch
 
Posts: 27
Joined: Mon Apr 07, 2008 8:14 am
Location: Earth

Postby cladisch » Mon Apr 07, 2008 8:28 am

dev wrote:Perhaps you need to connect the speakers to the front jacks which are controlled by AC97.

The only function the AC97 codec has is to route the analog inputs to the ADC.
cladisch
 
Posts: 27
Joined: Mon Apr 07, 2008 8:14 am
Location: Earth

Postby dev » Mon Apr 07, 2008 4:12 pm

cladisch wrote:
dev wrote:Perhaps you need to connect the speakers to the front jacks which are controlled by AC97.

The only function the AC97 codec has is to route the analog inputs to the ADC.


So the regular controls from ossmix (front/rear/etc) have no effect?

We've sent a message to the CMedia guys about the driver. Lets see if they have new info about the Xonar device.


Did you try running osstest and plugging a pair of speakers in each of the output jacks?


regards
Dev
dev
 
Posts: 576
Joined: Fri Sep 12, 2003 6:08 am
Location: Culver City, CA

Postby cladisch » Tue Apr 08, 2008 6:52 am

dev wrote:
cladisch wrote:The only function the AC97 codec has is to route the analog inputs to the ADC.

So the regular controls from ossmix (front/rear/etc) have no effect?

The DACs/ADCs of the AC97 codec are not used at all; its front output is connected to the ADC's input (except when using line-in).

dev wrote:We've sent a message to the CMedia guys about the driver. Lets see if they have new info about the Xonar device.

I'd guess the C-Media guys don't know what changes Asus made to create the Xonar driver.
However, the first AC97 codec is used in almost the same way on C-Media's reference design and on the Xonar cards.
cladisch
 
Posts: 27
Joined: Mon Apr 07, 2008 8:14 am
Location: Earth

Postby Tomservo » Tue Apr 08, 2008 12:13 pm

dev wrote:We've sent a message to the CMedia guys about the driver. Lets see if they have new info about the Xonar device.

dev wrote:Did you try running osstest and plugging a pair of speakers in each of the output jacks?

Tried all the different outputs, even the SPDIF input for fun. Nothing.

I'm currently trying to make it work on my own. I'm trying to initialize the main DAC (which is different from the ones from the other outputs) and apparently this doesn't do anything. Actually, I'm not even sure the SPI writes succeed, because I've made it set all various interface modes and no single beep comes out of it.

Even when not initializing the DAC at all, there's no sound output. According to the datasheets, it should start in standalone mode with full volume and left-justified interface mode up to 24bit. Theoretically, there should be some output. Not sure what's going on here.

The only thing that works right now is enabling the output, because I can hear the relay click.

I guess I'm going to contact the C-Media guys, too, to get some better technical documentation. If that's even possible without signing too much paper work. It would help to know how to do SPI reads to see whether the registers in the DAC are actually set. The public datasheets don't help at all.

(The Xonar D2/D2X use Ti Burr-Brown PCM1796 DACs on all outputs, the Xonar XD uses a CS4398 on front and a CS4362A for all other.)

cladisch wrote:The only function the AC97 codec has is to route the analog inputs to the ADC.

Would any routing set up in the AC97 codec have an effect on the card's ability to output sound? Or is it bypassed?
Solaris 4 lyfe
Tomservo
 
Posts: 40
Joined: Sat May 05, 2007 8:15 pm

Postby cladisch » Wed Apr 09, 2008 7:18 am

Tomservo wrote:I'm not even sure the SPI writes succeed,

SPI writes won't succeed because on this model, the DACs are connected via I²C.

First, you'll have to fix the bugs in the two_wire_write function: it returns without releasing the mutex when the bus is busy, and it shouldn't abort but wait for the bus to become ready (but not with interrupts disabled because I²C writes are rather slow).

Tomservo wrote:The only thing that works right now is enabling the output, because I can hear the relay click.

On the DX, GPIO 8 controls the relay that switches the input jack between line-in and mic-in.

Tomservo wrote:It would help to know how to do SPI reads to see whether the registers in the DAC are actually set.

On the cards that do use SPI (the DX doesn't), the SPI input line isn't connected.

Tomservo wrote:The public datasheets don't help at all.

The register specification is only available under NDA.

Tomservo wrote:Would any routing set up in the AC97 codec have an effect on the card's ability to output sound? Or is it bypassed?

The AC97 codec isn't used for output.
cladisch
 
Posts: 27
Joined: Mon Apr 07, 2008 8:14 am
Location: Earth

Postby Tomservo » Thu Apr 10, 2008 1:41 pm

Yay, I've output on the front. Since it took me three days of poking in the dark (i.e. lack of docs), I'll continue on it this weekend only. Getting the other DAC up should go quickly now. As far as the other Xonar's go, that'll probably end in a theoretical exercise.
Solaris 4 lyfe
Tomservo
 
Posts: 40
Joined: Sat May 05, 2007 8:15 pm


Return to Solaris

Who is online

Users browsing this forum: No registered users and 1 guest