darkness

Saturday, 02 July 2005

Problem with ES1371, ALSA, Linux, FC4

darkness @ 23:20:55

I mention all that stuff because I have no idea what is really to blame here.

I noticed, with headphones (and presumably with any other output devices, such as my speakers) I was getting noise in my left channel. I figured it was this old Ensoniq AudioPCI (which I tend to call a SB32PCI, right or wrong) going out. Weird thing was, the noise was vaguely distinguishable as whatever was playing in XMMS, but I’d hear it even when I muted the master mixer, and most everything else. How could I be picking up audio signals… that were only in the card, and presumably not even hitting the DAC (if I understand how these things work)?

For fun, though, I popped up the GNOME volume control applet, enabled every single control I could in Preferences, and started muting and clicking on all sorts of things. Imagine my surprise when, by unselecting “IEC958 2” the noise magically went away. Apparently, IEC958 is S/PDIF. Next weird thing is… I don’t think this card supports digital output.

Metacity/X11 hacking

darkness @ 16:45:50

I’ve got another patch done (?) for Metacity. Old behavior:

  1. Press Alt.
  2. Press and release Tab. Next candidate window to receive focus is raised (“candidate window”). Assume the candidate window is Emacs.
  3. Press the ‘x’ key.

Results: focus is not changed (stays with the window that had focus when you pressed Alt). Alt-x (M-x, Emacs fans) keystroke is lost.

With my patch, the candidate window receives focus, and receives the M-x keystroke. This seems to work without problem, but I haven’t even been using it for 24 hours. I also end up generating a synthetic event for this keystroke, rather than using XAllowEvents(ResyncKeyboard), which is what I suspect I’m supposed to use. If it ain’t broke, though…

Now I’m moving on to another problem that’s irking me. I really want Metacity to give focus to windows as it cycles to them. I’m not sure what the answer to this puzzle is.

I have learned a little bit about debugging in X11, though. First of all, the friendly xev, which you might be familiar with if you’ve ever played with your keyboard configuration extensively, has a feature I didn’t know about. When you just run xev it pops up its own window and shows you all the events that window receives. However, xev will also (try to) show you the events from another window. Use xwininfo and click on a window. One of the first lines you’ll get should be something like:

xwininfo: Window id: 0x26000d7 "emacs-x@darkbook.caliginous.net"

Continuing with that example output, you’d run xev -id 0x26000d7. Now xev is showing me the events from my Emacs window.

However, at some point I stopped seeing KeyRelease events from my Emacs window, and I really wanted to test the patch discussed above with Emacs and M-x. I dug around a little more and found mention of “xscope.” I’m not sure xscope was ever made for X11R6 (I think you can find it for X11R5 on ftp.x.org in a contrib directory) and I’m not sure if I’m brave enough to try compiling it on my FC4 system, anyway. Sometimes mentioned in the same breath, though, was “xmon.”

You can get xmon here. It compiled under FC4 with only one error: it bitches about a prototype mismatch in xmon’s sources. Delete the prototype from xmon’s sources and the rest works fine. xmon only works with TCP sockets, and FC4 has them disabled by default. Set DisallowTCP=false (isn’t it some kind of rule that an option should never be phrased in the negative? Why not AllowTCP=false as the default?) in /etc/X11/gdm/gdm.conf (assuming you’re using gdm) and then init 3 wait init 5. I couldn’t get gdm to see these settings without changing run levels like that. Next xhost +localhost. Now you can theoretically run something like ./xmonui | ./xmond, then connect client to it with stuff like emacs -display localhost:1. xmonui has some semi-nice controls for controlling what xmond spits out to the terminal it’s running on. The difference in architecture between xev and xmon, as you might have noticed, is that xev somehow attaches to an application to get a copy of its events (?), whereas xmon actually looks like an X server, and thus sits between all communications between the client and the server.

Another miscellaneous tool I found from reading Metacity documentation is xprop. Run it, click on a window, see all properties it has defined. Kind of neat, probably quite useful for people doing deep window manager development, among other X11-related activities.

Side note: BIEW is a pretty nice looking hex editor with disassembler built in. TTY-based. If it opens large files, or even block devices, without trying to load the whole thing into memory, I’m in heaven.

« Previous Page

Powered by WordPress