hi,
i'm experiencing some strange behavior with pix_share_write/read sometimes i get this error when setting pix_share_write : couldn't get shm_id: error 0 but i couldn't reproduce this, it seems it happens when a patch with pix_share_write crashes (due to errors in a V4L2 device) after reloading the patch, pix_share_write can't initialize correctly it happens not so often, but when it does i can't understand why and I have to change the ID in the [set( message to find a working one
I made few changes in the code of pix_share_* to forward the error though an outlet so I can automatically try another ID
this is in my github repos in the branch pix_share_write : https://github.com/avilleret/Gem/tree/pix_share_write
I don't know if it's a good idea but it seems to work for me
I'm wondering if it could be good to have a dictionary instead of a hash table : when we use [set id sizex sizey pixel_format( message, pix_share* could try to find the id in the dictionary if there is no entry with that id, it generates a random shmem id, verify that nobody else is using it and tries to allocated data if it fails it could generates another id until it succeed and store the id in the dictionary
pix_share_read will know the dictionary and can find the right shmem id
what do you think about that ?
kind regards
antoine
-- do it yourself http://antoine.villeret.free.fr
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 2013-03-19 16:06, Antoine Villeret wrote:
this is in my github repos in the branch pix_share_write : https://github.com/avilleret/Gem/tree/pix_share_write
hehe, i have incorporated your changes about 7 hours ago :-)
I don't know if it's a good idea but it seems to work for me
generally, i find it always pleasing, if an error is not (only) printed to the pd-console but you get some message back into the patch, so you can react on the error programmatically.
I'm wondering if it could be good to have a dictionary instead of a hash table : when we use [set id sizex sizey pixel_format( message, pix_share* could try to find the id in the dictionary if there is no entry with that id, it generates a random shmem id, verify that nobody else is using it and tries to allocated data if it fails it could generates another id until it succeed and store the id in the dictionary
pix_share_read will know the dictionary and can find the right shmem id
how is that supposed to work in two separate instances of Pd?
fgamsdr IOhannes
2013/3/19 IOhannes m zmoelnig zmoelnig@iem.at
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 2013-03-19 16:06, Antoine Villeret wrote:
this is in my github repos in the branch pix_share_write : https://github.com/avilleret/Gem/tree/pix_share_write
hehe, i have incorporated your changes about 7 hours ago :-)
thanks for that
I don't know if it's a good idea but it seems to work for me
generally, i find it always pleasing, if an error is not (only) printed to the pd-console but you get some message back into the patch, so you can react on the error programmatically.
I'm wondering if it could be good to have a dictionary instead of a hash table : when we use [set id sizex sizey pixel_format( message, pix_share* could try to find the id in the dictionary if there is no entry with that id, it generates a random shmem id, verify that nobody else is using it and tries to allocated data if it fails it could generates another id until it succeed and store the id in the dictionary
pix_share_read will know the dictionary and can find the right shmem id
how is that supposed to work in two separate instances of Pd?
obviously, i forgot that whereas I'm sending id though OSC to other instance... and I see no other ways than sending the id on localhost...
sorry for this stupid mistake
cheers
a
fgamsdr IOhannes -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAlFIiw8ACgkQkX2Xpv6ydvQxGgCePjlJJTseMuPVMhuYQGWkavgv u10AoMhpJaE6OsdPQk7HbhmMM0W75aTo =5+nU -----END PGP SIGNATURE-----
GEM-dev mailing list GEM-dev@iem.at http://lists.puredata.info/listinfo/gem-dev