Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: MythTV: Users

HDMI sound works for AC3 2-channel, but not 6-channel

 

 

MythTV users RSS feed   Index | Next | Previous | View Threaded


steve at x2

Apr 1, 2012, 10:57 PM

Post #1 of 15 (1592 views)
Permalink
HDMI sound works for AC3 2-channel, but not 6-channel

Just upgraded from mythtv 0.23.1 to 0.24.2 yesterday. Now audio for most programs does not play back (it is silent).

I'm using the IEC958 output on the sound card to plug into the digital sound input on the video card which mixes it into the HDMI stream. The HDMI cable is connected to directly to my TV. This worked fine with all source material before. Now it only works with AC3 2-channel source material. Whenever I see this in the mythfrontend log:

2012-04-01 21:51:07.358 AO: Opening audio device 'iec958:CARD=CMI8768,DEV=0' ch 2(2) sr 48000 sf signed 16 bit reenc 0

The sound plays back fine. Whenever I see this:

2012-04-01 21:51:17.267 AO: Opening audio device 'iec958:CARD=CMI8768,DEV=0' ch 2(6) sr 48000 sf signed 32 bit reenc 0

I get silence. Note "ch 2(2)" vs. "ch 2(6)". The 2(2) message is preceded in the log by "codec AC3 has 2 channels", while the 2(6) message is preceded by "codec AC3 has 6 channels". Looking back through the mythfrontend logs from before the upgrade, it always said "ch 2(2)", even when there was a 6-channel stream (and there was no mention of 16 vs 32 bit).

Anybody have an idea what could be wrong?

I should probably mention that I also upgraded the box from Debian Etch to Squeeze at the same time (yes, I was a little behind the times... was leaving well enough alone) so the alsa lib version probably changed as well (kernel version is the same though, 2.6.32, since I was running a backported kernel with Etch).

Thanks,

Steve

_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://www.mythtv.org/mailman/listinfo/mythtv-users


icicimov at gmail

Apr 2, 2012, 12:27 AM

Post #2 of 15 (1575 views)
Permalink
Re: HDMI sound works for AC3 2-channel, but not 6-channel [In reply to]

Is your mythfrontend audio set to stereo?
On Apr 2, 2012 3:58 PM, "Steven Ihde" <steve [at] x2> wrote:

>
> Just upgraded from mythtv 0.23.1 to 0.24.2 yesterday. Now audio for most
> programs does not play back (it is silent).
>
> I'm using the IEC958 output on the sound card to plug into the digital
> sound input on the video card which mixes it into the HDMI stream. The
> HDMI cable is connected to directly to my TV. This worked fine with all
> source material before. Now it only works with AC3 2-channel source
> material. Whenever I see this in the mythfrontend log:
>
> 2012-04-01 21:51:07.358 AO: Opening audio device
> 'iec958:CARD=CMI8768,DEV=0' ch 2(2) sr 48000 sf signed 16 bit reenc 0
>
> The sound plays back fine. Whenever I see this:
>
> 2012-04-01 21:51:17.267 AO: Opening audio device
> 'iec958:CARD=CMI8768,DEV=0' ch 2(6) sr 48000 sf signed 32 bit reenc 0
>
> I get silence. Note "ch 2(2)" vs. "ch 2(6)". The 2(2) message is
> preceded in the log by "codec AC3 has 2 channels", while the 2(6) message
> is preceded by "codec AC3 has 6 channels". Looking back through the
> mythfrontend logs from before the upgrade, it always said "ch 2(2)", even
> when there was a 6-channel stream (and there was no mention of 16 vs 32
> bit).
>
> Anybody have an idea what could be wrong?
>
> I should probably mention that I also upgraded the box from Debian Etch to
> Squeeze at the same time (yes, I was a little behind the times... was
> leaving well enough alone) so the alsa lib version probably changed as well
> (kernel version is the same though, 2.6.32, since I was running a
> backported kernel with Etch).
>
> Thanks,
>
> Steve
>
> _______________________________________________
> mythtv-users mailing list
> mythtv-users [at] mythtv
> http://www.mythtv.org/mailman/listinfo/mythtv-users
>


