You are not logged in.

#1 2013-07-10 13:12:12

klothius
Member
From: Beograd, Serbia
Registered: 2013-06-05
Posts: 18

OSSv4 with Xonar DX/D1 - everyone with the same combo check in please

Hi all,

one of the reasons I switched to Arch was the support for ossv4. I was thrilled with the sound despite microphone not working, but I stumbled across a problem with playing 192KHz files with vmix off(192KHz out). They would play, but no sound was coming out of the speakers.

I sought help in oss forums and decided to ask a developer about the issue. He acknowledged the problem, but said he didn't have the card to test and that I was free to try to solve it by myself by editing the driver. I didn't know much about registers and such at that time and I had absolutely no free time to check it out. 6 months later, I now have the time and have a bit of knowledge and I decided to take a look.

It seems the problem was with the functional mode being set to single-speed. Putting it in double-speed mode seems to have fixed the issue (yeey!).

But the problem is, I can't report it upstream as I'm not 100% sure that it works ok with everyone or it was a weird combination of things that led to this solution, so I'm asking anyone with the same card(s) and ossv4 sound system if they, too, have the issue with 192KHz files and if they are willing to test out a new driver/edit themselves the driver and report back.

For those who are willing to build the driver and relink it by themselves, the fix :

static void
cs4398_init (cmi8788_devc *devc, int codec_addr)
{

  /* Fast Two-Wire. Reduces the wire ready time. */
  OUTW(devc->osdev, 0x0100, I2C_CTRL);

   /*Power down, enable control mode.
    i2c_write(devc, codec_addr, CS4398_MISC_CTRL, 
    CS4398_CPEN | CS4398_POWER_DOWN);
   /*
   * Left justified PCM (DAC and 8788 support I2S, but doesn't work.
   * Setting it introduces clipping like hell).
   */

/************* this was changed from 0 -> 0x01 or setting it to 01 for the first two bits that set functional mode (00 is single, 01 is double...10 is quad, but it doesn't work for lower sampling rates(at least not for me) - don't try it in vein)**********/
  i2c_write(devc, codec_addr, CS4398_MODE_CTRL, 0x01); 

  /* That's the DAC default, set anyway.  */
  i2c_write(devc, codec_addr, 3, 0x09);
  /* PCM auto-mute. */
  i2c_write(devc, codec_addr, 4, 0x82);
  /* Vol A+B to -64dB. */
  i2c_write(devc, codec_addr, 5, 0x80);
  i2c_write(devc, codec_addr, 6, 0x80);
  /* Soft-ramping. */
  i2c_write(devc, codec_addr, 7, 0xF0);
  /* Remove power down flag. */
  i2c_write(devc, codec_addr, CS4398_MISC_CTRL, CS4398_CPEN);
}

This function can be found in kernel/drv/oss_cmi878x/oss_cmi878x.c


For those that don't want/don't know how to rebuild the driver - https://dl.dropboxusercontent.com/u/779 … _cmi878x.o - this file goes to /usr/lib/oss/modules.regparm/
then go to /usr/lib/oss/build and execute install.sh to relink the modules again (you have to do soundoff and soundon to reload the modules).

Any questions will be answered in shortest time possible.

Thank you for your help :)

EDIT : Btw this is all with vmix disabled to allow it to play with native sampling rate instead of resampling it(or you could try with ossplay -R file.wav (aiff, wav are supported)).

Last edited by klothius (2013-07-10 18:29:35)

Offline

#2 2013-07-14 15:33:37

klothius
Member
From: Beograd, Serbia
Registered: 2013-06-05
Posts: 18

Re: OSSv4 with Xonar DX/D1 - everyone with the same combo check in please

So noone is interested in this? Can't be that I'm the only one listening to 192KHz stereo music with vmix off (no resampling, sound going straight to card) hmm

Btw if there is really someone interested, I must note that this is only for front channel DAC (CS4398) as I only have a stereo system. I don't know if there's also a problem with other channels (they use different DAC - CS4362), but I would guess that it should, too, be placed in dual speed mode for oversampling, but that would require someone who really uses those other channels.

Also, as I like to listen to loud music, I noticed that my amp's relay is firing when I stop the music if the volume on the amp is loud. I first thought it might be my amp acting up, but I then realized that the card produces a 'pop' when stopping playback and that it didn't happen on Windows or when using ALSA. Solution for it is easy, too, it involves placing A and B channels on mute via registers while the audio_trigger functions does it's job(turning on/off interrupts and dma) and unmuting it after a some delay - note this is only, again, for front channels (DAC CS4398) - I don't use other channels. If anyone is interested in a solution/fix, pm me or send me an email smile

If you don't have 192KHz files or don't know how to disable vmix or both, but you have the card, ossv4 and are willing to test, write here, pm me or whatever and I'll be glad to help smile

Last edited by klothius (2013-07-14 15:36:48)

Offline

Board footer

Powered by FluxBB