Daniel Yek wrote:

OK. So, your system is using the default ALSA setting of 48000Hz.

speaker-test -c2 --device default --rate 44100

no output.

I can hear the pink noise on my system. This indicates that the "default" PCM device setting might not be routed through "plug" (and/or "dmix") in driver configuration file for your sound card.

"default" is typical routed through "plug" and can play in any format, but I know that ALSA's configurations from the drivers are often too difficult to predict.

i'm pretty sure "default" is routed through "dmix" based upon our /etc/asound.conf file. for reference, here's the snd_card and dmix definitions from our asound.conf:

pcm.snd_card {
     type hw
     card 0
}

# Allow mixing of multiple output streams to this device
pcm.dmixer {
     type dmix
     ipc_key 1024
     slave {
          pcm "snd_card"
          # This stuff provides some fixes for latency issues.
          # buffer_size should be set for your audio chipset.
          period_time 0
          period_size 1024
          buffer_size 32768
     }

     bindings {
          0 0
          1 1
     }
}

for some reason, it seems like "dmix" doesn't like 44.1kHz.  if i run:

speaker-test -c2 --device pcm.dmixer --rate 48000

i get output. if i change the rate to 44100, i get the following errors spit out to stderr:

[EMAIL PROTECTED] etc]# speaker-test -c2 --device pcm.dmixer --rate 44100

speaker-test 1.0.11rc4

Playback device is pcm.dmixer
Stream parameters are 44100Hz, S16_LE, 2 channels
Using 16 octaves of pink noise
Rate 44100Hz not available for playback: Invalid argument
Setting of hwparams failed: Invalid argument
.
.
.

note - if i run "speaker-test" using --device pcm.snd_card, both 44.1 and 48 work.

So, AlsaVaryingSampleRate=1 worked.

We know that the system "default" PCM is set to 48000Hz and that Helix can play with some other sampling rate, but somehow, not 48000Hz. That is somewhat contradicting...

What is the sampling rate that the clips is playing with?

the clips are run of the mill MP3 files, samplerate = 44.1kHz.

Is it possible that for some reason helix isn't attempting to play at 48000Hz? You can set break point in _CheckFormat() to find out if 48000Hz is ever attempted.

audio/device/platform/unix/audlinux_alsa.cpp:
CAudioOutLinuxAlsa::_CheckFormat()
...
if (uPrefSampleRateNoDefault) // You can set breakpoint here.
        {
            // The "old" way of handling sample rate test.
err = snd_pcm_hw_params_test_rate (m_pAlsaPCMHandle, hwparams, sample_rate, 0);
            if (err < 0)
            {
                wLastError = RA_AOE_BADFORMAT;
            }
        }
        else
        {
            // Use ALSA's default.
            if (sample_rate != 48000) wLastError = RA_AOE_BADFORMAT;
        }

if i set the breakpoint where you indicated ( line 1884 ), sample_rate is set to 44100 independent of the setting of 'uPrefSampleRateNoDefault'.

