You are not logged in.

#1 2014-10-18 10:43:19

deltasquared
Member
Registered: 2014-09-12
Posts: 12

No audio using alsa on HDMI until Xorg is started

(Before I start, I'm not sure if this problem belonged here (hardware stuff) or in the apps/desktops section, as it seems to be a little of both.)

I have recently noticed a strange problem with the HDMI audio on my Radeon HD 5450. Normally I do most of my day-to-day stuff in Xorg, and I can hear sound no problem from the speakers built into my HDMI monitor. However, one day I was bored so I decided to play some noise from /dev/urandom using aplay. This time around I hadn't yet started Xorg (I log in at the console then use startx), but I would expect that alsa would still work correctly.

This was not the case. aplay appeared to be playing audio ("Playing raw data '/dev/urandom' : Unsigned 8 bit, Rate 8000 Hz, Mono") but the expected noise was not coming from my speakers. Thinking this was odd, I then Ctrl-C'd and ran startx, then ran aplay again from within an xterm. Then the noise was perfectly audible.

Strangely enough, if I launch then exit Xorg, audio continues to run fine. I decided to try the same steps using weston first *after a reboot* to see if something similar happened (my reasoning being modesetting of HDMI could affect the audio going over the wire). But if weston is started after a boot without running Xorg first, again I cannot hear anything. I closed weston and ran Xorg again, sound comes back - and closing *that* then going back to weston again yields working sound.

After testing other HDMI displays such as TVs and still getting the same result, I can only conclude that something that Xorg does when it fires up knocks the HDMI sound output into working correctly. It doesn't matter what combination of programs I run beforehand - HDMI sound only starts working after running Xorg for the first time.

I'm out of ideas here, so any help would be appreciated.

PS: Some preempt questions:
No, I haven't modified Xorg config in relation to graphics - I've only added a config to enable 3 button mouse emulation on this mouse I have, and said config file has never caused problems.
No, I haven't modified alsa's base config either - the only thing I've configured is the default sub-device for my HDMI card, as the "default" alsa device is set to /dev/snd/pcmC0D0p whereas the HDMI card only presents /dev/snd/pcmC0D3p; a simple line of "defaults.pcm.device 3" fixed that. I was given that snipped in a previous thread, and I was also informed that this is normal and not a bug, so I don't think this quirk has anything to do with this problem.
Yes, I will provide logs if you tell me what to look for; I don't want to drop a wall-of-text on this thread, so I'll try and isolate the interesting parts.

Offline

#2 2014-10-21 17:31:05

deltasquared
Member
Registered: 2014-09-12
Posts: 12

Re: No audio using alsa on HDMI until Xorg is started

Looks like this is a thorny issue indeed...

Anyhow, after doing some digging around, I have a couple of pointers that might ring some bells for people - anything you can suggest at all would be helpful at this stage!

* This problem still occurs when I switch out xf86-video-ati for -modesetting, so it's not a DDX doing something strange. That said, I'm pretty sure nowadays the ati DDX (and others) utilise the dri nodes anyway, except from a few brand-specific tweaks thrown in.

* I noticed (after stumbling upon an ubuntu help thread) that the HDMI-0 output has a '--set audio on|off' option. Setting it off does what you'd expected, applications appear to be playing audio but no sound is actually emitted. Most notably, toggling this option causes the display to blank briefly, something normally associated with a video modeset - which makes me think that it *IS* related to Xorg's init somehow, in that Xorg explicitly sets this on, whereas simpler display servers (like weston) don't do this. (I reckon it's a bug that HDMI audio is default disabled.)

Considering that last point, I wonder if there's a way of toggling HDMI audio output without xrandr (which expects Xorg to be directly talking to the display tongue )?

delta

Offline

Board footer

Powered by FluxBB