[mythtv-users] Simultaneous analogue (analog) and S/PDIF output

Alex Butcher mythlist at assursys.co.uk
Wed Jan 12 12:44:52 UTC 2011


On Wed, 12 Jan 2011, Jean-Yves Avenard wrote:

> On 12 January 2011 21:57, Alex Butcher <mythlist at assursys.co.uk> wrote:
>
>> * Mon Nov 22 2010 Jarod Wilson <jarod at wilsonet.com> 0.24-2
>> - Update to release-0-24-fixes, svn revision 27317
>> - Add preview image fixup patch from ticket #9256
>> - Add alsa passthru device patches from trunk r27306 and r27307
>> [...]
>
> I have no idea what those patches are; and to be honest, I have no
> intention on investigating what they are... The audio code is in a
> current state I specifically intended to be in, if other people
> backport stuff, then you're on your own
>
> If I had felt the need the 0.24 branch would required some backports
> from trunk, then it would have been done by now.

Well, that's what most Fedora users will probably end up using by default,
as most prefer packages from rpmfusion to those from ATrpms.  It sounds as
though rpmfusion are especially long overdue in updating their packages.  I
generally don't chase 'the latest and greatest' in any of my production
systems (home or work) unless have good and specific reason to, 
think that's unusual.

I can easily take care of building some new RPMs against the current
0.24-fixes from GIT (unless there's a specific 'good' commit that's
preferable to the current commit?)

>> There's no StereoPCM flag in my GUI. Is the StereoPCM flag you describe the
>> MultiChannelPCM row?  If so, that's currently:
>>
>> | MultiChannelPCM | 0    | xxxxxxxxxxxxxxxxxxxxxxx |
>
> if there's no stereopcm flag , then you are running a too old version of mythtv.
>
> If you're stuck to a SVN revision, then it's no wonder.. Upgrade to
> the latest stable branch.

OK, got the message there. :-)

>> If I understand you and mythtv-0.24/libs/libmyth/audiooutputsettings.cpp
>> correctly, to summarise your settings for non-upmixed stereo over analogue +
>> S/PDIF, but passthru for AC3 and DTS (with the caveat that analogue channel
>> will need to be muted), I think I need to make these settings:
>>
>> AudioOutputDevice=ALSA:default
>
> if you're using ALSA:default as your audio output device, how do you
> ever expect it to send audio to both analog and digital... Did you
> read my previous post ?

Did you read mine? ;-)

I've stated in my initial message and in my previous one that I've created a
.asoundrc that provides simultaneous output when apps use ALSA:default as
their output device (that's the what 'play foo.wav' and 'aplay foo.wav' will
do, right?)

Perhaps something like
<http://www.gossamer-threads.com/lists/mythtv/users/464454#464454> would be
better, though (after changing the device numbers and commenting out the
references to, and entry for the pcm.tv device)

>> MixerDevice=ALSA:default
>> MixerControl=PCM
>> MasterMixerVolume=per preferences
>
> I don't know if that would work with the mixer device ; but I would
> disable volume control totally for the time being.. volume control can
> never work with digital audio

OK, good tip.

>> AudioDefaultUpmix=0
>> AudioUpmixType=0
>> MusicDefaultUpmix=0
>> AC3PassThru=1
>> DTSPassThru=1
>> AdvancedAudioSettings=1
>>
>> These I'm less sure about:
>> MaxChannels=2 ???
>
> if you have set max channels to 2; then no multichannels output will
> ever occur, and obviously you'll never get passthrough working. Stereo
> at best.

No, it is set to 6 presently, but my reading of the source suggested that 2
might be appropriate, because it looked like if AC3 or DTS passthru were
being used it'd get overridden to 6 anyway.

> Sorry, but I thought that it was obvious that to get multichannels
> audio working, you would need to configure the speaker set up to at
> least 5.1...

Perhaps if the code were commented... ;-)

> if you set it to stereo; the passthrough device will never be used.
> Myth will only ever output stereo, and the passthrough device will be
> ignored as it's only ever used for multichannels audio
>
>> PassThruDeviceOverride=0 ???
>> PassThruDevice='ALSA:iec958:AES0=6' or 'ALSA:iec958:{ AES0 0x06 }' ???
>> MultiChannelPCM=0 ???
>
> then re-read again my post just before... because if that's how you
> set your device, you obviously didn't read it

When you wrote in your second message:

"If you are ok with only having stereo output to both analog and
digital, and 5.1 to digital only then you can re-enable ac3 and DTS
passthrough"

I thought that meant to set AC3PassThru and DTSPassThru *only* to 1, set
PassThruDeviceOverride to 0.

> Passthrough device override must be set.
> ALSA:iec958:AES0=6 or ALSA:iec958:{ AES0 0x06 }
>
> Those are the same. there are a few ways you can define the device in ALSA...