jyavenard at gmail

Apr 2, 2012, 12:47 AM

Post #3 of 15 (1570 views)
Permalink
Re: HDMI sound works for AC3 2-channel, but not 6-channel [In reply to]

On Monday, 2 April 2012, Steven Ihde wrote:

>
> Just upgraded from mythtv 0.23.1 to 0.24.2 yesterday. Now audio for most
> programs does not play back (it is silent).
>
> I'm using the IEC958 output on the sound card to plug into the digital
> sound input on the video card which mixes it into the HDMI stream. The
> HDMI cable is connected to directly to my TV. This worked fine with all
> source material before. Now it only works with AC3 2-channel source
> material. Whenever I see this in the mythfrontend log:
>
> 2012-04-01 21:51:07.358 AO: Opening audio device
> 'iec958:CARD=CMI8768,DEV=0' ch 2(2) sr 48000 sf signed 16 bit reenc 0
>
> The sound plays back fine. Whenever I see this:
>
> 2012-04-01 21:51:17.267 AO: Opening audio device
> 'iec958:CARD=CMI8768,DEV=0' ch 2(6) sr 48000 sf signed 32 bit reenc 0
>
> I get silence. Note "ch 2(2)" vs. "ch 2(6)". The 2(2) message is
> preceded in the log by "codec AC3 has 2 channels", while the 2(6) message
> is preceded by "codec AC3 has 6 channels". Looking back through the
> mythfrontend logs from before the upgrade, it always said "ch 2(2)", even
> when there was a 6-channel stream (and there was no mention of 16 vs 32
> bit).
>
> Anybody have an idea what could be wrong?
>
>
>
If you provided more logs rather than cutting out so much.. Then yes.. We
could probably help better.

What are your audio settings (both main audio settings and options in the
advanced screen)

If AC3 , it should never attempt to open the audio device as 32 bits.... So
my guess is that you've set options you shouldn't have.


steve at x2

Apr 2, 2012, 6:40 AM

Post #4 of 15 (1552 views)
Permalink
Re: HDMI sound works for AC3 2-channel, but not 6-channel [In reply to]

Audio is set to Stereo, yes, although it is the only choice. Dolby Digital and DTS are unchecked, as the HDMI cable is plugged directly into my TV, not a receiver/processor.

Thanks,

Steve

On Apr 2, 2012, at 12:27 AM, Igor Cicimov wrote:

> Is your mythfrontend audio set to stereo?
> On Apr 2, 2012 3:58 PM, "Steven Ihde" <steve [at] x2> wrote:
>
> Just upgraded from mythtv 0.23.1 to 0.24.2 yesterday. Now audio for most programs does not play back (it is silent).
>
> I'm using the IEC958 output on the sound card to plug into the digital sound input on the video card which mixes it into the HDMI stream. The HDMI cable is connected to directly to my TV. This worked fine with all source material before. Now it only works with AC3 2-channel source material. Whenever I see this in the mythfrontend log:
>
> 2012-04-01 21:51:07.358 AO: Opening audio device 'iec958:CARD=CMI8768,DEV=0' ch 2(2) sr 48000 sf signed 16 bit reenc 0
>
> The sound plays back fine. Whenever I see this:
>
> 2012-04-01 21:51:17.267 AO: Opening audio device 'iec958:CARD=CMI8768,DEV=0' ch 2(6) sr 48000 sf signed 32 bit reenc 0
>
> I get silence. Note "ch 2(2)" vs. "ch 2(6)". The 2(2) message is preceded in the log by "codec AC3 has 2 channels", while the 2(6) message is preceded by "codec AC3 has 6 channels". Looking back through the mythfrontend logs from before the upgrade, it always said "ch 2(2)", even when there was a 6-channel stream (and there was no mention of 16 vs 32 bit).
>
> Anybody have an idea what could be wrong?
>
> I should probably mention that I also upgraded the box from Debian Etch to Squeeze at the same time (yes, I was a little behind the times... was leaving well enough alone) so the alsa lib version probably changed as well (kernel version is the same though, 2.6.32, since I was running a backported kernel with Etch).
>
> Thanks,
>
> Steve
>
> _______________________________________________
> mythtv-users mailing list
> mythtv-users [at] mythtv
> http://www.mythtv.org/mailman/listinfo/mythtv-users
> _______________________________________________
> mythtv-users mailing list
> mythtv-users [at] mythtv
> http://www.mythtv.org/mailman/listinfo/mythtv-users


