BlackBeast Mark III's audio woes

I have a venerable history of difficulty with digital audio with my Linux systems. I haven't quite given up, but I'm now thinking hard about reverting to analogue. I was initially describing my latest batch of mis-adventures as a diary entry, but decided that would be too boring so I'm going to document them here instead.

The problem?

From time to time, Linux forgets it has a Creative PCI-attached X-Fi soundcard — connected via optical digital fibre to the Audiolab pre-amp at the other end of the living room. Instead, it reverts to using the digital audio output from the Radeon graphics card. And since the only connection from this graphics card is the DisplayPort that I use to drive my 34" Dell desktop screen, the sound therefore now starts coming out of the tinny little speakers that the Dell has. Nor, once it has "forgotten" about the X-Fi soundcard does it let me re-select it. The PCI still knows about it, but not alsasound. Until I restart or reboot the entire PC.

I have not yet pinpointed exactly what causes the X-Fi to go AWOL, but it often seems to happen in conjunction with any attempt to play an audio or video clip from a web page (for which I use Chrome rather than fiddling about with installing Flash on my main [Firefox] web browser). For example, I found a sound clip of an interview between Simon Mayo and Sofia Helin from a BBC Radio 2 Drive Time programme. Click to play it in Firefox... Silence, plus a pop-up saying "You need Flash Player". Fire up Chrome, paste in the same URL, clip starts playing perfectly... but through the tinny speakers of my Dell screen, and not through my hi-fi via the SP/DIF optical digital output of my Creative X-Fi soundblaster. It's again castors-up.

Last time it was working I took the precaution of capturing the reported status from both the PCI hardware and the audio system. By re-capturing those states after the X-Fi failure I can see that (lspci) shows the X-Fi is still known to Linux. And (aplay -l) shows only the "Cape Verde/Pitcairn HDMI Audio" that's baked into the Radeon graphics card. The audio subsystem, somewhere, has fallen in a heap but (I hope) without disabling my ability to start it up again without the wholesale Linux reboot that I also know works. But which isn't always convenient, obviously. So I tried:

pulseaudio -k && sudo alsa force-reload

to kill off and reload just the audio subsystem. It "almost" worked. Grrr. Time to restart. Then to reselect the (once more visible) X-Fi card. That worked. It will have to do for now. Looking back, I cannot recall a Linux system since 2007 that wasn't a PITA with one aspect or another of its (digital) audio. Still, when it all works it sounds grand. I blame those pesky users.

I've long since given up...

... trying to get both video and audio reliably on to both the 60" Kuro plasma display and the hi-fi at the same time since the interactions with my PC desktop display were maddening enough under Windows without risking upsetting or destabilising a working Linux system. So the "problem" should reduce to the simple conveying of my PC's digital audio output (via optical cable or HDMI) to the hi-fi system at the other end of my living room. And that should only need one simple digital connection, should it not? I don't really care whether I use optical digital or HDMI, either. I just want whichever one I use to work 100% of the time, dagnabbit. What could be simpler?

I have a spare HDMI input...

... on my Audiolab pre-amp1 so it's perfectly sensible to use it to connect the digital audio coming out of BlackBeast Mk III via HDMI. Or so one might think. The Audiolab pre-amp supposedly strips any high-resolution audio out of the signal and simply passes any video along to the next item in the chain (which is presumed to be an hdcp-compliant display). The Audiolab, when used in this way under Windows, certainly reported itself as an hdcp-compliant "IAG Repeater".

But, from the symptoms — a blanked screen — connecting via HDMI may be bringing hdcp into play. Or (at least equally likely) it may just be that I have failed to configure my display correctly under Linux. Either way, the current result is no audio on the hi-fi plus no picture on the Dell desktop screen. Worst of both worlds. That's using the HDMI output on the same graphics card alongside the DisplayPort output that's driving the Dell.

Using the HDMI output on the motherboard produces no audio, but at least it doesn't blank the Dell display. In other words, it seems that disabling motherboard graphics in the BIOS (when I first fitted the graphics card after getting the 34" Dell) did indeed also disable motherboard audio. Needless to say, the optical digital signal coming via the Creative X-Fi soundcard has remained constantly available throughout these annoying experiments... Mocking me.

I've hooked up...

... my spare 27" Asus screen to the Audiolab's HDMI output, and connected the Audiolab's HDMI2 input directly to BlackBeast's HDMI output on the graphics card. In theory, BB now therefore has a second PC display screen with its main screen still being the 34" Dell (still connected via DisplayPort). This certainly produces results — just not the ones I'd prefer to see:

  1. Selecting HDMI2 on the Audiolab wakes up the Asus screen, proving that some sort of display handshake gets through the Audiolab and into the second screen
  2. My 34" Dell desktop now goes blank for a couple of seconds, then comes back, but with a broken display, and then re-blanks
  3. The Asus now goes blank in sympathy
  4. The Dell desktop returns with a normal display
  5. The Asus wakes up
  6. Rinse and repeat steps "2" through "5" until I get bored and disconnect the Asus from the Audiolab

At this point, I confidently expect "things" to go back to "normal" for my 34" Dell. They don't. Until I also disconnect the Audiolab from BlackBeast the Dell display (although no longer going blank, or breaking up its display) becomes very sluggish in its response to (for example) stuff that I type at the keyboard. It now takes about a second between typing a character and seeing that character appear on the Dell. If I didn't know any better, I might think that a brain-dead hdcp protocol handshake is crawling up the HDMI lead to the Audiolab, finding no route there to a screen for its video signal to display on, and crawling back to the PC to whinge about it and takes its mind off attending to my typing.

A day of discovery

Len wrote an excellent summary of our "progress" in diagnosing what was (and was not) going on. Largely for the benefit of the absent guru whose experience with a diverse set of sound cards and their control under Linux exceeds ours:

  1. We got nowhere investigating the odd problems with the X-Fi. I could not reproduce the failure and there was nothing obvious in the logs, but it is difficult to dig back days without something dramatic to flag the issue so I didn't try very hard (just while David was making tea).
  2. The problems David had with screens switching off etc when he ran an HDMI lead to the Audiolab are the fault of the Audiolab, which does not handle HDCP at all well. The thing is a more-than-competent audio preamp but is a disaster as an A/V device.
  3. David brought down a Marantz A/V amp (doesn't everyone have a spare A/V amp or two knocking around?). To cut a long story short you can connect that to BlackBeast with HDMI without anything untoward happening and the video is passed through to any attached screen. Not having a screen does not cause problems. However, you cannot get any sound until you disable the DisplayPort screen also attached to the ATI soundcard. Examining the output of "pactl list" indicates that "port 0" is the sound channel for the ATI DP interface and "port 1" is for the HDMI. The default pulseaudio output is to "sink4" which appears to correspond to "port 0". At this point we were running out of time, energy and courage. I am sure that pacmd (plus possibly some judicious config file editing) should be able to make the HDMI output the default but the syntax is arcane so we called it a day.
  4. It appears it should be possible to move to an HDMI-centric configuration using the Marantz instead of the Audiolab. We have pulled the X-Fi out of BlackBeast because in such a setup it plays no part and it tends to confuse the issue by grabbing the audio output device status when you don't want it to (as opposed to disappearing when you do). David is currently rebuilding the hi-fi system around the Marantz and assuming that is satisfactory we can plug the HDMI from BlackBeast into the system as soon as we can figure out how to make it the default output sink

Footnote

1  In truth both its HDMI inputs are now spare since the demise of my latest cheap digisat-left-tuned-to-NPR box.