Opened 18 years ago
Closed 14 years ago
#1072 closed enhancement (fixed)
Write an HDA audio driver and add-on
Reported by: | axeld | Owned by: | ithamar |
---|---|---|---|
Priority: | normal | Milestone: | R1 |
Component: | Drivers/Audio/HDA | Version: | R1/pre-alpha1 |
Keywords: | Cc: | pieter@…, fredrik.holmqvist@…, harakash@…, HubertNG@… | |
Blocked By: | Blocking: | #3193 | |
Platform: | x86 |
Description
We need to support HD-Audio chipsets.
Because of the features of this standard, it might be feasible to create a new media add-on for this as well, instead of using the current hmulti-audio add-on.
Attachments (11)
Change History (76)
comment:1 by , 18 years ago
Owner: | removed |
---|
comment:2 by , 18 years ago
comment:3 by , 18 years ago
Since Haiku's multi-audio API is not compatible anyway, that would definitely be the preferred solution :-) Anyway, I guess you don't mind if I assign this ticket to you? There is a "colacoder" user, but I can't find an ithamar in the user list...
comment:4 by , 18 years ago
I added "colacoder" because that was your (Ithamar's) SVN user name and I thought you'd use that for the website, too. I've added "ithamar" to the devs, so you can now accept tickets yourself (just choose "accept ticket").
comment:5 by , 18 years ago
Owner: | set to |
---|
comment:6 by , 18 years ago
Status: | new → assigned |
---|
Ok, accepted the ticket now. There's already quite some code in SVN, though the driver is far from finished. So many possible audio features to implement.... ;)
comment:7 by , 16 years ago
HDA does not work on my laptop yet. It does show up as recognized at the Media panel, but without any controls on its control page. I can try to play files, but I get no output. Attached the syslog.
comment:8 by , 16 years ago
Cc: | added |
---|
comment:9 by , 16 years ago
FWIW I don't have sound either at 192khz/24 bits. I'll probably stick the driver to 48khz/16bits for the time being until fixed. The problem might be related to Haiku media kit/addons.
follow-up: 11 comment:10 by , 16 years ago
Thanks, when something might work again, let me know I'll try it. I can also test things if you need.
comment:11 by , 16 years ago
Replying to PieterPanman:
Thanks, when something might work again, let me know I'll try it. I can also test things if you need.
PieterPanman, could you try if playback work for you with a current revision (and adding hda to the hd image) ?
comment:12 by , 16 years ago
I tried it just now. It seems to want to play sound, however the audio device has no control view in the media preflet. Also, no sound when I play. I will attach the latest syslog. Let me know if I can do anything else.
comment:13 by , 16 years ago
hmm cannot add it. I emailed the haiku-develop with the error message.
Meanwhile, see http://panman.eu/haiku/syslog
comment:14 by , 16 years ago
Cc: | added |
---|
I only get noise when I try to play something, ATI SB600 and Realtek ALC889A Audio Codec.
comment:15 by , 16 years ago
Cc: | added |
---|
comment:16 by , 16 years ago
Still only noise, actually you can hear the sound, but it's like a square wave reverb or something is adding and amplifying it to noise. When stopping Mediaplayer it plays around 2 secs afterwards, also kind of like a reverb.
Tested in hrev28696 with ATI SB600 and Realtek ALC889A and trying a lot of changes to controls in Media panel.
comment:17 by , 16 years ago
Blocking: | 3193 added |
---|
comment:18 by , 16 years ago
I made a quick hack for getting HDA working on ATI SBX00 chips, after looking at what ALSA HDA does on init. It's choppy but otherwise correct, as opposed to the noise without it. It needs to setup 'snooping':
Basically same as reading/writing TCSEL in hdacontroller.cpp but on register 0x42 OR'ing what is written back with 0x2. (See the lines ~731 /* TCSEL is reset to TC0 (clear 0-2 bits) */ I added my hack before the /* Enable controller interrupts */ section )
For Nvidia the register is 0x4e and the value to OR with is 0x0F.
Sorry for the cryptic explanation, but don't want to introduce any license complications.
comment:19 by , 16 years ago
comment:20 by , 16 years ago
Reworked and applied the patch in hrev28838. The mask for nVidia wasn't correct IMO. Thanks!
comment:21 by , 16 years ago
Audio seems to play fine without stutter if I run GLTeapot or other cpu-using app at the same time on ATI SB600. After a while it seems it worked well even without other apps running. Revision hrev28839.
comment:22 by , 16 years ago
I found a nice MS reference to why snooping is needed: http://msdn.microsoft.com/en-us/library/ms790324.aspx when reading the FreeBSD code: http://fxr.watson.org/fxr/source/dev/sound/pci/hda/hdac.c
comment:23 by , 16 years ago
Looking at scottmc's and #3193 it seems it has the right class_base and class_sub:
device Multimedia controller (Audio device) [4|3|0] vendor 10de: nVidia Corporation device 0774: MCP78S [GeForce 8200] High Definition Audio
So first question to scottmc or luposian, have you enabled the hda driver, before building? To do so, add it to BEOS_ADD_ONS_DRIVERS_AUDIO in build/jam/HaikuImage, so it looks something like this:
BEOS_ADD_ONS_DRIVERS_AUDIO = auich auvia echo3g emuxki hda ;
If you have we need more info from syslog, and maybe add more debugging to driver.
follow-up: 60 comment:25 by , 16 years ago
Sound is now working on my nvidia based laptop now (Compaq cq50-215nr). Nice work!
follow-up: 27 comment:26 by , 16 years ago
device Multimedia controller (Audio device) [4|3|0] vendor 8086: Intel Corporation device 284b: 82801H (ICH8 Family) HD Audio Controller
on Lenovo 3000 N200 laptop works well, great job!
After plugging my headphones in the sound is still on the loudspeaker and silence goes to the headphones.
by , 16 years ago
comment:27 by , 16 years ago
Replying to Adek336:
After plugging my headphones in the sound is still on the loudspeaker and silence goes to the headphones.
Thanks for the report. The switch between headphones and speaker is not yet managed (via unsollicited responses btw).
comment:28 by , 16 years ago
Cc: | added |
---|---|
Component: | Drivers/Audio → Drivers/Audio/HDA |
Which runs some time, often near starting Deskbara freezes. listdev: http://dev.haiku-os.org/attachment/ticket/3260/listdev-mypc.txt
comment:29 by , 16 years ago
I found out that if I disable one core on my AMD64x2 sound plays without any stutter at all. So I guess it might not be the driver, although bigger buffers might help.
comment:31 by , 16 years ago
Tried disabling serial debug on my machine, but it doesn't affect my stutters.
comment:32 by , 16 years ago
Intel Corporation 82801G (ICH7 Family) High Definition Audio Controller [8086:27d8] (rev 02)
Briefly tested ok with revision 29165 on a Lenovo T60 (Intel Centrino Duo T2300), no stutter. Nice work!
comment:33 by , 16 years ago
Since my commit hrev29172 it actually works on both my EeePC 900 as well as on my other notebooks.
comment:34 by , 16 years ago
It still works here, with less stutters, but not stutterfree when several cpus active. I wonder if Rudolf's drift-changes in the other bug might correct that.
follow-up: 38 comment:36 by , 16 years ago
It seems to work, but I don't get any sound out of any of the outputs I have. Stuff's visible in the media prefs however including gains for the different output streams. When the driver loads a "click" is hearable, but other than that I can't hear anything. I'm usually using the headphone out with headphones connected. I know that this works because it works with OSS. Attaching relevant syslog output. Please tell if I can be of any help.
by , 16 years ago
Attachment: | hda_syslog.txt added |
---|
comment:37 by , 16 years ago
Unless you are using the default output headphones might not work as hda uses jack-sensing to detect what is connected, and jack-sensing isn't implemented in the driver.
follow-up: 39 comment:38 by , 16 years ago
Replying to mmlr:
It seems to work, but I don't get any sound out of any of the outputs I have. Stuff's visible in the media prefs however including gains for the different output streams. When the driver loads a "click" is hearable, but other than that I can't hear anything. I'm usually using the headphone out with headphones connected. I know that this works because it works with OSS. Attaching relevant syslog output. Please tell if I can be of any help.
Could you give the relevant PCI info for this device in the syslog ?
comment:39 by , 16 years ago
Replying to korli:
Could you give the relevant PCI info for this device in the syslog ?
KERN: PCI: [dom 0, bus 0] bus 0, device 27, function 0: vendor 8086, device 293e, revision 02 KERN: PCI: class_base 04, class_function 03, class_api 00 KERN: PCI: vendor 8086: Intel Corporation KERN: PCI: device 293e: 82801I (ICH9 Family) HD Audio Controller KERN: PCI: info: Multimedia controller (Audio device) KERN: PCI: line_size 10, latency 00, header_type 00, BIST 00 KERN: PCI: ROM base host 00000000, pci 00000000, size 00000000 KERN: PCI: cardbus_CIS 00000000, subsystem_id 4001, subsystem_vendor_id 8086 KERN: PCI: interrupt_line 0a, interrupt_pin 01, min_grant 00, max_latency 00 KERN: PCI: base reg 0: host 48220000, pci 48220000, size 00004000, flags 04 KERN: PCI: base reg 1: host 00000000, pci 00000000, size 00000010, flags 0f KERN: PCI: base reg 2: host 00000000, pci 00000000, size 00000000, flags 00 KERN: PCI: base reg 3: host 00000000, pci 00000000, size 00000000, flags 00 KERN: PCI: base reg 4: host 00000000, pci 00000000, size 00000000, flags 00 KERN: PCI: base reg 5: host 00000000, pci 00000000, size 00000000, flags 00 KERN: PCI: Capabilities: PM, MSI, PCIe
follow-up: 42 comment:40 by , 16 years ago
Platform: | All → x86 |
---|
Thanks to tqh's advice, I enabled "hda". as instructed, and now it works on my Acer Aspire X1200. I get a lot of staticy garbled sound out of the speaker, whenever I play an .aif or .mp3, but turning on GLTeapot seems to make it all go away, for the most part. Just a couple ticks/pops now and then. Turning off one CPU does nothing beneficial.
What is it about bogging the CPU down a bit (I assume GLTeapot not special, in this regard, except that it likes to take up lotsa CPU cycles, which I assume means something) that seems to more or less "solve" the grungy sound output? Anyone have any idea?
comment:41 by , 16 years ago
Have you tried disabling serial output? If not, try doing so by uncommenting the line "#serial_debug_output false" in ~/config/settings/kernel/drivers/kernel. If so, did that make any difference at all?
comment:42 by , 16 years ago
Replying to Luposian:
What is it about bogging the CPU down a bit (I assume GLTeapot not special, in this regard, except that it likes to take up lotsa CPU cycles, which I assume means something) that seems to more or less "solve" the grungy sound output? Anyone have any idea?
Please give detail on your specific audio chipset (extract from syslog would fit).
comment:43 by , 16 years ago
Tested again in hrev29343. The sound no longer stutter it seems, but everything sounds like it's overamped and clipping instead. It's unlistenable. I tried lowering/muting channels so I don't think it's a mixing problem.
comment:44 by , 16 years ago
Korli...
This is about the best info I can offer, as to what my audio chipset is:
comment:45 by , 16 years ago
Type: | enhancement → bug |
---|
Well, criminy! I JAM my first GCC 4-built Haiku, turn HDA on, and while Haiku sees the HDA chip and puts up all the little sliders and stuff in the Media preferences... I get absolutely NO audio whatsoever, no matter what I do/try.
It was working before, in my last GCC 2.95 build of Haiku... now it dun work at all! :-(
Any idea if this is specifically related to GCC 4 builds or if it's just a recent "crunch" (code problem/glitch/bug/whatever) that has reared it's head (regardless of GCC version) and will (hopefully) be resolved shortly?
comment:46 by , 16 years ago
Type: | bug → enhancement |
---|
Please don't arbitrarily change ticket information without asking. This was marked enhancement for a reason.
comment:47 by , 16 years ago
Sorry about that. I figured I could be mark it as "bug", because I thought it would only show what *I* thought of it as (and only on my post(s)), not change the entire thread to that classification. Again, my apologies. I'll be sure to remember that from now on.
As a side note, any idea why my GCC 4 build of Haiku is exhibiting total silence, even though I set it up to see HDA? Like I said, it was working well in the last GGC 2.95 build of Haiku I did several weeks back, on this same system. Thus, logically, it can't be the hardware... can it?
comment:48 by , 16 years ago
There are issues that currently only show up on gcc4 due to differences in how the compilers do memory alignment and such. Those haven't yet been looked into in too much detail for various reasons, so for the time being you probably don't want to be using a gcc4 build unless you have a pressing reason to do so (i.e. trying to port software that requires it to compile).
comment:50 by , 16 years ago
Audio now sounds as it should except tick/thumps several times per second, might be depending on music. Revision hrev29436.
comment:51 by , 16 years ago
Are you trying to play Techno? I hate Techno and have added deliberate audio stuttering upon detection of Techno-music.
comment:52 by , 16 years ago
Seriously though, for me, audio sounds perfect when playing in VLC. In MediaPlayer, I get varying results, seemingly depending on the file in question (?). Maybe there is a problem in our MP3 decoder yet? I wanted to make some tests with WAV and generated test-tones to be sure. But since the ToneProducer-Demo in Cortex as well as playback in VLC sound perfect here, I can be sure that the problem is neither in the System Mixer, nor HDA, nor the Multi-Audio node. If you can reproduce clicks in with the ToneProducer test node in Cortex, then a problem is most likely in HDA with your specific parameters (what audio format it defaults to).
comment:55 by , 16 years ago
From my experience the MediaPlayer is at least responsible form some of the clicks. When I play some file that has clicks in MediaPlayer with playfile instead, it sounds perfectly fine. Also in case of AAC files the files sometimes just restart from the beginning in MediaPlayer while it plays fine in playfile, which uses the native APIs as well.
comment:56 by , 16 years ago
I posted this on the developer mailing list, when trac was down. Now I'm reporting this at the proper place:
I've just compiled in the HDA driver, and I'm running it on my santa rosa laptop. It works, but stutters every so often. Playfile also stutters. I remember that with the opensound driver there was no stutter.
Haiku revision 29543, gcc2.95
device Multimedia controller (Audio device) [4|3|0]
vendor 8086: Intel Corporation device 284b: 82801H (ICH8 Family) HD Audio Controller
If you need more info, let me know.
follow-up: 58 comment:57 by , 16 years ago
Ok, after JAMing the latest GCC4 revision of Haiku last night (3/21/09), and seeing that audio still didn't work (I enabled HDA as suggested above), I deleted the whole /develop folder, re-downloaded everything and went back to GCC 2.95.x, enabled HDA, and JAM'd a GCC 2.95.x revision of Haiku. The GCC 2.95 revision of Haiku worked fine before, but... guess what... still no audio. So, I've just ruled out that it's exclusively a GCC4 thing.
As far as I can tell, someone broke HDA somewhere and it doesn't work (at least for me, on my system) in GCC 2.95 *or* GCC 4 anymore... :-(
comment:58 by , 16 years ago
Replying to Luposian: Feel free to post a syslog or find the breaking revision by binary search.
comment:59 by , 16 years ago
Unfortunately. Despite, that HDA be seen, Media Player and CD Player work, but I haven't any sound. On OSS work correctly. Anyway, on my laptop HDA driver work correctly.
device Multimedia controller (Audio device) [4|3|0]
vendor 10de: nVidia Corporation
device 03f0: MCP61 High Definition Audio
follow-up: 61 comment:60 by , 15 years ago
Replying to scottmc:
Sound is now working on my nvidia based laptop now (Compaq cq50-215nr). Nice work!
It used to work on my cq50-215nr, but hasn't for the last month or two. Media prefs show that it's detected, but I get no sound.
by , 15 years ago
Attachment: | listdev-CQ50-215NR.txt added |
---|
comment:61 by , 15 years ago
Replying to scottmc:
Replying to scottmc:
Sound is now working on my nvidia based laptop now (Compaq cq50-215nr). Nice work!
It used to work on my cq50-215nr, but hasn't for the last month or two. Media prefs show that it's detected, but I get no sound.
I've attached a syslog and the output of listdev in case that can be of any help tracking down why it's no longer working on this model.
comment:62 by , 15 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
In any case, we do have a HD audio driver since quite some time, so I'm closing this ticket.
follow-up: 64 comment:63 by , 14 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
on my Intel Atom D510 the HDA driver dont see the audio card :(
device Multimedia controller (Audio device) [4|3|0]
vendor 8086: Intel Corporation device 27d8: N10/ICH 7 Family High Definition Audio Controller
by , 14 years ago
Attachment: | syslog.r37174 added |
---|
comment:64 by , 14 years ago
Replying to atomozero:
on my Intel Atom D510 the HDA driver dont see the audio card :(
device Multimedia controller (Audio device) [4|3|0]
vendor 8086: Intel Corporation device 27d8: N10/ICH 7 Family High Definition Audio Controller
You should maybe check first if OSS is installed :/ It seems to be the case.
comment:65 by , 14 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
At any rate, please open a new ticket for problems with the driver. The driver had been written (which is what this ticket is about) and the ticket gets really convoluted, if everyone adds bug reports for the driver here.
just a quick note to officially register that I am working on this driver. It is approaching reasonable usability/stability, and should arrive in SVN pretty soon.
It is using the Haiku multi_audio API, as that seems sufficient for the features supported, and if multi_audio would/will not fit, that would be a good reason to reevaluate this API :)