Skip to contentSkip to conversation

Broken nforce3 support in ALSA on amd64?

DISCUSSION Ian Forde 3 participants 8 messages Feb 27, 2005 – Mar 10, 2005

lore
Share & tools
lore

Ian Forde

author
#0 lore raw

Hi -

I've posted to alsa-devel about a problem I'm having in getting PCM and AC3 working on FC3-x86_64.

My motherboard is a DFI Lanparty UT 250GB nforce3. I can get PCM audio to route through the spdif correctly with ALSA. But with AC3 audio, the blue light on my Sony receiver lights up but plays no sound.

lspci -v output from the chip:

00:06.0 Multimedia audio controller: nVidia Corporation nForce3 250Gb AC'97 Audio Controller (rev a1)
Subsystem: nVidia Corporation: Unknown device 0c11
Flags: bus master, 66Mhz, fast devsel, latency 0, IRQ 177 I/O ports at d300 [size=256]
I/O ports at d400 [size=128]
Memory at e9000000 (32-bit, non-prefetchable) [size=4K]
Capabilities: [44] Power Management version 2

Here's the weird bit: Following these steps in order allows me to play AC3 through the SPDIF but no longer PCM audio:

1. Load ALSA modules
2. Play (successfully) PCM audio via:
/usr/bin/mplayer -vo null -ao alsa:device=hw=0.2
somemoviefile.avi
3. Unload ALSA modules
4. Load nvsound module
5. Play (successfully) AC3-enabled audio via:
/usr/bin/mplayer -vo null -ao oss -ac hwac3, someothermovie.vob
6. Unload nvsound module
7. Load ALSA modules
8. Play (successfully) AC3-enabled audio via:
/usr/bin/mplayer -vo null -ao alsa:device=hw=0.2 -ac hwac3,
someothermovie.vob

And no - at this point, redoing step 2 at this point does *NOT* work. Unless I unload alsa, load oss, play something PCM, unload oss, and load alsa again... just tested that.

Kernel is FC3 2.6.10-1.760_FC3 with ALSA 1.0.8 from atrpms on a x86_64 platform.

Note - in alsamixer, the only IEC958-related controls I see are "IEC958" and "IEC958 Playback AC97-SP5A", neither of which allow themselves to be muted...

It seems that because there's already a binary driver out there that can set the control bits correctly, all I should need to do is dump the registers after loading nvsound and playing both PCM and AC3 audio streams, then comparing them to what they look like when the corresponding ALSA module (snd-intel8x0) is loaded. How would I go about doing that in a way that would be useful to get this driver working for me and included in the next ALSA release?

-Ian

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click

#1 lore raw

At Sat, 26 Feb 2005 17:45:45 -0800,

Quoted 5 lines · Ian Forde

Note - in alsamixer, the only IEC958-related controls I see are "IEC958" and "IEC958 Playback AC97-SP5A", neither of which allow themselves to be muted...

Quoted 7 lines

It seems that because there's already a binary driver out there that can set the control bits correctly, all I should need to do is dump the registers after loading nvsound and playing both PCM and AC3 audio streams, then comparing them to what they look like when the corresponding ALSA module (snd-intel8x0) is loaded. How would I go about doing that in a way that would be useful to get this driver working for me and included in the next ALSA release?

Nforce seems to route the SPDIF output not through ac97 codec but directly to the SPDIF transmitter. That's why ALSA driver doesn't work. It assumes the AC97 codec output. So, apparently, we need to find out unknown registers to set up IEC958 status bits.