jyavenard at gmail

Apr 2, 2012, 3:30 PM

Post #5 of 15 (1542 views)
Permalink
Re: HDMI sound works for AC3 2-channel, but not 6-channel [In reply to]

Hi

On Monday, 2 April 2012, Steven Ihde wrote:

>
> Audio is set to Stereo, yes, although it is the only choice. Dolby
> Digital and DTS are unchecked, as the HDMI cable is plugged directly into
> my TV, not a receiver/processor.
>
>
>
Please, do not top post..

That would make sense then... Audio has to be decoded and down mixed from
5.1 to stereo. This is done as a floating point operation.
So your audio card is opened as stereo for an originally 6 channels audio
(hence the 2(6) message in the log)

Now why it doesn't play is hard to understand, especially if you're saying
that plain stereo works...

Are you able to compile mythtv yourself? I'd like to try something with
you...


steve at x2

Apr 2, 2012, 6:25 PM

Post #6 of 15 (1539 views)
Permalink
Re: HDMI sound works for AC3 2-channel, but not 6-channel [In reply to]

On Apr 2, 2012, at 3:30 PM, Jean-Yves Avenard wrote:
> On Monday, 2 April 2012, Steven Ihde wrote:
>
> Audio is set to Stereo, yes, although it is the only choice. Dolby Digital and DTS are unchecked, as the HDMI cable is plugged directly into my TV, not a receiver/processor.
>
> Please, do not top post..
>
> That would make sense then... Audio has to be decoded and down mixed from 5.1 to stereo. This is done as a floating point operation.
> So your audio card is opened as stereo for an originally 6 channels audio (hence the 2(6) message in the log)
>
> Now why it doesn't play is hard to understand, especially if you're saying that plain stereo works...
>
> Are you able to compile mythtv yourself? I'd like to try something with you...

Yes, I can build from source. I'm happy to try any suggestions you have. I was expecting to see a message about "downmixing" from 6 to 2 channels but I don't see one.

Sorry I missed your earlier message asking for more logs; pasted a longer log segment below.

