[SLUG] LD_PRELOAD
I can't find any info on this, so it's prodly so obvious that only dumbkorfs ask :-) I have a program using a web cam. All is perfect except that I need to export LD_PRELOAD=/usr/lib/libv4l/v4l1compat.so before running it. How can I compile the links into the code, rather than a PRELOAD env setting? skype did just that with their 2.1 beta. ie 2.0 needs the PRELOAD and 2.1 does not to use video. Thanks James -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
[SLUG] keyboard entry sssllloooww
Any clues? suddenly i have to hold keys down for at least a second before they enter. Password on booting normal cannot use ctrl-alt for console Ubuntu 10.04-- working perfectly until this extensive command line--simple bash scripts mouse unaffected u won't believe how long this took Geoffrey -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
[SLUG] slow keys
sorry sorry sorry forgedaboudid--(am in Philadelphia presently) slow keys activated (how I know not!) Geoffrey -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
Re: [SLUG] LD_PRELOAD
On 13 June 2010 00:27, james wrote: > > I can't find any info on this, so it's prodly so obvious that only dumbkorfs > ask :-) > > I have a program using a web cam. All is perfect except that I need to > > export LD_PRELOAD=/usr/lib/libv4l/v4l1compat.so > > before running it. > > How can I compile the links into the code, rather than a PRELOAD env setting? What does "ldd your-executable" show? What do you pass to the linker to make it know about v4l1compat.so when you link the program? You can add /usr/lib/libv4l to the run time library search path by passing -rpath to ld. > > skype did just that with their 2.1 beta. > ie 2.0 needs the PRELOAD and 2.1 does not to use video. > > Thanks > James > -- > SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ > Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
Re: [SLUG] LD_PRELOAD
james wrote: > I can't find any info on this, so it's prodly so obvious that only dumbkorfs > ask :-) > > I have a program using a web cam. All is perfect except that I need to > > export LD_PRELOAD=/usr/lib/libv4l/v4l1compat.so > > before running it. > > How can I compile the links into the code, rather than a PRELOAD env setting? You can't. Instead, create a wrapper script containing: #!/bin/bash export LD_PRELOAD=/usr/lib/libv4l/v4l1compat.so exec your-webcam-program Erik -- -- Erik de Castro Lopo http://www.mega-nerd.com/ -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
[SLUG] Re: LD_PRELOAD
On Sunday 13 June 2010 10:00:04 slug-requ...@slug.org.au wrote: > > I can't find any info on this, so it's prodly so obvious that only > > dumbkorfs ask :-) > > > > I have a program using a web cam. All is perfect except that I need to > > > > export LD_PRELOAD=/usr/lib/libv4l/v4l1compat.so > > > > before running it. > > > > How can I compile the links into the code, rather than a PRELOAD env > > setting? > > You can't. > > Instead, create a wrapper script containing: > > #!/bin/bash > export LD_PRELOAD=/usr/lib/libv4l/v4l1compat.so > exec your-webcam-program I do have a wrapper, that does work, so thanks What I was trying to learn is how skype did do exactly that. 2.0 had to be wrapped, but 2.1 (beta) uses the cam without preload. I accept 'You can't' I certainly cant despite trying lots :-) James -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
Re: [SLUG] Re: LD_PRELOAD
It can be done in code. You can use dlopen() / dlsym() to load in shared objects and their symbols at runtime. Adrian On Sun, Jun 13, 2010, james wrote: > On Sunday 13 June 2010 10:00:04 slug-requ...@slug.org.au wrote: > > > I can't find any info on this, so it's prodly so obvious that only > > > dumbkorfs ask :-) > > > > > > I have a program using a web cam. All is perfect except that I need to > > > > > > export LD_PRELOAD=/usr/lib/libv4l/v4l1compat.so > > > > > > before running it. > > > > > > How can I compile the links into the code, rather than a PRELOAD env > > > setting? > > > > You can't. > > > > Instead, create a wrapper script containing: > > > > #!/bin/bash > > export LD_PRELOAD=/usr/lib/libv4l/v4l1compat.so > > exec your-webcam-program > > I do have a wrapper, that does work, so thanks > What I was trying to learn is how skype did do exactly that. > 2.0 had to be wrapped, but 2.1 (beta) uses the cam without preload. > > I accept 'You can't' I certainly cant despite trying lots :-) > > James > -- > SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ > Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html -- - Xenion - http://www.xenion.com.au/ - VPS Hosting - Commercial Squid Support - - $24/pm+GST entry-level VPSes w/ capped bandwidth charges available in WA - -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
Re: [SLUG] Re: LD_PRELOAD
james writes: > On Sunday 13 June 2010 10:00:04 slug-requ...@slug.org.au wrote: > >> > I can't find any info on this, so it's prodly so obvious that only >> > dumbkorfs ask :-) >> > >> > I have a program using a web cam. All is perfect except that I need to >> > export LD_PRELOAD=/usr/lib/libv4l/v4l1compat.so >> > before running it. >> > >> > How can I compile the links into the code, rather than a PRELOAD env >> > setting? [...] > I do have a wrapper, that does work, so thanks > What I was trying to learn is how skype did do exactly that. > 2.0 had to be wrapped, but 2.1 (beta) uses the cam without preload. Oh. The answer is probably pretty simple: I bet that Skype built their new version with support for the V4L 2 API rather than the long-deprecated version one API. Alternately, they could have implemented the same work-around internally, or even linked in the compatibility code[1], or written dynamic detection for the two API versions, or So, lots of ways. This being a closed application you can't really know. Regards, Daniel Footnotes: [1] ...because that is, y'know, open source. Except they can't actually link that without breaking the license, so the situation is less clear. -- ✣ Daniel Pittman✉ dan...@rimspace.net☎ +61 401 155 707 ♽ made with 100 percent post-consumer electrons -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html