If you could turn on Unified Logging (https://common.helixcommunity.org/2005/devdocs/UnifiedLogging), it would be even easier to find out -- you would find log statement in hxlog.txt in helix source code "root" directory.

with AlsaVaryingSampleRate set to '1', here's the relevant section of the log file ( with timestamps removed ):

ADEV    CHXAudioSession[0x8081c00]::Setup()
ADEV    CHXAudioSession[0x8081c00]::CreateAudioDevice()
ADEV    CHXAudioSession[0x8081c00]::CreateAudioDevice(): created [0x80a9418]
ADEV    _OpenAudio() while checking format!
ADEV    Opening ALSA PCM device, default, to check format!
ADEV    Closing ALSA PCM device after check format!
ADEV    CHXAudioSession[0x8081c00]::OpenDevice()
ADEV    CHXAudioSession[0x8081c00]::TryOpenAudio()
ADEV    CHXAudioSession[0x8081c00]::ReleaseAudioDevice()
ADEV    ERROR: Closing ALSA PCM device, but the device is not opened!
ADEV    CHXAudioSession[0x8081c00]::RestoreReplacedDevice()
ADEV    CHXAudioSession[0x8081c00]::CreateAudioDevice()
ADEV    CHXAudioSession[0x8081c00]::CreateAudioDevice(): created [0x80b6460]
ADEV    _OpenAudio() outside _CheckFormat()!
ADEV    Opening ALSA PCM device, default, for actual use!
ADEV    Requested a buffering time of 500000, got a time of 682653
ADEV    Requested a period time of 170663, got a period of 21333
ADEV    Device Configured:

ADEV      Sample Rate: 44100
ADEV      Sample Width: 2
ADEV      Num channels: 2
ADEV      Block size: 8800
ADEV      Device buffer size: 120420
ADEV      Supports HW Pause: 0
ADEV      Start threshold: 30080
ADEV CHXAudioSession[0x8081c00]::TryOpenAudio(): open succeeded; pausing audio device (default state)

with AlsaVaryingSampleRate set to '0', here's the relevant section of the log file ( with timestamps removed ):

ADEV    CHXAudioSession[0x8081c00]::Setup()
ADEV    CHXAudioSession[0x8081c00]::CreateAudioDevice()
ADEV    CHXAudioSession[0x8081c00]::CreateAudioDevice(): created [0x80a9418]
ADEV    _OpenAudio() while checking format!
ADEV    Opening ALSA PCM device, default, to check format!
ADEV    Closing ALSA PCM device after check format!
ADEV    _OpenAudio() while checking format!
ADEV    Opening ALSA PCM device, default, to check format!
ADEV    Closing ALSA PCM device after check format!
ADEV    _OpenAudio() while checking format!
ADEV    Opening ALSA PCM device, default, to check format!
ADEV    Closing ALSA PCM device after check format!
ADEV    _OpenAudio() while checking format!
ADEV    Opening ALSA PCM device, default, to check format!
ADEV    Closing ALSA PCM device after check format!
ADEV    _OpenAudio() while checking format!
ADEV    Opening ALSA PCM device, default, to check format!
ADEV    Closing ALSA PCM device after check format!
ADEV    _OpenAudio() while checking format!
ADEV    Opening ALSA PCM device, default, to check format!
ADEV    Closing ALSA PCM device after check format!
ADEV    CHXAudioSession[0x8081c00]::OpenDevice()
ADEV    CHXAudioSession[0x8081c00]::TryOpenAudio()
ADEV    CHXAudioSession[0x8081c00]::ReleaseAudioDevice()
ADEV    ERROR: Closing ALSA PCM device, but the device is not opened!
ADEV    CHXAudioSession[0x8081c00]::RestoreReplacedDevice()
ADEV    CHXAudioSession[0x8081c00]::CreateAudioDevice()
ADEV    CHXAudioSession[0x8081c00]::CreateAudioDevice(): created [0x80a9418]
ADEV    _OpenAudio() outside _CheckFormat()!
ADEV    Opening ALSA PCM device, default, for actual use!
ADEV    Requested a buffering time of 500000, got a time of 682666
ADEV    Requested a period time of 170666, got a period of 21333
ADEV    Device Configured:

ADEV      Sample Rate: 48000
ADEV      Sample Width: 2
ADEV      Num channels: 2
ADEV      Block size: 9600
ADEV      Device buffer size: 131072
ADEV      Supports HW Pause: 0
ADEV      Start threshold: 31744
ADEV CHXAudioSession[0x8081c00]::TryOpenAudio(): open succeeded; pausing audio device (default state)

i'm confused... with 'VaryingRate' enabled, it looks like Helix decides to use 44.1kHz for playback and succeeds, however with 'VaryingRate' set to '0', it tries to use 48kHz and no output happens. this seems to be the opposite of what happens with speaker-test!

thanks again for your help!

ciao,
/tony







_______________________________________________
Audio-dev mailing list
[email protected]
http://lists.helixcommunity.org/mailman/listinfo/audio-dev

Reply via email to