GithubHelp home page GithubHelp logo

lao's People

Contributors

bartbes avatar daurnimator avatar peterbillam avatar thelinx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

lao's Issues

ao.openLive() errs or segfaults (depending)

I have lao installed on OS X 10.8.5 and on a Linux Mint 14 Virtualbox VM, both via luarocks. I'm running the example Lua script.

On OS X, ao.openLive() causes a segmentation fault. On Mint, at least it just errs: Lua prints the default error "something went wrong", returned from l_open_live.

Not sure if this is the cause, but when trying to compile I get complaints that the ao_option *opt inside table2option can return uninitialized. As noted here, that means it points to jibberish:
http://stackoverflow.com/a/7150353

Either way, passing an option table to ao.openLive() doesn't help -- segfault persists.

not play sounds

i'm using the example ao_live.lua but show this error, my operating system is GNU/Linux:

$ luajit ao_live.lua

=================================================
=> type:	live
=> priority:	50
=> options:
	 - server
	 - sink
	 - dev
	 - id
	 - verbose
	 - quiet
	 - matrix
	 - debug
	 - client_namebuffer_time
=> shortName:	pulse
=> preferredByteFormat:	native
=> comment:	Outputs to the PulseAudio Sound Server
=> name:	PulseAudio Output
=================================================
=> type:	live
=> priority:	20
=> options:
	 - dsp
	 - dev
	 - id
	 - buffer_time
	 - verbose
	 - quiet
	 - matrix
	 - debug
=> shortName:	oss
=> preferredByteFormat:	native
=> comment:	Outputs audio to the Open Sound System driver.
=> name:	OSS audio driver output 
=================================================
=> type:	live
=> priority:	0
=> options:
	 - debug
	 - verbose
	 - matrix
	 - quiet
=> shortName:	null
=> preferredByteFormat:	native
=> comment:	This driver does nothing.
=> name:	Null output
=================================================
=> type:	file
=> priority:	0
=> options:
	 - matrix
	 - verbose
	 - quiet
	 - debug
=> shortName:	wav
=> preferredByteFormat:	little
=> comment:	Sends output to a .wav file
=> name:	WAV file output
=================================================
=> type:	file
=> priority:	0
=> options:
	 - byteorder
	 - matrix
	 - verbose
	 - quiet
	 - debug
=> shortName:	raw
=> preferredByteFormat:	native
=> comment:	Writes raw audio samples to a file
=> name:	RAW sample output
=================================================
=> type:	file
=> priority:	0
=> options:
	 - matrix
	 - verbose
	 - quiet
	 - debug
=> shortName:	au
=> preferredByteFormat:	big
=> comment:	Sends output to a .au file
=> name:	AU file output
=================================================
=> Device ID: 0
=================================================
luajit: ao_live.lua:32: cannot open the device
stack traceback:
	[C]: in function 'openLive'
	ao_live.lua:32: in main chunk
	[C]: at 0x5564d7c0cf40

Is file_extension necessary ?

I've just installed a new debian, and I'm getting that
  lua: error loading module 'ao' from file '/usr/local/lib/lua/5.3/ao.so':
    /usr/local/lib/lua/5.3/ao.so: undefined symbol: ao_file_extension
error. This means that lots of people probably get it. Seeing that ao_file_extension only occurs in the l_file_extension routine, which is undocumented in lao and always has been, I'd like to suggest that we comment out that routine . . .

Symbol ao_file_extension not found

I'm trying to run examples/ao_live.lua which crashes with the message

lua: error loading module 'ao' from file '/usr/local/lib/lua/5.1/ao.so':
  Error relocating /usr/local/lib/lua/5.1/ao.so: ao_file_extension: symbol not found
stack traceback:
  [C]: ?
  [C]: in function 'require'
  examples/ao_live.lua:1: in main chunk
  [C]: ?

I'm using Alpine Linux with libao-1.2.0-r1. Any idea what could be wrong since the version is the most recent one (1.2)?

strndup in l_play() ?

Greetings again; in lao.c, l_play(lua_State *L) tries to duplicate the samples::
char *buffer = strndup(samples, num_bytes);
but http://linux.die.net/man/3/strndup says:
The strndup() function is similar, but ONLY COPIES AT MOST n bytes.
If s is longer than n, only n bytes are copied, and a terminating null byte ('\0') is added.
and I found ao_example.lua just played random noise and garbage :-(

But if I play the samples directly:
int result = ao_play(dev, samples, num_bytes);
then gcc warns me that I'm discarding a const qualifier, but ao_example.lua plays me a nice sine wave :-)

It's hard to believe that this has ever worked; so if the user base is small, it might be OK to change the API from require("ao") to local ao = require("ao"), see previous issue...

Regards, Peter

No luaL_register in 5.2

Hi. I get:
/usr/local/lib/lua/5.2/ao.so: undefined symbol: luaL_register
which reminds me of a change I had to make in my midialsa.lua

if LUA_VERSION_NUM >= 502

luaL_setfuncs(L, prv, 0);    /* 5.2 */
return 0;

else

luaL_register(L, NULL, prv); /* 5.1 */
return 0;

endif

YMMV ...
Regards, Peter

add append_global_option(k,v) and postpone ao_initialize()

To allow setting quiet=yes in time to stop the debug messages emitted by ao_initialize(),
I suggest we add a append_global_option(k,v) function, and delay calling ao_initialize() until the next function is called.

If that function is append_global_option then we call that first and ao_initialize second (assuming it works that way round), whereas if it's some other function like open() then we call ao_initialize first and the function second.

shutdown ao on library removal

There was previously ineffective code (removed in a5a9b7b) trying to automatically call ao_shutdown if lao was unloaded.

This could be done by e.g. making this userdata an upvalue for all functions

	/* Create object with __gc metamethod so that ao gets shut down on exit */
	lua_newuserdata(L, 0);
	lua_createtable(L, 0, 1);
	lua_pushcfunction(L, l_shutdown);
	lua_setfield(L, -2, "__gc");
	lua_setmetatable(L, -2);

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.