View Full Version : x86_64 hdmi audio
forum1793
06-25-2009, 09:07 PM
Radeonhd has allowed sound over hdmi for a while now (thanks to Christian).
But recently when trying x86_64 (64 bit) I noticed it didn't work.
I did recently get fglrx to output over hdmi on the 64 bit so I'm curious if radeonhd can do that also.
Using radeonhd here is the last messages from dmesg:
[drm] Resetting GPU
[drm] Setting GART location based on new memory map
[drm] Loading RS780 CP Microcode
[drm] Loading RS780 PFP Microcode
[drm] Resetting GPU
[drm] writeback test succeeded in 1 usecs
nepomukservices[6396]: segfault at 8 ip 00007f06a69857ae sp 00007fffaef85830 error 4 in libQtCore.so.4.5.1[7f06a6921000+23a000]
hda-intel: IRQ timing workaround is activated for card #1. Suggest a bigger bdl_pos_adj.
Note I get the same hda-intel message using flgrx with sound over hdmi working.
Zajec
06-26-2009, 05:33 AM
I would be nice to understand what causes this problem. I don't think it's something between x86 and x86_64. Are you sure you are using the same kernel, alsa and radeonhd in your new x86_64, when comparing to x86?
Maybe some app is in lower version, or maybe newer with regression? Is this the same version of radeonhd?
In other case Xorg.0.log and xorg.conf will be more interesting than dmesg output. Provide this as a good start, later maybe you'll be asked to provide registers dumps.
forum1793
06-26-2009, 07:42 AM
Exact same 64 bit environment between fglrx and radeonhd. Kernel used is 2.6.27.25 as I couldn't install catalyst with 2.6.29 or 2.6.30. Other than the kernel, the rest is from slackware64-current which has qt4 and kde4 but also kde3 libs from extra (subdirectory on disk).
Between 64 bit and 32 bit: using slackware-current (32 bit), using slightly different kernel (2.6.27.15 which I'm also using with slackware-12.2). Both fglrx and radeonhd output audio over hdmi.
Hardware, if I didn't say previously is the gigabyte with integrated hd3200 (780g). I think its GA-MA78GM-S2H (I'm not sure what rev as it looks like they have 1.0, 1.1, and now 2.0).
64 bit radeonhd xorg.confSection "ServerLayout"
Identifier "Simple Layout"
Screen "Screen 1"
InputDevice "Mouse1" "CorePointer"
InputDevice "Keyboard1" "CoreKeyboard"
EndSection
Section "Files"
# many font lines removed for relevance
EndSection
Section "Module"
SubSection "extmod"
Option "omit xfree86-dga" # don't initialise the DGA extension
EndSubSection
EndSection
Section "InputDevice"
Identifier "Keyboard1"
Driver "kbd"
EndSection
Section "InputDevice"
Identifier "Mouse1"
Driver "mouse"
Option "Protocol" "Auto"
Option "Device" "/dev/mouse"
Option "ZAxisMapping" "4 5"
EndSection
Section "Monitor"
Identifier "vizio"
EndSection
Section "Device"
Identifier "RadeonVid"
Driver "radeonhd"
Option "HDMI" "all"
Option "AccelMethod" "EXA"
Option "DRI" "on" #xorg log says on per default
EndSection
Section "DRI"
Mode 0666
EndSection
Section "Screen"
Identifier "Screen 1"
Device "RadeonVid"
Monitor "vizio"
DefaultDepth 24
SubSection "Display"
Depth 24
# Virtual 1920 1400
EndSubSection
EndSection
32 bit radeonhd xorg.conf is identical except for the following
Section "Device"
Identifier "RadeonVid"
Driver "radeonhd"
# Option "monitor-VIZIO" "vizio" #xorg.log says not used
# Option "HDMI" "all" #xorg.log says not used
EndSection
Section "DRI"
Group "video"
Mode 0660
EndSection
Relevant parts of fglrx xorg.confSection "ServerLayout"
Identifier "Simple Layout"
Screen 0 "aticonfig-Screen[0]" 0 0
InputDevice "Mouse1" "CorePointer"
InputDevice "Keyboard1" "CoreKeyboard"
EndSection
Section "Monitor"
Identifier "aticonfig-Monitor[0]"
Option "DPMS" "true"
EndSection
Section "Device"
Identifier "aticonfig-Device[0]"
Driver "fglrx"
Option "VideoOverlay" "off"
Option "OpenGLOverlay" "off"
Option "TexturedVideo" "on"
EndSection
Section "Screen"
Identifier "aticonfig-Screen[0]"
Device "aticonfig-Device[0]"
Monitor "aticonfig-Monitor[0]"
DefaultDepth 24
SubSection "Display"
Viewport 0 0
Depth 24
EndSubSection
EndSection
Zajec
06-26-2009, 08:32 AM
# Option "HDMI" "all" #xorg.log says not usedIt's needed, and I don't know why Xorg.0.log could tell you it is not used... Maybe you were using radeon or very old radeonhd for a moment?
Please, add this to your config and test. You may also want to specify that "all" value to something like:Option "HDMI" "DVI-D_1". Values may be single outputs names from randr.
forum1793
06-26-2009, 06:53 PM
It's needed, and I don't know why Xorg.0.log could tell you it is not used...
But what you missed was that code was from the radeonhd 32 bit xorg.conf which is outputting sound nicely over hdmi.
When Christian first added the changes to allow sound over hdmi, this option was needed. I think once he added it to master, it was used per default and so was not explicitly needed in the xorg.conf.
I think I added it back and then commented out as I was trying different things with the more recent gits for drm, mesa, and radeonhd.
The "all" function has worked for the 32 bit environment in past and I don't know why dvi would be used for integrated hdmi. But it won't hurt me to try. I will also try with commenting out the option to more closely match the successful 32 bit version.
Thanks
forum1793
06-26-2009, 06:56 PM
Not sure if git branches I choose might be factor. For recent gits I am using the following branches.
drm -> agd5f's 3d
mesa -> r6xx-rewrite
radeonhd -> master
ati -> master
If these are not optimum for hd3200 please let me know.
forum1793
06-26-2009, 08:58 PM
Huh, with fresh compile of gits, it started working. Not sure why.
Would pointing radeonhd git at r6xx-r7xx-support as opposed to master cause this?
For me and with gits as specified above (radeonhd->master), all that seems to be needed for audio over hdmi on 64 bit is:
Section "Device"
Identifier "RadeonVid"
Driver "radeonhd"
Option "HDMI" "all"
EndSection
Tried it without the Option "HDMI" "all" and no sound.
Edit: Yes, xrandr does show "DVI-D_1". Using Option "HDMI" "DVI-D_1" also works. Now I'll have to go back and try this on the 32 bit.
bridgman
06-26-2009, 09:12 PM
radeonhd 6xx-7xx-support is probably missing a bunch of recent work
EDIT - yep, it branched off 6 months ago and last commit was 4 months ago so if you were pointing there you would be missing a lot
forum1793
06-26-2009, 10:20 PM
OK, recompiled all gits as above in the 32 bit and sound works over hdmi and requires option hdmi all, or dvi... as stated above. So both 64 bit and 32 bit now seem consistent.
Was looking at xorg.0.log and saw dri was working so I tried glxinfo and it worked. Then tried glxgears and hard lock. Only power button worked (and of course power switch) worked.
I'll try these (hdmi audio) with 2.6.29 and 2.6.30 kernels next.
forum1793
06-26-2009, 10:51 PM
Loaded 2.6.29.5 (slackware-current generic) with everything the same as above. Sound over hdmi works.
But, dri fails and windows move very slowly. Xorg.0.log shows:
...
(II) Setting vga for screen 0.
(**) RADEONHD(0): Depth 24, (--) framebuffer bpp 32
(**) RADEONHD(0): Option "AccelMethod" "EXA"
(**) RADEONHD(0): Option "DRI" "on"
(**) RADEONHD(0): Option "HDMI" "all"
(**) RADEONHD(0): Selected EXA 2D acceleration.
(II) RADEONHD(0): Unknown card detected: 0x9610:0x1458:0xD000.
If - and only if - your card does not work or does not work optimally
please contact radeonhd@opensuse.org to help rectify this.
Use the subject: 0x9610:0x1458:0xD000: <name of board>
and *please* describe the problems you are seeing
in your message.
(--) RADEONHD(0): Detected an RS780 on an unidentified card
(II) RADEONHD(0): Mapped IO @ 0xfdfe0000 to 0xb7a56000 (size 0x00010000)
(II) RADEONHD(0): Getting BIOS copy from legacy VBIOS location
(II) RADEONHD(0): ATOM BIOS Rom:
SubsystemVendorID: 0x1002 SubsystemID: 0x1002
IOBaseAddress: 0xee00
Filename: MA78M_S2H_HD
BIOS Bootup Message:
B27721 RS780 DDR2 200e/500m
(II) RADEONHD(0): Analog TV Default Mode: 1
(II) RADEONHD(0): Found default TV Mode NTSC
(--) RADEONHD(0): VideoRAM: 262144 kByte
(II) RADEONHD(0): Framebuffer space used by Firmware (kb): 16
(II) RADEONHD(0): Start of VRAM area used by Firmware: 0xfffc000
(II) RADEONHD(0): AtomBIOS requests 16kB of VRAM scratch space
(II) RADEONHD(0): AtomBIOS VRAM scratch base: 0xfffc000
(II) RADEONHD(0): Default Engine Clock: 500000
(II) RADEONHD(0): Default Memory Clock: 400000
(II) RADEONHD(0): Maximum Pixel ClockPLL Frequency Output: 1200000
(II) RADEONHD(0): Minimum Pixel ClockPLL Frequency Output: 0
(II) RADEONHD(0): Maximum Pixel ClockPLL Frequency Input: 13500
(II) RADEONHD(0): Minimum Pixel ClockPLL Frequency Input: 1000
(II) RADEONHD(0): Maximum Pixel Clock: 400000
(II) RADEONHD(0): Reference Clock: 14320
(WW) RADEONHD(0): Direct rendering for R600 and up forced on - This is NOT officially supported yet and may cause instability or lockups
(II) RADEONHD(0): Found libdri 5.4.0.
drmOpenDevice: node name is /dev/dri/card0
drmOpenDevice: open result is -1, (No such device)
drmOpenDevice: open result is -1, (No such device)
drmOpenDevice: Open failed
drmOpenByBusid: Searching for BusID pci:0000:01:05.0
drmOpenDevice: node name is /dev/dri/card0
drmOpenDevice: open result is -1, (No such device)
drmOpenDevice: open result is -1, (No such device)
drmOpenDevice: Open failed
drmOpenByBusid: drmOpenMinor returns -19
drmOpenDevice: node name is /dev/dri/card1
drmOpenDevice: open result is -1, (No such device)
drmOpenDevice: open result is -1, (No such device)
drmOpenDevice: Open failed
drmOpenByBusid: drmOpenMinor returns -19
drmOpenDevice: node name is /dev/dri/card2
drmOpenDevice: open result is -1, (No such device)
drmOpenDevice: open result is -1, (No such device)
drmOpenDevice: Open failed
...
drmOpenByBusid: drmOpenMinor returns -19
drmOpenDevice: node name is /dev/dri/card0
drmOpenDevice: open result is -1, (No such device)
drmOpenDevice: open result is -1, (No such device)
drmOpenDevice: Open failed
drmOpenDevice: node name is /dev/dri/card0
drmOpenDevice: open result is -1, (No such device)
drmOpenDevice: open result is -1, (No such device)
drmOpenDevice: Open failed
drmOpenDevice: node name is /dev/dri/card1
drmOpenDevice: open result is -1, (No such device)
drmOpenDevice: open result is -1, (No such device)
drmOpenDevice: Open failed
...
drmOpenDevice: node name is /dev/dri/card14
drmOpenDevice: open result is -1, (No such device)
drmOpenDevice: open result is -1, (No such device)
drmOpenDevice: Open failed
(EE) RADEONHD(0): RHDDRIVersionCheck: drmOpen("radeon", "pci:0000:01:05.0") failed.
(WW) RADEONHD(0): RHDDRIPreInit: Version check failed. Disabling DRI.
...
(II) RADEONHD(0): Attempting to enable power management
(WW) RADEONHD(0): RHDCSInit: CS for R600 requires DRI.
(WW) RADEONHD(0): Failed to initalize EXA; disabling acceleration.
(==) RADEONHD(0): Backing store disabled
I'll try 2.6.30 next.
bridgman
06-26-2009, 11:06 PM
2.6.29 is not a nice place to be; it's too new for the drm code in freedesktop.org, and too old to have the 6xx/7xx drm code already there
2.6.30 is your friend, although not for 6xx/7xx 3d I guess - for that you'll want to stay with 2.6.28 for a bit longer. Once we get the userspace running better we should be able to merge the drm support into the kernel.
2.6.30 should work for EXA and Xv but not for 3D.
forum1793
06-27-2009, 12:18 AM
I just finished loading/compiling this with the 2.6.30 for 32 bit and you are right.
compiling drm (agd5f's) didn't work. Error is:linux-core/drm_os_linux.h:54: error: conflicting types for 'irqreturn_t'
include/linux/irqreturn.h:16: error: previous declaration of 'irqreturn_t' was here
But if a lot of drm now in 2.6.30 kernel I guess this is not surprising. Compiling the other (mesa and ati and radeonhd) worked.
Audio over hdmi worked with same xorg.conf and windows were pretty quick I guess indicating EXA is working.
(WW) RADEONHD(0): Direct rendering for R600 and up forced on - This is NOT officially supported yet and may cause instability or lockups
(II) RADEONHD(0): Found libdri 5.4.0.
drmOpenDevice: node name is /dev/dri/card0
drmOpenDevice: open result is -1, (No such device or address)
drmOpenDevice: open result is -1, (No such device or address)
drmOpenDevice: Open failed
drmOpenByBusid: Searching for BusID pci:0000:01:05.0
drmOpenDevice: node name is /dev/dri/card0
drmOpenDevice: open result is 10, (OK)
drmOpenByBusid: drmOpenMinor returns 10
drmOpenByBusid: drmGetBusid reports pci:0000:01:05.0
(II) RADEONHD(0): Found libdrm 1.3.0.
(II) RADEONHD(0): Found radeon drm 1.30.0.
(II) Loading sub module "i2c"
(II) LoadModule: "i2c"
...
(II) RADEONHD(0): Mapped IO @ 0xfdfe0000 to 0xb7a15000 (size 0x00010000)
(II) RADEONHD(0): Mapped FB @ 0xd0000000 to 0xa7963000 (size 0x10000000)
(II) RADEONHD(0): Current Engine Clock: 494040
drmOpenDevice: node name is /dev/dri/card0
drmOpenDevice: open result is 10, (OK)
drmOpenDevice: node name is /dev/dri/card0
drmOpenDevice: open result is 10, (OK)
drmOpenByBusid: Searching for BusID pci:0000:01:05.0
drmOpenDevice: node name is /dev/dri/card0
drmOpenDevice: open result is 10, (OK)
drmOpenByBusid: drmOpenMinor returns 10
drmOpenByBusid: drmGetBusid reports pci:0000:01:05.0
(II) [drm] DRM interface version 1.3
(II) [drm] DRM open master succeeded.
(II) RADEONHD(0): [drm] Using the DRM lock SAREA also for drawables.
(II) RADEONHD(0): [drm] framebuffer handle = 0xd0000000
(II) RADEONHD(0): [drm] added 1 reserved context for kernel
(II) RADEONHD(0): X context handle = 0x1
(II) RADEONHD(0): [drm] installed DRM signal handler
(II) RADEONHD(0): [pci] 16384 kB allocated with handle 0xfde1a000
(II) RADEONHD(0): [pci] ring handle = 0xfde1a000
(II) RADEONHD(0): [pci] Ring mapped at 0xa7721000
(II) RADEONHD(0): [pci] Ring contents 0x00000000
(II) RADEONHD(0): [pci] ring read ptr handle = 0xfe01b000
(II) RADEONHD(0): [pci] Ring read ptr mapped at 0xb7f2b000
(II) RADEONHD(0): [pci] Ring read ptr contents 0x00000000
(II) RADEONHD(0): [pci] vertex/indirect buffers handle = 0xfe01c000
(II) RADEONHD(0): [pci] Vertex/indirect buffers mapped at 0xa7521000
(II) RADEONHD(0): [pci] Vertex/indirect buffers contents 0x00000000
(II) RADEONHD(0): [pci] GART texture map handle = 0xfe21c000
(II) RADEONHD(0): [pci] GART Texture map mapped at 0xa6961000
(II) RADEONHD(0): [drm] register handle = 0x2fbfc000
(II) RADEONHD(0): [dri] Visual configs initialized
(II) RADEONHD(0): Attempting to enable power management
(II) RADEONHD(0): [DRI] installation complete
(II) RADEONHD(0): [drm] Added 32 65536 byte vertex/indirect buffers
(II) RADEONHD(0): [drm] Mapped 32 vertex/indirect buffers
(II) RADEONHD(0): [drm] dma control initialized, using IRQ 18
(II) RADEONHD(0): [drm] Initialized kernel GART heap manager, 12320768
(II) RADEONHD(0): Direct rendering enabled
(II) RADEONHD(0): Using DRM Command Processor (indirect) for acceleration.
(II) EXA(0): Offscreen pixmap area of 26845184 bytes
(II) EXA(0): Driver registered support for the following operations:
(II) Solid
(II) Copy
(II) Composite (RENDER acceleration)
(II) UploadToScreen
(II) DownloadFromScreen
(==) RADEONHD(0): Backing store disabled
(==) RADEONHD(0): Silken mouse enabled
(II) RADEONHD(0): RandR 1.2 enabled, ignore the following RandR disabled message.
(II) RADEONHD(0): Mapping DIG2 encoder to KLDSKP_LVTMA
(II) RADEONHD(0): On Crtc 0 Setting 60.0 Hz Mode: Modeline "1920x1080" 148.50 1920 2008 2052 2200 1080 1085 1090 1125 +hsync +vsync
None
(II) RADEONHD(0): RHDAudioSetClock: using UNIPHY_KLDSKP_LVTMA as clock source with 148500 khz
Pretty good and thanks. I'll maybe get around to trying 2.6.30 with 64 bit tomorrow.
nanonyme
06-27-2009, 07:29 AM
Iirc that irqreturn_t thing was not difficult to fix. If you take a look at the header file, it only declares irqreturn_t if IRQ_HANDLED is not defined. Well, the thing is, IRQ_HANDLED is nowadays a member of enumerated value irqreturn_t (and not a macro, unsure if it has been but considering there's code that relies on it being thus, it likely was) so the test in drm_os_linux.h gives a false success. Commenting out
#ifndef IRQ_HANDLED
typedef void irqreturn_t;
#define IRQ_HANDLED /* nothing */
#define IRQ_NONE /* nothing */
#endifshould suffice for the specific problem iirc. (the proper solution probably would be to check in configure for the presence of irqreturn.h) There's also a problem with sysfs API change so you'd have to beat drm_sysfs.c with a hammer too. I fed up at that point, personally, wouldn't know if it works with those two. Might still require more. :)
forum1793
06-27-2009, 11:26 AM
sound works with 2.6.30 64 bit with radeonhd. Same error msg as before with drm.
I see what you mean.
The drm code under linux-core/drm_os_linux.h has
#ifndef IRQ_HANDLED
typedef void irqreturn_t;
We see in 2.6.27.15 at linux/include/linux/irqreturn.h
#define IRQ_HANDLED (1)
But in 2.6.30 at linux/include/linux/irqreturn.h
There is no IRQ_HANDLED except in comment
/**
* enum irqreturn
* @IRQ_NONE interrupt was not from this device
* @IRQ_HANDLED interrupt was handled by this device
The kernel 2.6.30 and 2.6.27.15 have include/linux/interrupt.h
typedef irqreturn_t (*irq_handler_t)(int, void *);
Since irqreturn_t is in both kernels it should not be needed at drm_os_linux.h for any of these versions, right?
If it is needed you could add another ifndef in the IRQ_HANDLED or pull it out by itself, right?
-I don't know C or C++ much so not sure how to do this
#ifndef IRQ_HANDLED
#define IRQ_HANDLED /* nothing */
#define IRQ_NONE /* nothing */
#ifndef irqreturn_t typedef void irqreturn_t;
#endif
#endif
#ifndef IRQ_HANDLED
#define IRQ_HANDLED /* nothing */
#define IRQ_NONE /* nothing */
#endif
#ifndef irqreturn_t typedef void irqreturn_t;
#endif
nanonyme
06-27-2009, 04:20 PM
You don't need to define IRQ_HANDLED and IRQ_NONE with the new way, they're members in irqreturn_t enum.
I'd suspect IRQ_HANDLED was moved into irqreturn_t but left as a macro as backwards compatibility and the macro was finally dropped in 2.6.30 but can't be sure without reading through a lot of mailing list posts. The "new" solution is definitely cleaner though...
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.