snd_pcm_hw_params_set_buffer_size problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I have some code that works on my dev machine but breaks on my target machine. The essential differences are different libasound versions and different audio devices. The code is compiled and linked separately on the dev system and the target system. The data used to set the buffer size is the same in both cases.

The code fragment is

      if ( ( err = snd_pcm_hw_params_set_buffer_size ( playback_handle, hw_params, bufout ) ) < 0 )
        {
          ERR ( "cda_AlsaManager::_setupPlayback cannot set buffer size (%s)\n",
                snd_strerror ( err ) );
        }

      ....

  snd_pcm_hw_params_get_buffer_size ( hw_params, &bufferSize );
  INF ( "cda_AlsaManager::_setupPlayback Buffer size = %d bytes \n", bufferSize );


On the dev system (Wheezy) this works fine.

Sep 26 2014 09:17:32 INFO : int cda_AlsaManager::_setupPlayback(const char*, unsigned int*, snd_pcm_format_t, int, int)() (135) cda_AlsaManager::_setupPlayback opening device default 
Sep 26 2014 09:17:32 INFO : int cda_AlsaManager::_setupPlayback(const char*, unsigned int*, snd_pcm_format_t, int, int)() (180) cda_AlsaManager::_setupPlayback setting buffer size  882 
Sep 26 2014 09:17:32 INFO : int cda_AlsaManager::_setupPlayback(const char*, unsigned int*, snd_pcm_format_t, int, int)() (206) cda_AlsaManager::_setupPlayback Buffer size = 882 bytes 

Dev Libraries are

ii  libasound2:i386                      1.0.25-4                           i386         shared library for ALSA applications
ii  libasound2-dev:i386                  1.0.25-4                           i386         shared library for ALSA applications -- development files

On the target system (Centos 5) I get the error message

Sep 26 2014 10:08:18 INFO : int cda_AlsaManager::_setupPlayback(const char*, unsigned int*, snd_pcm_format_t, int, int)() (135) cda_AlsaManager::_setupPlayback opening device default
Sep 26 2014 10:08:18 INFO : int cda_AlsaManager::_setupPlayback(const char*, unsigned int*, snd_pcm_format_t, int, int)() (180) cda_AlsaManager::_setupPlayback setting buffer size  882
Sep 26 2014 10:08:18 ERROR : int cda_AlsaManager::_setupPlayback(const char*, unsigned int*, snd_pcm_format_t, int, int)() (187) cda_AlsaManager::_setupPlayback cannot set buffer size (Invalid argument)

Sep 26 2014 10:08:18 INFO : int cda_AlsaManager::_setupPlayback(const char*, unsigned int*, snd_pcm_format_t, int, int)() (206) cda_AlsaManager::_setupPlayback Buffer size = 15052 bytes


Target Libraries are

alsa-lib.i386                            1.0.17-1.el5                  installed
alsa-lib-devel.i386                      1.0.17-1.el5                  installed

I don't have the option of changing the library version on the target system. Data being written is 16 bit PCM mono 44100 Hz and the target system uses a USB audio device based on Burr-Brown chipset.

Any suggestions?

--
Jeremy Ardley
------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
Alsa-user mailing list
Alsa-user@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/alsa-user

[Index of Archives]     [ALSA Devel]     [Linux Audio Users]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]

  Powered by Linux