OK, cool.

>> I hope you'll forgive me for being persistent; as well as solving my
>> immediate problem I'm trying to make this thread something of a canonical
>> explanation of how MythTV handles analogue, S/PDIF, and so on so that people
>> with problems can refer to it to debug their problems too (regardless of
>> what the GUI reports; we've all seen incidents where the settings GUIs
>> report differ from the settings that are actually being /used/).  I'll wiki
>> it later, even.
>
> I would forgive you for being persistent, if you at least followed the
> instructions I spent time writing for you...

I hope you can appreciate that it's hard to do that when what you describe
doesn't match with what the GUI of the version I'm using shows. Please, if
you're describing functionality that's only present in the absolute
latest-and-greatest, it'd be helpful if you noted this (e.g "In the current
version, you can do XXX, but the code for that only got introduced in the
last month or so, so you can't do it, or need to do it in way YYY with
earlier versions").

I tried to eliminate this confusion by stating from the outset which version
I was using, and referring to the underlying configuration settings in the
database rather than how the GUI presents them. I thought that would be
easier for a fellow hacker to work with so we could guarantee we were
talking about the same things. Mea culpa.

> I wrote to use an audio device you created using ALSA configuration,
> you are using ALSA:default: wrong.
> Some people posted .asoundrc to write to multiple audio device at
> once, you should start with those...

<http://www.gossamer-threads.com/lists/mythtv/users/464454#464454> ?

or the one I'm already using (mostly successfully):

<http://ubuntuforums.org/showpost.php?p=5794935&postcount=4> ?

The trouble is, there's so many out there that it's difficult to work out
which one's best for a given purpose without getting neck deep in
particularly-cryptic ALSA config (and I say that as someone who's been
working with UNIX for nearly two decades and is quite happy writing driver
code, Snort NIDS rules, iptables rules and more).  ALSA seems to suffer from
the same usability issues as the GNU autotools; hardly anyone fully
understands them so they just cobble bits together from other peoples'
configs until they get something which (seems to) work.  My (tenuous)
understanding of those config files is that they both had the effect of
redefining ALSA:default.  From reading
<http://www.gossamer-threads.com/lists/mythtv/users/464454#464454> , I see
that I should probably be using ALSA:both with either of those config files.

>> I'm aware of your status as author of many of these bits (and the original
>> VDPAU stuff). My comment was really intended as "Are you sure it /worked/ as
>> you describe /as of 21 November 2010/, rather than -trunk or the /current/
>> 0.24-fixes'. :-)
>
> I am sure... provided you run the latest version of that particular branch.

Now you've said that, I'll take care to note that any advice you give will,
unless you explicitly say otherwise, only apply to the current GIT commit of
a given branch.

> We aren't using svn anymore, and haven't been for a few months now...

Yup. I imagine this might be a factor in why Jarod hasn't updated the
rpmfusion packages.

>> But my UI doesn't show some of the settings you describe or at least, not
>> with the labels you give them.  I gather others have reported the same
>> problem with screenshots (I think you were in the thread).
>
> this is what happens if you aren't running a relatively recent (e.g.
> more than 2 months old) version of 0.24..
>
> The issue that the configuration page doesn't show properly on low
> resolution screen is something I've fixed in trunk, or in my 0.24 fork
> with the new audio code..
> I only discovered that Qt completely screwed up the rendering on low
> res screen, and to be honest, I have no idea why ..
>
> So to summarise (again :) ):
> Output device: ALSA:myfancymixer_i_created_in_asoundrc
ALSA:both probably (as per .asoundrc), then.
> Multichannel PCM uncheck
> AC3 = DTS = check
> Speakers 5.1
> upmixer: uncheck
> advanced: check
> override passthrough: check
> passthrough device: ALSA:iec958:AES0=6 (can probably use the default
> entry: ALSA:iec958:{ AES0 0x2} ... )

I was a bit puzzled as to whether the changed control word bitmask
(<http://en.wikipedia.org/wiki/S/PDIF#Channel_status_bit>) would make any
difference.  AES0=0x02 used to work with my receiver, and there would be 6
channels of audio rather than 4 anyway...

> if using updated version of 0.24
> Output device: ALSA:myfancymixer_i_created_in_asoundrc
> AC3 = DTS = check
> Speakers 5.1
> upmixer: uncheck
> advanced: check
> override passthrough: check
> passthrough device: ALSA:iec958:AES0=6 (can probably use the default
> entry: ALSA:iec958:{ AES0 0x2} ... )
> StereoPCM: check

Thank you for your patience and perseverance. I think I probably understand
what's going on enough to get it working fully, and document it for others.
We'll see...

All the best,
Alex


More information about the mythtv-users mailing list