Opened 10 years ago

Closed 10 years ago

#7392 closed defect (fixed)

Audio resampling errors on Mac OS X

Reported by: Nigel Owned by: JYA
Priority: minor Milestone: unknown
Component: MythTV - Audio Output Version: head
Severity: medium Keywords:
Cc: Ticket locked: no

Description

Recently (probably after [22432]), Mac audio seems to have transformed into silence, with errors like:

2009-10-22 10:53:14.529 AO, ERROR: Error occurred while resampling audio: SRC ratio outside [1/256, 256] range.
2009-10-22 10:53:14.569 AO, ERROR: Error occurred while resampling audio: SRC ratio outside [1/256, 256] range.
2009-10-22 10:53:14.569 AO, ERROR: Error occurred while resampling audio: SRC ratio outside [1/256, 256] range.

or, with -v audio,extra:

2009-10-22 11:27:04.183 CoreAudioData::CoreAudioData - default device ID = 262
2009-10-22 11:27:04.183 AO: Killing AudioOutputDSP
2009-10-22 11:27:04.183 AO: Original audio codec was NONE
2009-10-22 11:27:04.183 AO: Using resampler. From: 48000 to 0
2009-10-22 11:27:04.185 Opening audio device 'Default'. ch 2(2) sr 0 (reenc 0)
2009-10-22 11:27:04.185 AudioOutputCA::OpenDevice() Trying Analog.
2009-10-22 11:27:04.208 AO: Audio fragment size: 0
2009-10-22 11:27:04.208 AO: Audio Stretch Factor: 1
2009-10-22 11:27:04.208 AO: Ending reconfigure
2009-10-22 11:27:04.208 AO: Killing AudioOutputDSP
2009-10-22 11:27:04.234 AO: Original audio codec was NONE
2009-10-22 11:27:04.235 AO: Using resampler. From: 48000 to 0
2009-10-22 11:27:04.238 Opening audio device 'Default'. ch 2(2) sr 0 (reenc 0)
2009-10-22 11:27:04.238 AudioOutputCA::OpenDevice() Trying Analog.
2009-10-22 11:27:04.245 AO: Audio fragment size: 0
2009-10-22 11:27:04.246 AO: Audio Stretch Factor: 1
2009-10-22 11:27:04.246 AO: Ending reconfigure
2009-10-22 11:27:04.256 AO: Killing AudioOutputDSP
2009-10-22 11:27:04.282 AO: Original audio codec was NONE
2009-10-22 11:27:04.284 AO: Using resampler. From: 48000 to 0
2009-10-22 11:27:04.287 Opening audio device 'Default'. ch 2(2) sr 0 (reenc 0)
2009-10-22 11:27:04.287 AudioOutputCA::OpenDevice() Trying Analog.
2009-10-22 11:27:04.295 AO: Audio fragment size: 0
2009-10-22 11:27:04.295 AO: Audio Stretch Factor: 1
2009-10-22 11:27:04.295 AO: Ending reconfigure
2009-10-22 11:27:04.295 AO: Pause 1
...
2009-10-22 11:27:05.264 AO: Pause 1
2009-10-22 11:27:05.264 TV: StartPlayer(0, Watching WatchingPreRecorded, main) -- end ok
...
2009-10-22 11:27:05.268 AO, ERROR: Error occurred while resampling audio: SRC ratio outside [1/256, 256] range.
2009-10-22 11:27:05.268 AO, ERROR: Error occurred while resampling audio: SRC ratio outside [1/256, 256] range.
2009-10-22 11:27:05.268 AO, ERROR: Error occurred while resampling audio: SRC ratio outside [1/256, 256] range.

Change History (3)

comment:1 Changed 10 years ago by JYA

The audio track isn't detected properly here: "2009-10-22 11:27:04.183 AO: Original audio codec was NONE"

Should be everything but none.. That's why you get silence, there's nothing to play.

I guess I should test that the audio stream to be played is null and not try to downsample it.

Are you sure about the file you're trying to play? Did you recompile the various plugins and did a make distclean first?

comment:2 Changed 10 years ago by Nigel

Build is OK. NuppleVideo? recordings can (do?) exhibit codec=NONE.
Problem is failure of, or unimplemented, GetSupportedRates?(). This change:

% svn diff audiooutputbase.cpp
Index: audiooutputbase.cpp
===================================================================
--- audiooutputbase.cpp	(revision 22559)
+++ audiooutputbase.cpp	(working copy)
@@ -271,6 +271,10 @@
     vector<int>::iterator it;
     bool resample = true;
 
+    // Assume 48k if we can't get supported rates
+    if (rates.empty())
+        rates.push_back(48000);
+
     for (it = rates.begin(); it < rates.end(); it++)
     {
         VERBOSE(VB_AUDIO, LOC + QString("Sample rate %1 is supported")
@@ -279,10 +283,6 @@
             resample = false;
     }
 
-    // Assume 48k if we can't get supported rates
-    if (rates.empty())
-        rates.push_back(48000);
-
     if (resample)
     {
         int error;

gives me working audio:

2009-10-22 13:55:38.450 CoreAudioData::CoreAudioData - default device ID = 262
2009-10-22 13:55:38.450 AO: Killing AudioOutputDSP
2009-10-22 13:55:38.450 AO: Original audio codec was NONE
2009-10-22 13:55:38.450 AO: Sample rate 48000 is supported
2009-10-22 13:55:38.450 Opening audio device 'Default'. ch 2(2) sr 48000 (reenc 0)
2009-10-22 13:55:38.450 AudioOutputCA::OpenDevice() Trying Analog.
2009-10-22 13:55:39.012 AO: Audio fragment size: 0
2009-10-22 13:55:39.013 AO: Audio Stretch Factor: 1
2009-10-22 13:55:39.013 AO: Ending reconfigure
2009-10-22 13:55:39.013 AO: no change exiting
2009-10-22 13:55:39.017 AO: no change exiting
2009-10-22 13:55:39.018 AO: Pause 1
...

comment:3 Changed 10 years ago by JYA

Resolution: fixed
Status: newclosed

(In [22563]) Do not resample audio if no available samplerate has been retrieved.

Fix #7392

Note: See TracTickets for help on using tickets.