LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Gentoo (https://www.linuxquestions.org/questions/gentoo-87/)
-   -   Creative Audigy 2 ZS (https://www.linuxquestions.org/questions/gentoo-87/creative-audigy-2-zs-742439/)

elprawn 07-24-2009 06:25 AM

Creative Audigy 2 ZS
 
Dear members,

I have had a problem quite a while with the remote controls used for the title-listed soundcard. Some while ago, I successfully got the use of both the remote control's and the external control panel's buttons via lirc, on my Gentoo 2008 installation.

It was set up to allow the controls to do things such as starting Kaffeine, or changing the kmix volume via dcop.

Now, however, I have the strange scenario whereby it will not work if I boot my computer straight into Linux, but if I start up in Windows first, restart the computer, then choose Linux, everything works perfectly.

What may be causing this nuisance and how may it be resolved?

Yours Faithfully,

elprawn.

P.S. Thanks for your time.

NathanZachary 08-01-2009 05:25 PM

Hi,

Firstly, I'm going to report this post and ask that it be moved to the Gentoo subforum as you might get a better response there. Secondly, could you please post a little more information regarding your system? For instance, are you using ALSA? Also, does your sound work when you boot straight into Linux, or does that fail as well?

elprawn 08-04-2009 11:26 AM

I'm using ALSA, yes, but it's unrelated, really. ALSA works perfectly. It's the remote control units that I'm having problems with and as far as lirc is concerned they have nothing to do with sound even though in this circumstance it's the one from my sound card I'm using. I'm using the volume control for just that, but I use other buttons for opening programs and issuing them commands.

lirc is running and looks on the surface to be working perfectly but the buttons do nothing unless I follow the pattern specified above. irw won't see the button presses unless I restart from windows first, either. It's as if Windows activates something in the soundcard that Linux doesn't. It seems to turn on the remote unit, if you will, whereas Linux won't, but will see it if Windows has already done so.

Thanks for the help.

elprawn 08-05-2009 10:24 AM

Well, anyone looking for a solution, here it is...

Quote:

Hi,

Until now I wasn't able to make my remote work.
While posting in the EMU10K1 devel mailing list, someone said that it was necessary to
"initialize" the MIDI device used by the remote. A SysEx sequence has to be send to
'/dev/snd/midiC0D1'. The sequence is '0xf0, 0x00, 0x20,0x21, 0x61, 0x0, 0x00, 0x00,
0x7f, 0x0, 0xf7'.

The source code bellow is of a program that does just that. After modprobing the
modules with the correct options (the options are the same as the Platinum), just run
this prog to "initialize" the midi device. Voi-lá! The remote works! I think this is
an ugly hack. I'm sure that this can be implemented in the driver itself. Remember
that this "initialization" is only required by the Audigy 2 Platinum eX.


Hope this helps.



Miguel Duarte



Code:


//
// Programmer:    Craig Stuart Sapp [EMAIL PROTECTED]
// Creation Date: Mon Dec 21 18:00:42 PST 1998
// Last Modified: Mon Dec 21 18:00:42 PST 1998
// Filename:      ...linuxmidi/output/method1.c
// Syntax:        C
// $Smake:        gcc -O -o devmidiout devmidiout.c && strip devmidiout
//

#include <linux/soundcard.h>
#include <unistd.h>
#include <fcntl.h>
#include <stdio.h>

int main(void) {
  char* device =  "/dev/snd/midiC0D1" ;
  unsigned char data[11] = {0xf0, 0x00, 0x20, 0x21, 0x61, 0x0, 0x00, 0x00,
0x7f, 0x0, 0xf7};

  // step 1: open the OSS device for writing
  int fd = open(device, O_WRONLY, 0);
  if (fd < 0) {
      printf("Error: cannot open %s\n", device);
      exit(1);
  }

  // step 2: write the MIDI information to the OSS device
  write(fd, data, sizeof(data));

  // step 3: (optional) close the OSS device
  close(fd);

  return 0;
}


OR Enter this at the console...

echo -e '\xf0''\x00''\x20''\x21''\x61''\x00''\x00''\x00''\x7f''\x00''\xf7' > /dev/snd/midiC0D1


All times are GMT -5. The time now is 08:27 PM.