2012-04-01 23:30:20.796 AFD: EIA-708 caption service #1 is in the English language.
2012-04-01 23:30:20.797 AFD: Using vdpau for video decoding
2012-04-01 23:30:20.797 AFD: Looking for decoder for MPEG2VIDEO
2012-04-01 23:30:20.797 AFD: Opened codec 0x3b65670, id(MPEG2VIDEO) type(Video)
2012-04-01 23:30:20.797 AFD: Stream #1, has id 0x33 codec id AC3, type Audio, bitrate 384000 at 0x3948bc0
2012-04-01 23:30:20.797 AFD: codec AC3 has 6 channels
2012-04-01 23:30:20.797 AFD: Looking for decoder for AC3
2012-04-01 23:30:20.798 AFD: Opened codec 0x3b65ad0, id(AC3) type(Audio)
2012-04-01 23:30:20.798 AFD: Stream #2, has id 0x34 codec id AC3, type Audio, bitrate 64000 at 0x3ba4670
2012-04-01 23:30:20.798 AFD: codec AC3 has 1 channels
2012-04-01 23:30:20.798 AFD: Looking for decoder for AC3
2012-04-01 23:30:20.798 AFD: Opened codec 0x3aa5ee0, id(AC3) type(Audio)
2012-04-01 23:30:20.798 AFD: Stream #3, has id 0x35 codec id AC3, type Audio, bitrate 64000 at 0x39700b0
2012-04-01 23:30:20.799 AFD: codec AC3 has 1 channels
2012-04-01 23:30:20.799 AFD: Looking for decoder for AC3
2012-04-01 23:30:20.799 AFD: Opened codec 0x3aa6340, id(AC3) type(Audio)
2012-04-01 23:30:20.978 AO: Opening audio device 'iec958:CARD=CMI8768,DEV=0' ch 2(6) sr 48000 sf signed 32 bit reenc 0
2012-04-01 23:30:20.981 ALSA, Error: Unable to sufficiently increase ALSA hardware buffer size - underruns are likely
2012-04-01 23:30:20.986 AudioPlayer: Enabling Audio
2012-04-01 23:30:20.987 Dec: Selected track #1 in the Unknown language(0)
2012-04-01 23:30:20.987 Dec: Selected track #1 in the English language(6647399)

The only subsequent mention of audio is the following:

2012-04-01 23:30:21.271 Player(0): Forcing decode extra audio option on (Video method requires it).

Note the "Unable to sufficiently increase..." message occurs after I had already followed the instructions to manually increase the prealloc. Before setting it to 128, I got a more extensive message like this:

2012-04-01 21:59:33.795 ALSA, Error: Setting hardware audio buffer size to 128
2012-04-01 21:59:33.796 ALSA, Error: Error opening /proc/asound/card1/pcm2p/sub0/prealloc: Permission denied.
2012-04-01 21:59:33.796 ALSA, Error: Try to manually increase audio buffer with: echo 128 | sudo tee /proc/asound/card1/pcm2p/sub0/prealloc
2012-04-01 21:59:33.796 ALSA, Error: Unable to sufficiently increase ALSA hardware buffer size - underruns are likely

Setting the size to 128 seems to make the first three messages go away, but the one about "Unable to sufficiently increase ..." remains.

In neither case do I ever see the "WriteAudio: buffer underrun" messages (i.e., neither when sound works nor when it is silent), so I do not believe buffer underruns are the problem, but I am open to suggestion there as well.

Thanks,

Steve


jyavenard at gmail

Apr 2, 2012, 6:35 PM

Post #7 of 15 (1552 views)
Permalink
Re: HDMI sound works for AC3 2-channel, but not 6-channel [In reply to]

Hi

On 3 April 2012 11:25, Steven Ihde <steve [at] x2> wrote:
> Yes, I can build from source.  I'm happy to try any suggestions you have.  I
> was expecting to see a message about "downmixing" from 6 to 2 channels but I
> don't see one.

if you were running mythfrontend with -v audio, you would have seen it.

Apply the following patch and see how it works:
diff --git a/mythtv/libs/libmyth/audiooutputbase.cpp b/mythtv/libs/libmyth/audio
index 54e9371..3f0420a 100644
--- a/mythtv/libs/libmyth/audiooutputbase.cpp
+++ b/mythtv/libs/libmyth/audiooutputbase.cpp
@@ -534,7 +534,7 @@ void AudioOutputBase::Reconfigure(const AudioSettings &orig_
if (enc)
output_format = FORMAT_S16; // Output s16le for AC-3 encoder
else
- output_format = output_settings->BestSupportedFormat();
+ output_format = FORMAT_S16;
}

if (passthru)



>
> Sorry I missed your earlier message asking for more logs; pasted a longer
> log segment below.
Those aren't with -v audio, so it doesn't help much

> Setting the size to 128 seems to make the first three messages go away, but
> the one about "Unable to sufficiently increase ..." remains.
if this one is still there, so should the previous lines

