2012-05-16 12:31 keltezéssel, Fengguang Wu írta: > On Wed, May 16, 2012 at 12:17:21PM +0200, Boszormenyi Zoltan wrote: >> Hi, >> >> 2012-05-16 11:11 keltezéssel, Fengguang Wu írta: >>> On Mon, May 14, 2012 at 02:02:06PM +0200, Boszormenyi Zoltan wrote: >>>> Hi Linux sound driver maintainers and authors, >>>> >>>> we have a little(?) problem that we discovered while experimenting >>>> with HDMI audio output on a Zotac ZBOX with NVIDIA ION GT218. >>>> We are using the embedded Angstrom distribution with kernel >>>> version 2.6.38.4 and NVIDIA proprietary driver version 260.19.21. >>>> >>>> Both the mainboard audio controller and the HDMI audio are >>>> driven by the in-kernel snd-hda-intel. lspci output is: >>>> >>>> 00:00.0 Class 0600: 8086:a000 >>>> 00:1b.0 Class 0403: 8086:27d8 >>>> 00:1c.0 Class 0604: 8086:27d0 >>>> 00:1c.1 Class 0604: 8086:27d2 >>>> 00:1c.2 Class 0604: 8086:27d4 >>>> 00:1d.0 Class 0c03: 8086:27c8 >>>> 00:1d.1 Class 0c03: 8086:27c9 >>>> 00:1d.2 Class 0c03: 8086:27ca >>>> 00:1d.3 Class 0c03: 8086:27cb >>>> 00:1d.7 Class 0c03: 8086:27cc >>>> 00:1e.0 Class 0604: 8086:2448 >>>> 00:1f.0 Class 0601: 8086:27bc >>>> 00:1f.2 Class 0101: 8086:27c0 >>>> 00:1f.3 Class 0c05: 8086:27da >>>> 01:00.0 Class 0c03: 1106:3432 >>>> 02:00.0 Class 0280: 168c:002b >>>> 03:00.0 Class 0300: 10de:0a64 >>>> 03:00.1 Class 0403: 10de:0be3 >>>> 04:0b.0 Class 0200: 10ec:8167 >>>> >>>> Relevant parts (decoded by http://kmuto.jp/debian/hcl/): >>>> >>>> 8086:27d8 Intel Corporation N10/ICH 7 Family High Definition Audio Controller >>>> 10de:0a64 nVidia Corporation GT218 [ION] >>>> 10de:0be3 nVidia Corporation High Definition Audio Controller >>>> >>>> The problem is that when the audio stream starts, the first one or >>>> two seconds are not audible, it's trimmed from the stream. >>>> >>>> I have found a few available test samples that show the problem >>>> at http://www.audiocheck.net/ >>>> >>>> The longer mono sample at >>>> http://www.audiocheck.net/Audio/audiocheck.net_welcome2.wav >>>> need to be converted to stereo before being playable on the HDMI output: >>>> >>>> sox audiocheck.net_welcome2.wav -c 2 audiocheck.net_welcome-stereo.wav >>>> >>>> When played with >>>> aplay -D hw:1,7 audiocheck.net_welcome-stereo.wav >>>> the "Welcome to" words at the very beginning are not audible. >>>> >>>> The next two samples at >>>> http://www.audiocheck.net/Audio/audiocheck.net_L.wav >>>> http://www.audiocheck.net/Audio/audiocheck.net_R.wav >>>> are shorter than 2 seconds and are not audible at all when played. >>>> >>>> When played with "aplay -D hw:0,0" over the mainboard device, >>>> all samples are OK. >>>> >>>> Does anyone know whether it's a known problem or maybe an >>>> already fixed one? >>> It's a known problem. We have a workaround to avoid unnecessary changing >>> states with this commit. However if you play a 2-channel clip after >>> finished another 8-channel one, there is no way to hide the inherent >>> delays in the TV from the user.. >>> >>> commit 5779191e0efd851fb0d54698c13cb4f5325caca6 >>> Author: Wu Fengguang<fengguang.wu@xxxxxxxxx> >>> Date: Wed Nov 18 12:38:06 2009 +0800 >>> >>> ALSA: intelhdmi - sticky stream id and format >>> >>> We tracked down the first-0.5s-hdmi-audio-samples-lost problem to the >>> AC_VERB_SET_CHANNEL_STREAMID command. It is suspected that many HDMI >>> sinks need some time to adapt to the new state. >>> >>> The workaround is to avoid changing stream id/format whenever possible. >>> Proposed by David. >>> >>> Thanks, >>> Fengguang >> thanks for your answer. However, this GIT commit is dated >> 2009-11-18 and according to "git log", it went into Linux >> 2.6.32-rc8. We are using 2.6.38.4. > Do you see the 2s delays on every new files played, even if they are > of the same format? Yes. [zozo@localhost samples]$ file * audiocheck.net_L.wav: RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16 bit, stereo 44100 Hz audiocheck.net_R.wav: RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16 bit, stereo 44100 Hz audiocheck.net_welcome-stereo.wav: RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16 bit, stereo 44100 Hz > If so, we need to check it in probably two steps: > > 1) run this during playback and when stopped playback: > > $ grep stream= /proc/asound/card0/codec* > Converter: stream=8, channel=0 > Converter: stream=0, channel=0 > Converter: stream=0, channel=0 > Converter: stream=0, channel=0 > Converter: stream=0, channel=0 > Converter: stream=0, channel=0 > Converter: stream=0, channel=0 It's actually card1 for me. I started from a clean state and restored the unmuted state of the HDMI outputs: # rmmod nvidia # rmmod snd-hda-intel # rmmod snd-hda-codec-hdmi # rmmod snd-hda-codec-realtek # rmmod snd-hda-codec # modprobe snd-hda-intel # modprobe nvidia # alsactl -f /etc/alsa.state restore # grep stream= /proc/asound/card1/codec* /proc/asound/card1/codec#0: Converter: stream=0, channel=0 /proc/asound/card1/codec#1: Converter: stream=0, channel=0 /proc/asound/card1/codec#2: Converter: stream=0, channel=0 /proc/asound/card1/codec#3: Converter: stream=0, channel=0 After X started from the console: # grep stream= /proc/asound/card1/codec* /proc/asound/card1/codec#0: Converter: stream=0, channel=0 /proc/asound/card1/codec#1: Converter: stream=0, channel=0 /proc/asound/card1/codec#2: Converter: stream=0, channel=0 /proc/asound/card1/codec#3: Converter: stream=0, channel=0 While playing the longer "welcome" file: # grep stream= /proc/asound/card1/codec* /proc/asound/card1/codec#0: Converter: stream=0, channel=0 /proc/asound/card1/codec#1: Converter: stream=6, channel=0 /proc/asound/card1/codec#2: Converter: stream=0, channel=0 /proc/asound/card1/codec#3: Converter: stream=0, channel=0 When playing is stopped: # grep stream= /proc/asound/card1/codec* /proc/asound/card1/codec#0: Converter: stream=0, channel=0 /proc/asound/card1/codec#1: Converter: stream=6, channel=0 /proc/asound/card1/codec#2: Converter: stream=0, channel=0 /proc/asound/card1/codec#3: Converter: stream=0, channel=0 > You'll see the first line has "stream=8". Your system may have some > different output, but the principle is, the two outputs should remain > the same. If your "stream=X" is reset to "stream=0" when playback stopped, > it should be the root cause. So, the "6" is not reset to "0". > 2) otherwise enable CONFIG_SND_DEBUG_VERBOSE and check if this message > appears on every new file played: > > hdmi_setup_audio_infoframe: pin=... channels=... > > If so, hdmi_infoframe_uptodate() is not working properly for NVIDIA > cards. I will recompile the kernel with the new config option set and report back. Thanks for your help. > > Thanks, > Fengguang > -- ---------------------------------- Zoltán Böszörményi Cybertec Schönig& Schönig GmbH Gröhrmühlgasse 26 A-2700 Wiener Neustadt, Austria Web: http://www.postgresql-support.de http://www.postgresql.at/ ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Alsa-user mailing list Alsa-user@xxxxxxxxxxxxxxxxxxxxx https://lists.sourceforge.net/lists/listinfo/alsa-user