[mythtv-users] 0.24 no sound with Alsa multi pcm - channels setup problem

Jean-Yves Avenard jyavenard at gmail.com
Wed Nov 17 00:29:14 UTC 2010


Hi

On 17 November 2010 08:45, Matt Taylor <mwtaylor at gmail.com> wrote:

> Hi,
>
> I use a custom asound.conf to give me output over optical (for my
> receiver) and analogue simultaneously so that I can have sound in
> another room at the same time, this uses the alsa multi pcm. This setup
> worked fine with 0.23 (and is fine in mplayer, mpd etc.) but with 0.24
> release and 0.24-fixes svn I cannot produce sound using this output. I
> get an error like this one when trying to use ALSA:default:
>
> 2010-11-16 21:12:30.186 Opening ALSA audio device 'default'.
> 2010-11-16 21:12:30.233 ALSA, Error: Channels count 2 not available:
> Invalid argument
> 2010-11-16 21:12:30.233 ALSA, Error: Unable to set ALSA parameters:
> Invalid argument
> 2010-11-16 21:12:30.265 AudioOutput Error: Aborting reconfigure
> 2010-11-16 21:12:30.265 AudioPlayer: Disabling Audio, reason is:
> Aborting reconfigure
>

Myth needs to know how many channels are supported by the audio card so it
can properly downmix or upmix the audio as required

Myth makes the assumption that stereo is available if it can't read that
information
For ALSA to report that stereo isn't available is IMHO a bug with alsa.



> If I disable the channel configuring stuff by changing
> mythtv/libs/libmyth/audiooutputalsa.cpp
>
> #define OPEN_FLAGS (SND_PCM_NO_AUTO_RESAMPLE|SND_PCM_NO_AUTO_FORMAT|\
> SND_PCM_NO_AUTO_CHANNELS
>
> to:
>
> #define OPEN_FLAGS (SND_PCM_NO_AUTO_RESAMPLE|SND_PCM_NO_AUTO_FORMAT)
>
> The sound works fine using this output and I have sound in both rooms.
>
> (Sound also works in 0.24 accessing just optical directly, or by using
> ALSA:default changing asound.conf not to use the multi pcm, but this
> doesn't give me what I want.)
>
> For the moment I am happy using the hack I have outlined above but is
> there a way to implement a cleaner solution to this problem?
>
>
there are no cleaner way to do what you've done. You simply tell ALSA to do
some magic with the audio samples if the number of channels requested isn't
available.
I put a similar work around in http://svn.mythtv.org/trac/changeset/26971

So we don't try to check the format supported if we found that it fails.

What you could do however is not modify the OPEN_FLAGS but instead
change
#define FILTER_FLAGS ~(SND_PCM_NO_AUTO_FORMAT)
into
#define FILTER_FLAGS ~(SND_PCM_NO_AUTO_FORMAT|SND_PCM_NO_AUTO_CHANNELS)

At least this won't break the auto-detection phase.

Let me know how this works for you, if it does, I will commit that fix..

Probably could change how the audio device is opened there using default
values, as we've already got the information we needed by then
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mythtv.org/pipermail/mythtv-users/attachments/20101117/24444eb8/attachment.htm>


More information about the mythtv-users mailing list