>
> In neither case do I ever see the "WriteAudio: buffer underrun" messages
> (i.e., neither when sound works nor  when it is silent), so I do not believe
> buffer underruns are the problem, but I am open to suggestion there as well.

Yes, the message is informative only, rather more of an issue with
hdmi and analog playback where you could play 6 channels LPCM audio.
In which case, ALSA's 64kB default is certainly not enough

JY
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://www.mythtv.org/mailman/listinfo/mythtv-users


steve at x2

Apr 2, 2012, 9:58 PM

Post #8 of 15 (1539 views)
Permalink
Re: HDMI sound works for AC3 2-channel, but not 6-channel [In reply to]

The patch worked!

On Apr 2, 2012, at 6:35 PM, Jean-Yves Avenard wrote:
> On 3 April 2012 11:25, Steven Ihde <steve [at] x2> wrote:
>> Yes, I can build from source. I'm happy to try any suggestions you have. I
>> was expecting to see a message about "downmixing" from 6 to 2 channels but I
>> don't see one.
>
> if you were running mythfrontend with -v audio, you would have seen it.

Yes, I see it after enabling -v audio.

>
> Apply the following patch and see how it works:
> diff --git a/mythtv/libs/libmyth/audiooutputbase.cpp b/mythtv/libs/libmyth/audio
> index 54e9371..3f0420a 100644
> --- a/mythtv/libs/libmyth/audiooutputbase.cpp
> +++ b/mythtv/libs/libmyth/audiooutputbase.cpp
> @@ -534,7 +534,7 @@ void AudioOutputBase::Reconfigure(const AudioSettings &orig_
> if (enc)
> output_format = FORMAT_S16; // Output s16le for AC-3 encoder
> else
> - output_format = output_settings->BestSupportedFormat();
> + output_format = FORMAT_S16;
> }
>
> if (passthru)
>
>

The patch worked! Both 2 and 6 channel AC3 are playing back correctly now. After the patch, I see the following:

2012-04-02 21:43:07.729 AO: Opening audio device 'iec958:CARD=CMI8768,DEV=0' ch 2(6) sr 48000 sf signed 16 bit reenc 0

Now it's using 16-bit instead of 32-bit.

Please let me know if I can help with further testing.

>
>>
>> Sorry I missed your earlier message asking for more logs; pasted a longer
>> log segment below.
> Those aren't with -v audio, so it doesn't help much

If you want a full log pre- or post-patch with -v audio let me know.

Thanks,

Steve

_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://www.mythtv.org/mailman/listinfo/mythtv-users


jyavenard at gmail

Apr 2, 2012, 10:46 PM

Post #9 of 15 (1531 views)
Permalink
Re: HDMI sound works for AC3 2-channel, but not 6-channel [In reply to]

Hi

On 3 April 2012 14:58, Steven Ihde <steve [at] x2> wrote:

> The patch worked! Both 2 and 6 channel AC3 are playing back correctly now.  After the patch, I see the following:
>
> 2012-04-02 21:43:07.729 AO: Opening audio device 'iec958:CARD=CMI8768,DEV=0' ch 2(6) sr 48000 sf signed 16 bit reenc 0
>
> Now it's using 16-bit instead of 32-bit.
>
> Please let me know if I can help with further testing.

