Hi<br><br><div class="gmail_quote">On 17 November 2010 08:45, Matt Taylor <span dir="ltr">&lt;<a href="mailto:mwtaylor@gmail.com">mwtaylor@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hi,<br>
<br>
I use a custom asound.conf to give me output over optical (for my<br>
receiver) and analogue simultaneously so that I can have sound in<br>
another room at the same time, this uses the alsa multi pcm. This setup<br>
worked fine with 0.23 (and is fine in mplayer, mpd etc.) but with 0.24<br>
release and 0.24-fixes svn I cannot produce sound using this output. I<br>
get an error like this one when trying to use ALSA:default:<br>
<br>
2010-11-16 21:12:30.186 Opening ALSA audio device &#39;default&#39;.<br>
2010-11-16 21:12:30.233 ALSA, Error: Channels count 2 not available:<br>
Invalid argument<br>
2010-11-16 21:12:30.233 ALSA, Error: Unable to set ALSA parameters:<br>
Invalid argument<br>
2010-11-16 21:12:30.265 AudioOutput Error: Aborting reconfigure<br>
2010-11-16 21:12:30.265 AudioPlayer: Disabling Audio, reason is:<br>
Aborting reconfigure<br></blockquote><div><br>Myth needs to know how many channels are supported by the audio card so it can properly downmix or upmix the audio as required<br><br>Myth makes the assumption that stereo is available if it can&#39;t read that information<br>
For ALSA to report that stereo isn&#39;t available is IMHO a bug with alsa.<br><br><br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

<br>
If I disable the channel configuring stuff by changing<br>
mythtv/libs/libmyth/audiooutputalsa.cpp<br>
<br>
#define OPEN_FLAGS (SND_PCM_NO_AUTO_RESAMPLE|SND_PCM_NO_AUTO_FORMAT|\<br>
SND_PCM_NO_AUTO_CHANNELS<br>
<br>
to:<br>
<br>
#define OPEN_FLAGS (SND_PCM_NO_AUTO_RESAMPLE|SND_PCM_NO_AUTO_FORMAT)<br>
<br>
The sound works fine using this output and I have sound in both rooms.<br>
<br>
(Sound also works in 0.24 accessing just optical directly, or by using<br>
ALSA:default changing asound.conf not to use the multi pcm, but this<br>
doesn&#39;t give me what I want.)<br>
<br>
For the moment I am happy using the hack I have outlined above but is<br>
there a way to implement a cleaner solution to this problem?<br><br></blockquote><div><br>there are no cleaner way to do what you&#39;ve done. You simply tell ALSA to do some magic with the audio samples if the number of channels requested isn&#39;t available.<br>
I put a similar work around in <a href="http://svn.mythtv.org/trac/changeset/26971">http://svn.mythtv.org/trac/changeset/26971</a><br><br>So we don&#39;t try to check the format supported if we found that it fails.<br><br>
What you could do however is not modify the OPEN_FLAGS but instead <br>change<br>#define FILTER_FLAGS ~(SND_PCM_NO_AUTO_FORMAT)<br>into<br>#define FILTER_FLAGS ~(SND_PCM_NO_AUTO_FORMAT|SND_PCM_NO_AUTO_CHANNELS)<br><br>At least this won&#39;t break the auto-detection phase.<br>
<br>Let me know how this works for you, if it does, I will commit that fix..<br><br>Probably could change how the audio device is opened there using default values, as we&#39;ve already got the information we needed by then<br>
</div></div>