[mythtv-users] ALSA:surround51 with MythTV 0.24

Achim Hofmann news at achim-hofmann.com
Tue Mar 8 22:26:05 UTC 2011


Jean-Yves Avenard <jyavenard at gmail.com> wrote:

> On 7 March 2011 07:00, Achim Hofmann <news at achim-hofmann.com> wrote:
> 
>> When set to ALSA:surround51:CARD=V8237,DEV=0 and playing a movie, the
>> following error appears in mythfrondend.log:
> 
> could you lodge a ticket in trac and post the output of the outpot log
> with -v audio,playback

Okay, I invested some time to get more detailed information on this
problem and ended up to the following result:

The first problem is the sample rate. My sound card reports to support
all usual sample rates between 8 kHz and 48 kHz. Actually this is a lie
because the only sample rate it really supports is 48 kHz. Okay, this
can be solved by forcing a resampling to 48 kHz in the advanced audio
settings of MythTV. Doing so audio sounds fine.

Unfortunately this solution only works when using the ALSA default pcm
device "ALSA:default:CARD=V8237". When switching to another ALSA pcm
device like "surround51:CARD=V8237,DEV=0" the following happens:

2011-03-08 21:23:27.880 AFD: Using 1 CPUs for decoding
2011-03-08 21:23:27.880 AFD: InitVideoCodec() 0xaad2d10 id(MPEG4) type
(Video).
2011-03-08 21:23:27.880 AFD: Selected FPS is 25 (avg 0 stream 29.97
container 25 estimated 25)
2011-03-08 21:23:27.880 Player(4): detectInterlace(Detect Scan,
Interlaced Scan, 25, 480) ->Interlaced Scan
2011-03-08 21:23:27.881 AFD Warning: ScanATSCCaptionStreams() called
with no PMT
2011-03-08 21:23:27.881 AFD: Using ffmpeg for video decoding
2011-03-08 21:23:27.881 AFD: Looking for decoder for MPEG4
2011-03-08 21:23:27.886 AFD: Opened codec 0xaad2d10, id(MPEG4) type(Video)
2011-03-08 21:23:27.887 AFD: Stream #1, has id 0x1 codec id MP3, type
Audio, bitrate 112000 at 0xaa7ff70
2011-03-08 21:23:27.888 AFD: codec MP3 has 2 channels
2011-03-08 21:23:27.888 AFD: Looking for decoder for MP3
2011-03-08 21:23:27.888 AFD: Opened codec 0xb2b8dd0, id(MP3) type(Audio)
2011-03-08 21:23:27.888 AFD: Audio Track #1 is A/V stream #1 and has 2
channels in the Undetermined language(7695972).
2011-03-08 21:23:27.888 AFD: Selected track 1: Undetermined MP3 2ch (A/V
Stream #1)
2011-03-08 21:23:27.888 AFD: Initializing audio parms from audio track #1
2011-03-08 21:23:27.888 AFD: Audio format changed
                        from id(NONE)     -1Hz -1ch -1bps     to id(
MP3)  44100Hz  2ch 16bps
2011-03-08 21:23:27.889 AO: Killing AudioOutputDSP
2011-03-08 21:23:28.072 AO: Sample rate 8000 is supported
2011-03-08 21:23:28.072 AO: Sample rate 11025 is supported
2011-03-08 21:23:28.073 AO: Sample rate 16000 is supported
2011-03-08 21:23:28.073 AO: Sample rate 22050 is supported
2011-03-08 21:23:28.073 AO: Sample rate 32000 is supported
2011-03-08 21:23:28.073 AO: Sample rate 44100 is supported
2011-03-08 21:23:28.073 AO: Sample rate 48000 is supported
2011-03-08 21:23:28.073 AO: 1 channel(s) are supported
2011-03-08 21:23:28.073 AO: 2 channel(s) are supported
2011-03-08 21:23:28.073 AO: 3 channel(s) are supported
2011-03-08 21:23:28.074 AO: 4 channel(s) are supported
2011-03-08 21:23:28.074 AO: 5 channel(s) are supported
2011-03-08 21:23:28.074 AO: 6 channel(s) are supported
2011-03-08 21:23:28.074 AO: 7 channel(s) are supported
2011-03-08 21:23:28.074 AO: 8 channel(s) are supported
2011-03-08 21:23:28.085 AO: Killing AudioOutputDSP
2011-03-08 21:23:28.085 AO: Original codec was MP3, signed 16 bit, 44
kHz, 2 channels
2011-03-08 21:23:28.085 AO: enc(0), passthru(0), canAC3(0), canDTS(0),
canLPCM(1), configured_channels(2), 2 channels supported(1)
2011-03-08 21:23:28.087 AO: Forcing resample to 48 kHz
2011-03-08 21:23:28.087 AO: Resampling from 44 kHz to 48 kHz with
quality medium
2011-03-08 21:23:28.088 AO: Resampler allocating 35680
2011-03-08 21:23:28.088 AO: Audio processing enabled
2011-03-08 21:23:28.088 AO: Opening audio device
'surround51:CARD=V8237,DEV=0' ch 2(2) sr 48000 sf signed 16 bit reenc 0
2011-03-08 21:23:28.090 ALSA: SetParameters(format=2, channels=2,
rate=48000, buffer_time=200000, period_time=50000)
2011-03-08 21:23:28.090 ALSA: Requested 200000us got 113770 buffer time
2011-03-08 21:23:28.090 ALSA, Error: Error opening
/proc/asound/card0/pcm1p/sub0/prealloc. Fix reading permissions.
2011-03-08 21:23:28.090 ALSA, Error: Unable to sufficiently increase
ALSA hardware buffer size - underruns are likely
2011-03-08 21:23:28.091 ALSA: SetParameters(format=2, channels=2,
rate=48000, buffer_time=200000, period_time=50000)
2011-03-08 21:23:28.092 ALSA: Buffer time = 113770 us
2011-03-08 21:23:28.092 ALSA: Period time = 2645 us
2011-03-08 21:23:28.094 ALSA: Buffer size = 5461 | Period size = 127
2011-03-08 21:23:28.098 ALSA: found playback control Master on mixer
device default
2011-03-08 21:23:28.098 ALSA: mixer volume range on mixer device
default/Master - min 0, max 31, range 31
2011-03-08 21:23:28.098 ALSA: mixer device default/Master set up
successfully
2011-03-08 21:23:28.100 ALSA: channel 0 volume set 100 => 31
2011-03-08 21:23:28.100 ALSA: channel 1 volume set 100 => 31
2011-03-08 21:23:28.100 ALSA: get volume channel 0: 100
2011-03-08 21:23:28.100 ALSA: channel 0 volume set 100 => 31
2011-03-08 21:23:28.100 ALSA: channel 1 volume set 100 => 31
2011-03-08 21:23:28.100 AO: Audio fragment size: 254
2011-03-08 21:23:28.100 AO: Audio Stretch Factor: 1
2011-03-08 21:23:28.101 AO: Ending Reconfigure()
2011-03-08 21:23:28.101 AudioPlayer: Enabling Audio
2011-03-08 21:23:28.101 AO: Reconfigure(): No change -> exiting
2011-03-08 21:23:28.101 Dec: Selected track #1 in the Unknown language(0)
2011-03-08 21:23:28.101 Dec: Resyncing position map. posmapStarted = 0
livetv(0) watchingRec(0)
2011-03-08 21:23:28.105 Dec: SyncPositionMap prerecorded, from DB: 0 entries

After MythTV tries to access the non-existing file
/proc/asound/card0/pcm1p/sub0/prealloc it completly forgot that a
resampling to 48 kHz was requested: AO: Reconfigure(): No change ->
exiting. Without resampling audio sounds crappy, of course.

So from this point I see two possible solutions:

1. Stop MythTV trying to handle with the non-existing file and hope that
this way the resampling is done as requested.

2. Using /etc/asound.conf to force a sample rate of 48k. Unfortunately
I'm not familiar enough with alsa to write such a configuration.

Anyone having a suggestion before I raise a ticket?

Regards,
Achim Hofmann


More information about the mythtv-users mailing list