You should lodge a bug to the ALSA folks. That ALSA reports that your
audio card supports 32 bits audio, when it doesn't...
Do so on either their bug tracker
(https://bugtrack.alsa-project.org/alsa-bug/login_page.php)
or via their mailing list
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://www.mythtv.org/mailman/listinfo/mythtv-users


jyavenard at gmail

Apr 2, 2012, 10:47 PM

Post #10 of 15 (1531 views)
Permalink
Re: HDMI sound works for AC3 2-channel, but not 6-channel [In reply to]

Alternatively, try upgrading to the latest ALSA drivers. Maybe this
issue has been corrected already
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://www.mythtv.org/mailman/listinfo/mythtv-users


steve at x2

Apr 3, 2012, 9:50 PM

Post #11 of 15 (1513 views)
Permalink
Re: HDMI sound works for AC3 2-channel, but not 6-channel [In reply to]

On Apr 2, 2012, at 10:46 PM, Jean-Yves Avenard wrote:
> You should lodge a bug to the ALSA folks. That ALSA reports that your
> audio card supports 32 bits audio, when it doesn't...
> Do so on either their bug tracker
> (https://bugtrack.alsa-project.org/alsa-bug/login_page.php)
> or via their mailing list

Thanks again for your help.

My card has a CMI8768 chipset. After digging around a little, it appears it's intended that it supports a 32-bit sample size, for the purpose of allowing 24-bit samples. See for example this commit

http://git390.marist.edu/cgi-bin/gitweb.cgi?p=linux-2.6.git;a=commitdiff;h=57bd68b8b18608cf2729f97fcb984b8521d19551

I went ahead and reported the bug with Alsa to point out the 32-bit samples produce silence after reproducing this with speaker-test.

Perhaps others might be interested; I found it's possible to work around this issue without recompiling MythTV by using alsa-lib's plug plugin. Adding an entry like such to /etc/asound.conf:

pcm.xyz {
type plug
slave {
pcm "hw:1,2"
format S16_LE
}
}

Defines a new device "xyz" to convert input to S16_LE, and passes it on. This seems to work as well.

-Steve


jyavenard at gmail

Apr 3, 2012, 10:19 PM

Post #12 of 15 (1509 views)
Permalink
Re: HDMI sound works for AC3 2-channel, but not 6-channel [In reply to]

On 4 April 2012 14:50, Steven Ihde <steve [at] x2> wrote:
> I went ahead and reported the bug with Alsa to point out the 32-bit samples
> produce silence after reproducing this with speaker-test.

Cool..

What's the ALSA bug number so I can track its progress?

Thanks
JY
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://www.mythtv.org/mailman/listinfo/mythtv-users


steve at x2

Apr 4, 2012, 6:10 AM

Post #13 of 15 (1513 views)
Permalink
Re: HDMI sound works for AC3 2-channel, but not 6-channel [In reply to]

On Apr 3, 2012, at 10:19 PM, Jean-Yves Avenard wrote:

> On 4 April 2012 14:50, Steven Ihde <steve [at] x2> wrote:
>> I went ahead and reported the bug with Alsa to point out the 32-bit samples
>> produce silence after reproducing this with speaker-test.
>
> Cool..
>
> What's the ALSA bug number so I can track its progress?

https://bugtrack.alsa-project.org/alsa-bug/bug_view_advanced_page.php?bug_id=5569

There does not appear to have been much activity on bugs for this driver in the past few years.

-Steve


jyavenard at gmail

Apr 4, 2012, 7:15 AM

Post #14 of 15 (1504 views)
Permalink
Re: HDMI sound works for AC3 2-channel, but not 6-channel [In reply to]

On 4 April 2012 23:10, Steven Ihde <steve [at] x2> wrote:
> https://bugtrack.alsa-project.org/alsa-bug/bug_view_advanced_page.php?bug_id=5569
>
> There does not appear to have been much activity on bugs for this driver in
> the past few years.

I have found that if you write to the alsa developer mailing list, it
gets much more traction...
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://www.mythtv.org/mailman/listinfo/mythtv-users


jyavenard at gmail

Apr 4, 2012, 7:19 AM

Post #15 of 15 (1502 views)
Permalink
Re: HDMI sound works for AC3 2-channel, but not 6-channel [In reply to]

BTW, if you're indeed using 1.0.21, few will look into it I think..
1.0.25 is the current version, 1.0.21 is several years old
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://www.mythtv.org/mailman/listinfo/mythtv-users

MythTV users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.