Unfortunately, the datasheet of nforce is not available at all, so we have no chance to fix this problem yet unless you do some reverse engineering (but I never recommend to do that, it's a waste of time).

Takashi

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click

#2 lore raw
Quoted 3 lines · Takashi Iwai

Unfortunately, the datasheet of nforce is not available at all, so we have no chance to fix this problem yet unless you do some reverse engineering (but I never recommend to do that, it's a waste of time).

Do you mean reverse engineering Nvidia drivers, or RE in general? If it's the latter I have to disagree strongly. It't not fast or easy, but many ALSA drivers have gained useful features this way.

I strongly encourage reverse engineering proprietary drivers. Look at what James did with the Audigy LS. And look how much is known about the EMU DSP instruction set, all that info is reverse engineered.

Lee

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click

#3 lore raw

At Mon, 07 Mar 2005 15:06:05 -0500,

Quoted 9 lines · Lee Revell
Quoted 3 lines · Takashi Iwai

Unfortunately, the datasheet of nforce is not available at all, so we have no chance to fix this problem yet unless you do some reverse engineering (but I never recommend to do that, it's a waste of time).

Do you mean reverse engineering Nvidia drivers, or RE in general? If it's the latter I have to disagree strongly. It't not fast or easy, but many ALSA drivers have gained useful features this way.

I mean the former.

Quoted 3 lines

I strongly encourage reverse engineering proprietary drivers. Look at what James did with the Audigy LS. And look how much is known about the EMU DSP instruction set, all that info is reverse engineered.

IMO, the reverse-engineering is not the first thing to do. The h/w vendors don't want to open their specs -- unless the manager realizes that many users want it in the world. So, crying out loudly to the h/w vendors would be the first. I don't think it's been done quite enough yet in this case. AFAIK, Nvidia guys don't know that the problem exists at all.

BTW, off-topic: is the reverse-engineering allowed in US, too?

Takashi

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click

#4 lore raw
Quoted 9 lines · Takashi Iwai

At Mon, 07 Mar 2005 15:06:05 -0500,
Lee Revell wrote:
IMO, the reverse-engineering is not the first thing to do. The h/w vendors don't want to open their specs -- unless the manager realizes that many users want it in the world. So, crying out loudly to the h/w vendors would be the first. I don't think it's been done quite enough yet in this case. AFAIK, Nvidia guys don't know that the problem exists at all.

Good point. Although Nvidia's position on opening their drivers is well known, their engineers have definitely helped open source developers before. Someone should really ask them, and post the results here.

Quoted 2 lines

BTW, off-topic: is the reverse-engineering allowed in US, too?

AIUI it's generally prohibited by the DMCA but there is an explicit exception that allows reverse engineering for the purpose of creating interoperable software. The intention was to prevent people from using the anti-reverse engineering provisions to implement vendor lock-in.

IANAL, in fact all my legal knowledge comes from LKML and slashdot, but I have interpreted this to mean that reverse engineering Windows drivers to make Linux drivers is fair game.

Maybe the US courts will find one day that I don't have a right to write a Linux driver for a device I paid for. But until that happens, I am not worried.

Any US lawyers on this list?

Lee

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click

author
#5 lore raw
Quoted 11 lines · Lee Revell
Quoted 9 lines · Takashi Iwai

At Mon, 07 Mar 2005 15:06:05 -0500,
Lee Revell wrote:
IMO, the reverse-engineering is not the first thing to do. The h/w vendors don't want to open their specs -- unless the manager realizes that many users want it in the world. So, crying out loudly to the h/w vendors would be the first. I don't think it's been done quite enough yet in this case. AFAIK, Nvidia guys don't know that the problem exists at all.

Quoted 3 lines

Good point. Although Nvidia's position on opening their drivers is well known, their engineers have definitely helped open source developers before. Someone should really ask them, and post the results here.

Hmm... would the downloads at

http://www.realtek.com.tw/downloads/downloads1-3.aspx?Keyword=alc850

help any? The first file listed is a datasheet for the alc850. The second contains a diagram...

	-I

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click

#6 lore raw

At Mon, 07 Mar 2005 21:45:16 -0800,

Quoted 17 lines · Ian Forde
Quoted 11 lines · Lee Revell
Quoted 9 lines · Takashi Iwai

At Mon, 07 Mar 2005 15:06:05 -0500,
Lee Revell wrote:
IMO, the reverse-engineering is not the first thing to do. The h/w vendors don't want to open their specs -- unless the manager realizes that many users want it in the world. So, crying out loudly to the h/w vendors would be the first. I don't think it's been done quite enough yet in this case. AFAIK, Nvidia guys don't know that the problem exists at all.

Quoted 3 lines

Good point. Although Nvidia's position on opening their drivers is well known, their engineers have definitely helped open source developers before. Someone should really ask them, and post the results here.

Quoted 6 lines

Hmm... would the downloads at

http://www.realtek.com.tw/downloads/downloads1-3.aspx?Keyword=alc850

help any? The first file listed is a datasheet for the alc850. The second contains a diagram...

nForce seems to route the SPDIF not through AC97 but directly to the transmitter. So, tuning AC97 registers will unlikely help.

Takashi

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click

author
#7 lore raw
Quoted 2 lines · Takashi Iwai

nForce seems to route the SPDIF not through AC97 but directly to the transmitter. So, tuning AC97 registers will unlikely help.

Okay - so I disabled it in the BIOS and put in an older SBLive 5.1 card that I had before. I can get PCM audio just fine, but AC3 passthrough is once again lighting up the receiver, but with no audio coming through. Please tell me this isn't an AMD64 thing...

	-I

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click