Hello everyone. Thanks for attending. My name is George. I'm a Principal Software Engineer at Colabora. I've been working on multimedia things for the past decade. I've been working on Gistrumer and the last four or five years I've been working on pipe wire and specifically I've implemented... I've architected and implemented the wire plumber session manager which works together with pipe wire. I'll tell you about that a bit later. So let's talk about cameras, shall we? Cameras are really fascinating devices. They have some mechanism, capture light and takes that into a sensor and transforms it into a digital picture. Amazing. How does that work actually? So on the hardware level there's a bunch of stuff. There's a lens that takes light in. It directs it into a sensor behind the scenes and then this sensor generates electrical signals. They go to a digital converter, they get converted, they pass through some processing to reconstruct the picture. The picture is then compressed and finally it gets to the CPU to the host system where we as software developers working on that part of the stack, we get a picture to work with it. Now I know this is all very simplistic description. I'm not a camera architect. I'm working on the software stack, on the CPU side, so on the cream box over there. Now this is a traditional form of a camera. However in the recent years we've started doing cameras which look more like this. So there's no longer just one sensor. We have three, four, five, six different sensors over there, different lenses, different sensor properties and what happens is all these have their own pipeline, processing pipeline and somewhere down the road these images need to be combined. We need to reconstruct the final view of the real world which is being measured by different sensors and different lenses. Then we want to provide something to the user space which can be different depending on the use case. So really do you want to capture a photograph or do you want to capture a video or do you want to capture just a preview for the screen? These are very different use cases and every time you ask for one of those the camera actually needs to be configured differently. Now as I said all these sensors capture different things and to combine them there are some high computational requirements. We need to run some algorithms. These algorithms may be running on a dedicated processor or on the host CPU to save some cost maybe. There's a blurry boundary between those. Depending on the camera, on the vendor people do different things. Nowadays we also started seeing also AI processing which I suspect it's combined somewhere in there. I haven't really looked it up yet. It's new development. So basically all these images from all these different sensors they go back and forth in a processing pipeline. There are different blocks that process that two different things. So they come from the sensor they go to the integrated signal processor. They go to the CPU. They get combined. They go back to a signal processor back and forth all the time. And to orchestrate that we basically need some kind of software that manages all of that. And that software on Linux is Lip Camera. So that Lip Camera provides all of that. It manages all the devices that are available on the system. All the sensors of every device. It builds all these processing pipelines. It has the ability to run algorithms and also proprietary algorithms in a sandbox environment. It has all the device agnostic device specific components which may be provided by a vendor as well. And it provides an abstract API to the user space. So the user space can then go and ask Lip Camera please give me a video stream or a stream to take a photograph or something like that. All of that's very nice. I am not an expert on Lip Camera myself. If you want if you have questions about that or if you want to learn more about the camera there's a talk tomorrow by Kiran who is one of the authors and you can watch that and ask him questions. Now the point I'm trying to make while telling you all of that is okay we have cameras with multiple sensors that we somehow manage a pipeline that transforms all these images that are captured into a final stream. But what if we have multiple devices which are totally separate devices in separate places of the system. Think of a car for example which might have cameras in various places all over around. And also another thing is can we while we combine things from different devices can we separate the processing into smaller blocks because as you accumulate things in one big block you could write an application that you know opens all devices captures data and then does some processing. But as this complexity accumulates in one place it gets really hard to maintain gets really hard to develop and so an idea is to split all these things into separate blocks and make them separate processes and even better separate them in different containers so that you have also secured blocks that do a small part of the processing. And I think we really need that as complexity increases we need to have this kind of division of work and also the versatility the ability to change these components while keeping the rest intact. I think it's more much more maintainable in the long run. And on that topic comes pipe wire. So pipe wire is basically a multimedia bus you can think of it as a multimedia bus. It allows any form of media being video, be it audio to be transported from one place in your system to another. It can come from a device and it can go to process A and go to process B and go to another device back and forth around the system. And so by providing this feature it allows you basically to build a processing graph which is split across processes in your system. While at the same time this process gets to share the resources so the all the memory that is being used for transporting the buffers is shared, is reused. There is support also for DMA buff for hardware buffers. All this is done with very low latency. There is no there is no big overhead for transporting this around the system. And also pipe wire itself has very low resource consumption. It doesn't take much memory or CPU to do that.  It will put all the blocks in their place and connect them together and allow media to flow from one place to the other. And that is what wireplumber does, the project that I'm working on. It's a scriptable component that allows you to discover all the nodes that are existing in the system, all the devices, all the applications that have opened and as soon as it discovers them it connects them together based on some logic that you can define in the configuration. In a picture it looks like this let's say. So you can see how, for example, media can be coming from the hardware. I have two hardware cameras over there in this picture. They go through lip camera. Now lip camera has its own internal pipeline handler, processing algorithms, device agnostic code and all of that is contained in the library. And then there is pipe wire, which is a demon. It uses lip camera to open these devices so it provides processing nodes that represent these devices. And it allows you to link them to any other node. So you see that on top we have some applications, some processes, which for the sake of demonstration here I have also put them to be in separate containers. They can be, they don't have to be. It's your call in your application design. Some examples I have put there is a network camera receiver, so something that receives an RTP stream from somewhere else and provides it as a local device. It appears as if it was a local device. It's just another node just like the other ones. You could have some processing software that has input and output and connects to a device, takes some input, makes some processing and then sends it to another node. So then you can have it. A great viewer, for example, that takes these images, combines them somehow and gives you a preview on the screen or maybe a recorder application, which its entire task is just to encode and store to the file system. And talking about encoding, one more thing that is not really there yet. It's not into pipe wire, but it's something that I've been thinking about and it maybe is a good idea to start looking into it in the future is to allow hardware, other hardware resources like hardware encoders and hardware decoders to be also represented as nodes into pipe wire. So then you could have a processing block that looks like this where you have input coming from a camera. The buffers are transported through pipe wire to a hardware encoder that will encode and give you the encoded stream so that the camera recorder application really doesn't have to access the hardware encoder directly. It will just receive a stream with encoded data. Now, again, this is not something that exists, but I want to look into that. It's something interesting. And the same thing would work for the decoder. So think about, for example, I know Android uses a similar architecture where if you want to play something, it goes into a basically a different process where it gets decoded and displayed. And this is something that pipe wire could also do and enable for mobile devices and other kinds of devices. So this can have many applications. Think of automotive where you have a lot of cameras around the car sensors, possibly doing some processing. Also think about cloud processing applications. There are streams coming in from user devices that are gathered in a data center where you have lots and lots and lots of docker containers. And you need to get all this data through a pipeline of containerized applications until they reach their final destination. Mobile devices like phones, tablets, tv sets, cameras, whatever. You name it. Many, many more applications. I think there is a lot of potential for applications to use this kind of architecture to be able to, as I said before, to separate the work inside the system and make components which are more flexible, more versatile. Of course, let's not forget audio. I've been talking about video based on camera input, but pipe wire is also used for audio. It can transport audio. It's now the default audio daemon on the Linux desktop, replacing the previous daemons that were there, also audio and jack. And it has also been deployed on some devices like the Steam Deck, for example. It has a very nice Bluetooth audio infrastructure, so much better than what was there in Pulse Audio. Works really well. And all these complex audio graphs are actually made possible through pipe wire in the desktop right now. And we are seeing more and more people interested to apply this to their products, their devices. So yeah. Now, all of that is best described with a demo. So I'll attempt to show you something. So in order to demonstrate, what I want to demonstrate here is capturing something from, don't look at the script yet, capturing something from a camera and then taking it through a filter and then taking it to an application which does the rendering, being three separate processes. Now, every process that I'm going to launch is going to be a GSTimmer pipeline. So I'm using GSTimmer and GSTlaunch as a tool to help me build the individual applications. Obviously, I should mention that pipe wire is not meant to be a replacement for GSTimmer. GSTimmer is still a great tool to build applications, to build these small blocks. So here I have a script which runs GSTlaunch and basically receives input from pipe wire. It has launched the pipe wire source element. It takes it through some processing. The main processing element here is the face detect. So it's going to detect my face when it appears in the camera. And then it goes out again back to pipe wire through pipe wire sync. And then I have another script which is going to just receive a stream from pipe wire and render it to a window. So let's launch that. Let's see. So that's the face detection application. It doesn't have any graphical output. Obviously, it's just taking pictures from pipe wire and puts them back into pipe wire. And that's the output window. So that's the script that receives something from pipe wire and renders it. It's not very nice. Why? I don't know. Obviously, nothing is perfect. I think it's a bit confused because this is an XV image sync, an X window. It's a bit confused with the projector or something like that. So how do we know what is going on? There is this tool which was showing up before on my screen, which can show you the graph right now, what's going on in pipe wire. So I have my built-in front camera, which is a node that uses lib camera to open my camera right now. I have also the plugin that uses video for Linux here. So it's also available, but I'm not using it. I'm using the lib camera one. It goes into face detect and then goes out and goes to the output window. That's one part. Now, we're talking about cameras and camera input, but it doesn't necessarily have to be a camera, right? We could also do playback. So here I have another process which basically plays a file and it just, instead of rendering it to the screen, it renders it to pipe wire. So there's a node being created and that gives me the video stream as it is being played out. And then I have another script which is very, very similar to the previous one. It's just something that plays, something that displays the output. So video source playing and video output. It's going to show up. Yeah, this is the movie. Let me mute it. So again, I have separation. I have the rendering, the decoding process which plays back and the process that renders it are different things. Obviously, the interesting thing that I can do here is I can launch multiple renders that show the same thing. So if I have this like up here, let me resize it. Go to another 10 mile window. I can just launch the same script and it plays the same output synchronized since it's being streamed by the other process. Right. So what do we have here? We have, obviously there is some audio being played in the background and we have this process which is the video decoder and player and two consumers which render it. And in a similar fashion, we can like combine these things. So I can launch face detect and the video source and then combine them. Let's see how that looks. Yeah, video source then face detect. So I could like combine them. Now there is the third process there which does this compositing. So it displays a window and runs the compositor element which renders this picture in picture. Obviously, I can start more of these and they will render the same thing and the pipeline now looks like this. That's a bit more complicated like I have. Where is the other one here? Let the audio be down. So yeah, front camera going to face detect. Then it goes to the two renderers, the picture in picture inputs from the two separate processes. And the other one, the GST launch here is the video player. And again, the two renderers background inputs for the two different windows that I have. And obviously, I can split this more because now I have two processes, two windows here, like that one and that one, which basically both compose the images into the window. I could also run a separate compositor like the composites and then it provides an output to pipe wire so that these two windows would just render without compositing. So let's see how that would look like. I could run this composite SH. Yeah, so that's another background application now that takes inputs from this and it has an output, not connected yet. And then I can run this composite output, which renders the result. And now I can go ahead and launch more of these. So there's another window. And now these two windows are not doing the compositing themselves. It's being done by a single process here. So there is a shared workload. It's composited once and then rendered twice. And what about CPU? Let's see. That won't be good. So it doesn't look good for GSTrimmer. GSTrimmer is really, really, really taking a lot of CPU here doing all this decoding. And also the, I think the one with the highest CPU is the compositor, which does the picture in picture thing, since it does it all on CPU. And the video is huge. It's full HD. But how about pipe wire? So how about pipe wire? Pipe wire is using 0.08% of my CPU. So it's literally nothing for what it's doing. And only 50 megabytes of RAM. That's nothing for what it's doing. And wire plumber, again, wire plumber is idle. It connects the graph when the process appears, but then it's idle. It doesn't do anything else. So yeah, that's it. Let me stop all of these. Come on. I can start it from here. So next steps. I think that's your call mainly. On my side and my team's side and on pipe wire upstream in general, what we do is we develop these mechanisms, these tools for them to be there, for them to be available so that you can build great applications on top of them. I am not developing an application, so I'm developing the session manager and the consumer beats around it and all of that stuff, bug fixing pipe wire and so on. But there are great applications that could be built on top of this architecture. And it really provides, I think it makes some things really simple to solve some complex problems. They become really simple when you have the ability to transport media from one process to the other and share devices, access devices from multiple processes and so on. So yeah, that's it. Thank you very much for attending. And I'm open to questions. Yes. Right. So the question is, what can pipe wire do basically to provide synchronization between audio and video that's being captured? So pipe wire doesn't do much for synchronization itself.  But everything that goes through pipe wire is basically being transported as a live stream. So if you're capturing something from a camera, it's being transported live. There is a bit of a latency always when you process something, but the good thing with pipe wire is that this latency is fixed. So you know beforehand how much time a frame takes to go from point A to point B. So eventually what you can do to synchronize is in your application eventually gather all these frames and knowing the latency that pipeline has apply the necessary clock synchronization to synchronize those. Obviously you can get timestamps from the source. So timestamps can be transported. They can be applied and transported to the application. But other than that, yeah, pipe wire doesn't really synchronize things. It doesn't have it has a clock, but it's not for synchronizing audio and video or two videos together. It's the clock is mainly to give the pace at which frames go from one point to another point. Knowing the frame rate, it will just, you know, go every once in a while and move one more frame from the source to the consumer. Other question? Yes? Right. So the question is, are buffers provided by pipe wire itself? Or is it something that the producer and consumer need to allocate and negotiate and so on? The answer is, yes, they are provided by pipe wire. So as soon as you start a stream pipe wire allocates a set of buffers for your stream, it is a fixed amount of buffers. It doesn't change so that the latency is also fixed. And you can obviously influence that from the application if you want different set of buffers, different latency, or if you want to do to do DMA buff sharing, for example, you can also request that or you can provide, you could get buffers which don't really have a buffer, but then you could attach the file descriptor on them since they are DMA buff based. But it's always a set of fixed amount of buffers, which are always shared between the between two nodes, which are linked together. Okay, I have three hands. Yeah, please go ahead. Right. So the question is, while pipe wire basically does zero copy, transferring buffer from one node to another, how does that work when you have multiple consumers where both need to get access to the same buffer eventually? The answer is they get the same buffer. They get access to the same piece of memory in a read-only fashion because if they want to process it, then they have to copy it somewhere else. But since they, when they are receiving something, they are receiving it for reading, right? So they can then copy it somewhere else if they need to. The question is, if one consumer stalls, do the others have to wait? Is it no? The answer is no. They don't have to wait. There is no, I mean, the locking mechanism is implemented in the DEMON in the server. The server, the DEMON, I'm talking to the DEMON as a server, the DEMON basically assigns these buffers to this process and gives them a time slot, which is called the quantum. So they have this much time to actually get the data. If they don't get it, it's their fault. They get, they don't get access to the buffer anymore. The buffer is returned back to the pool and yeah, charges life. So you need to tune these things. It's not, it can go wrong. If you try to have very low latency and give very small amount of time to process, it can go wrong. You can have bad results. It needs to be tuned if you have this kind of things. Yes, next question. Yeah, so the question is, how does format negotiation work? Because my script cheated a little bit and had the caps hardcoded. And the answer is, yeah, I'm not sure yet. It's something that is actively developed. I mean, there is some basic format negotiation. There are some, some of the scripts that I showed did not have caps hardcoded. So basically, they get the caps of the producer, whatever this is. But the camera currently is being started with its best possible resolution and frame rate. We cannot request something else from pipe wire. So that mechanism is not there yet. We are, we are thinking about it how exactly it's going to be. So yeah. And the hardcoded caps that I had were basically for ensuring that this process connects to the camera and not to, let's say, an audio source because there was no nothing else that would ensure that. And because pipe wire source and pipe wire sink into streamer, they can do both audio and video. There was, yes. Yeah. So the question is, how do we, how can we manage more complex pipelines? How do we program things to be linked together? And the answer is that you can do that through wire plumber and it's a scriptable configuration, which I did not show here. What I did was that I, in every pipe wire source that I launched, I was passing a property called node.target, which specifies the target node that I want to link to. And this property acts as a hint to wire plumber. So then wire plumber takes that and says, okay, do I have a node with this name? And it looks up the graph and if it finds a node with that name, then it makes a link. But it's a hint. It doesn't have to be that way. Wire plumber can act differently if necessary. And there are scripts that can do this kind of linking source scripts. They are written in Lua and currently they are pretty complex, but it's there. There is a bunch of logic here written in Lua that can do all this routing. It can discover nodes that can take their properties and see if they can be linked or not. I'm out of time. So thank you very much for attending. And if there is anything else, you can catch me later and talk to me. Thank you.


Proverbs chapter 2. Let's begin reading together here in Proverbs chapter 2 at verse 1. We'll read to verse 6. We'll get into our study. Proverbs chapter 2 verses 1 through 6 but we'll be looking at the second chapter of Proverbs today as we as we continue a brand new study here in the book of Proverbs. My son, if you receive my words and treasure my commands within you so that you incline your ear to wisdom and apply your heart to understanding.  If you seek her as silver, search for her as for hidden treasures, then you will understand the fear of the Lord and find the knowledge of God. For the Lord gives wisdom from his mouth comes knowledge and understanding. So let's begin by noticing how he begins chapter 2. My son, he says, if you receive my words. So right from the beginning, the beginning, let me just share a couple of thoughts. One thought is that God has instructed fathers. God has instructed fathers to lead as well as to teach the family. That's part of the structure of the family. It reveals the biblical pattern for authority. I was a student at Cal Poly Pomona. I've mentioned that I've gone to various colleges in Holland. Cal Poly Pomona was one of the colleges I spent a couple of years in. I had different majors when I went to college, but it's giving you just a little background to give you some insight into the point I'm about to make. One of the majors I had was history. Another major I had was Bible. One of the other majors I had was what do you call it? Behavioral science. That's what they call it. The reason I hesitate on that is because our professor said you may be a behavioral science major, but there's no such thing as behavioral science. That's because behavior, you can't make a real science out of it because science requires repeatable experimentation, et cetera, the same results, and people can change. But that was one of my majors, behavioral science. In behavioral science, I had a particular professor who had us writing papers pertaining to a variety of subjects as it related to the family. He had us write a paper, and I wrote a paper on the role of the father in the home. Now, this was back in 1976. I went to the library, which is a large library there at Cal Poly. Of course, by now it's much larger. I think they had six books then, that long ago. They were handwritten scrolls, actually. I went to search for any material that they had on the role of a man in the home. You have to understand, and many of you know, even in my teasing way, that the library is immense. Any college is going to have multiple thousands of volumes. Every college that has a library will have thousands of volumes. We're not talking about 50, 100, 200. We're talking about several thousand row upon row upon row upon row and floor upon floor of books. That's what you get in university. So I go and I'm looking for any book that they might have. I'm going through the various sources that you can discover, whether or not they have this particular subject in book form. And I was looking for a book that had been written that related to the role of a man in the home. And do you know out of all of the books they had on that subject, there was only one that was written by a man. Women had written, and there weren't that many volumes, by the way. As a matter of fact, there were just a few books that were written at that time on the role of a man in the home. And in the handful of books that I found in the Cal Poly Pomona University Library, there was only one book that was written by a man, which I found ironic then as I find it now, that we have our ladies telling us men how we're supposed to be. Well, that's normal though, isn't it? But anyway, one book written by one man and it wasn't even that good. So I wrote my paper and what I did is I wrote on the role of a man from a biblical perspective and turned it in. And I still remember the comment that my professor made when he said, I have never read anything like this before. He wasn't a Christian. And in it, I simply outlined back in 1976 what the Bible has taught me over the years and what I've taught this church, that God has placed the man in a position of authority, that we men have been given by God the responsibility to exercise authority in the home, that when our children see the man in his relationship with his wife, they get an idea of what it means for a unit to work together with a system that actually provides security, instruction, and a variety of other things.  They begin to understand a variety of things that pertain to the things that make for life. And this man had never heard that. And I got an A in the paper too. Isn't that great? I might as well boast on that. But he said, but he wrote, I still remember in that red pen, I have never read anything like this before. But that's what the Bible teaches. So I wanted to point that out how this begins in chapter two. My son, my son, if you receive my words. So God has instructed fathers to lead and to teach the family. It's part of the structure. It's one of the biblical patterns of authority. Paul exercised that when he would write, he wrote as a father, 1 Thessalonians chapter two, verse 11. The apostle Paul himself said it like this. He said, as you know, how we exhorted and comforted and charged every one of you as a father does his own children. So he's alluding to the reality of the fact that fathers exhort, charge. We do these things because we've been placed in a position of teaching authority in the home. And so Solomon is acting that out in verse one of chapter two. And that's why he's saying, my son, if you receive my words. So as a father, he's giving an invitation, an invitation to receive wisdom. The desire that we find here with Solomon for his son, as well as for us, is for wisdom to be our greatest pursuit. Obviously, there will always be various pursuits we can engage in. We can pursue fame and we can pursue money. We can pursue relationships. There's so many things that we can get in life. But the important thing that Solomon wants to stress, make wisdom your chief pursuit. Proverbs four, seven. Again, wisdom is the principal thing. Therefore, get wisdom. And in all you're getting, get understanding. So his greatest desire is for us to live life skillfully. As I mentioned to you, wisdom speaks of living life skillfully. And his greatest desire is for us to do so. But in order to live skillfully, we need wisdom. And the wisdom that he desires for us to have comes through our relationship with God and his word. We need to remember that not all wisdom is from the Lord. Some wisdom is what we call natural wisdom. A kind of wisdom that actually springs up from an unregenerate heart. Like Jeremiah 422, how the prophet said, my people are foolish. They have not known me.  They are wise to do evil. But to do good, they have no knowledge. There is a wisdom of this age, a wisdom of the world. It's a natural kind of wisdom that springs up from carnality from an unregenerate heart. And yeah, you can have an earthly, worldly wisdom. There's another kind of wisdom that is spiritual, but it's referred to in Scripture as demonic. In James 3, 14 through 16, if you have bitter envy and self-seeking in your hearts, do not boast and lie against the truth. This wisdom does not descend from above, but is earthly, sensual, demonic for where envy and self-seeking exist, confusion and every evil thing are there. So you have a natural carnal wisdom. You have a demonic wisdom. But what Solomon is encouraging us to pursue is wisdom that comes from God, wisdom that is from above. And so as we look at these few verses and begin our study, notice how Solomon begins to exhort us. Again, I'll begin with a question. How do we gain wisdom that comes from God? We have an opportunity to see that as we begin chapter 2. Notice how he writes. Verse 1, Solomon, he says, my son, if you receive my words, treasure my commands within you. He begins to share with us how we can become wise. If you take notes, how do you become wise? First, be teachable. Be teachable. He says, if you receive, the word received means to choose or to accept. To gain wisdom, your heart needs to be open to receive the seed of the word. In order to be open to receive, there needs to be humility, a purity of spirit, a hunger for God. It begins there. It begins with a desire to receive from the Lord. And in order to have from the Lord wisdom given to you, there needs to be the humility that accompanies that. Wisdom is found in God's Word and it begins to take root and develop a fruit, if you will, when you receive it and when you obey it. So if we're going to become wise, it begins with the willingness to learn the ways of wisdom. And that primarily comes from knowing and applying God's Word. Again, it's not enough for me to know. God intends me to know and to do. And the way that I demonstrate that I actually know something is when I do it. And that's why Jesus would say, if you know these things, blessed are you if you do them. The wise man, Jesus said in Matthew 7, is the one who doesn't build his house on the sand that ships, but on the sure foundation of obedience to the Word of God. So in the Jewish way of thinking, knowledge and wisdom did not come simply by the accumulation of information. It comes by receiving that information and applying it. And so that's why Solomon would say, if you receive my words. You see, knowing his Word and applying his Word comes because we have a heart for his Word. Proverbs 18, 15 says, the heart of the prudent acquires knowledge. The ear of the wise seeks knowledge. Jeremiah 15, 16, your words were found and I ate them. Your word was to me the joy and rejoicing of my heart. For I am called by your name, O Lord, God of hosts. Psalm 19, verse 7, the law of the Lord is perfect, converting the soul. The testimony of the Lord is sure, making wise the simple. So one, do you want to become wise? Receive, he says. My son, receive my words. It begins by receiving his words. Secondly, and treasure my commands within you. Treasure my command. The word treasure means to be hidden or stored up. The word treasure speaks of hiding something. It speaks of placing something in security, a secure place to hide it from discovery. So he says, treasure my words. Secondly, so if you're going to gain wisdom, you treasure his word. Treasure would carry the connotation of valuing it. So you value God's word. God's word is to be stored in our hearts, carried about with us and ready to be called upon in time of need. And that's the truth. You'll be, you'll discover this. If you haven't already, you will. And you'll discover it as a pattern over the rest of your life when you start putting it into practice. You get into the word. You meditate on the word. You seek the Lord. And you say, God, use me today. You'll be at work or maybe you'll be in car driving somewhere with some people and something's going to be said. And it's going to trigger you. And it's going to remind you of what you read earlier. And you're going to find a way to share it.  That has happened so often with me. I'll be reading something, studying something, meditating on something, and then somebody will say something in conversation that triggers that.  I was just reading this today. And you get a chance to share. When I was in the army, I was memorizing scripture. I was part of a group called the navigators. Part of what the navigators wanted to do is to have us memorize scripture. And so I was learning to memorize at that time. And one of my friends, Rich, was my roommate, if you will. And I would speak to him and he would say something. And I had just memorized the scripture. So I'd say, Rich, I just, I just memorized this. He wasn't a believer. And I would do it quite often because we're trained to do that. So I was, and I'd quote the scripture, whatever it may be. I still remember Rich on one occasion saying, as I quoted a scripture to him, he got quiet for a moment. Then he said, David, he said, this is what he said, shutteth thy moutheth. He said, book of big rich, chapter one, verse eight.  And so he finally said shutteth thy moutheth. But that's, that's the fact. You can read the scriptures and you can have opportunity. You hide it. You treasure it in your heart. You don't store something up normally that you don't value. But you do treasure things or place things in a safe place when you value them. So if you're going to gain wisdom, you gain, you must value God's word. It's to be stored in your heart. It's carried about with you. It's called upon in time of need. It comes with a hunger and a desire. It's like when Mary, the sister of Martha, was there valuing what Jesus said. It tells us, Luke tells us in chapter 10, verse 39, that that Mary sat at Jesus's feet and heard his word. I mean, that's an observation you find in scripture. She sat at his feet. She heard his word. And that's where you gain your wisdom from treasuring it, listening to it and applying it. So if you're going to gain wisdom, value God's word. Colossians 3 16, let the word of Christ dwell in you richly in all wisdom. Psalm 119 verse 11, thy word have I hid in mine heart that I might not sin against thee. Psalm 119, 127, therefore I love your commandments more than gold. Yes, then find gold. There's a value, a treasuring. So you receive and you treasure a third thing. Verse two tells us, incline your ear to wisdom. Apply your heart to understanding. The word incline, be attentive. Listen closely. Heed, pay attention to. It refers to the active, practical habit of simply paying attention. Paying attention is another way of speaking of mentally interacting. When the word of God is being spoken, you're interacting with it. You're inclining towards it. You're asking questions of it. How does that work in my life? How can I apply that? What does that mean? And again, that reveals that you value the word of God. You're inclining towards his word when you read it. You're inclining towards his word when you are taught it. And you're inclining towards his word when you have personal discipline and you're seeking it on your own with the intent to apply what you're learning. Psalm 119, verse 10, with my whole heart, I have sought you. Let me not wander from your commandments. Psalm 119, 112, I have inclined my heart to perform your statutes forever to the very end. Incline your heart to it. Listen attentively to what's being said. That becomes the habit of your life. It does. When someone's given a Bible study, and I'm not the one doing it, I'm listening to somebody else. I incline my heart in that direction. I listen carefully. I'll listen carefully to what they're saying. Because I want to apply it. I also listen and I encourage you to do the same with discernment. I hear what they're saying and I compare it with what I know and what I've been taught in order that I might see whether or not this is going down the right path. Because sometimes things that are being said are not accurate. It's not being rightly divided. It's something that's error. Sometimes even heresy. Simply because somebody opens the book and reads it doesn't mean that they're correctly interpreting and presenting it. I had a guy who was arguing with me one time about just reading the Bible and this and that. And it was an argument about scripture and all. And I said, you need to remember even Satan quote scripture. Because he did to Jesus. It is written concerning you. And when he was tempting the Lord Jesus Christ, cast yourself up here. And it is written. The angels, well, he's given the angels charge concerning thee and they will lift you up, lest you dash your foot against the stone. He quoted a Psalm to Jesus. But what he did is he eliminated a portion of that Psalm. Because the Psalm says to keep the in all thy ways. And so what he was doing, it was taking the scripture, misquoting the scripture and applying it in a way that would cause Jesus if Jesus succumbed to this temptation to actually fall for a misinterpretation of scripture. So you incline yourself to the word of God. You read it. You treasured it. You've received it. You're inclined towards it.  In order to grow it may include rising up early in the morning. It may include reading late at night. But this speaks of a hunger, a desire that causes other things to fade in comparison. In verse three, he gives us a fourth thing. He says, cry out for discernment. Lift up your voice for understanding. So as you're receiving God's word through active study, there needs to be something else. Notice what he's saying. Cry out. So you cry out to the Lord in prayer because it requires the spirit of the Lord to eliminate his word. Psalm 119 verse 18 says, open my eyes that I may see wondrous things from your law. Psalm 119, 130, the entrance of your word gives light. It gives understanding to the simple.  I'm just telling you what I do. Father, help me do that. Father, help me do that. I need and I pray. I pray during studies. Hey, listen, God, help me to do that. Because that's true. That's what you say. Help me to do that. And so you're inclining yourself in that way.  In verse four, if you seek her as silver, search for her as for hidden treasure. And so he speaks concerning seeking and searching. You can read the word of God with a group, but to search the scriptures must be done alone. In Psalm 119 verse 72, it says, the law of your mouth is better to me than thousands of coins of gold and silver. When you seek as silver, it shows that you value it. And Jesus in Matthew 621 said, where your treasure is, there your heart will be also. I know how impractical this may be, but it's worthy of at least consideration on occasion. If you were to be stranded on an island, other than the necessities that would be required for you to survive, what would you want on that island? And for me, I would like to say, I need his word. If I have the food and water and all, I need his word. I need to be in his word. I need to read his word because his word gives me comfort and direction and and all of that. And so it's this it's this valuing of the word of God. Frankly, it's something that I think the church in this age, the age that we're in at this moment, I think it's something the church needs to be reminded of, to value the word of God. Now, what happens? Well, in verse five, he says, then you will understand the fear of the Lord, find the knowledge of God. For the Lord gives wisdom from his mouth comes knowledge in understanding. He stores up sound wisdom for the upright. He is a shield to those who walk uprightly. He guards the path of justice, preserves the way of his saints. Then you will understand righteousness and justice, equity and every good path. You're going to gain a deep knowledge and understanding of the ways of the Lord because you're receiving his direction and his protection. He's basically making it very clear. Wisdom protects you in your life and God will make us into righteous individuals. We will be protected by his wisdom and won't get ripped off by the devil and the world.  So that's the origin of wisdom. It comes from the Lord. If you search for wisdom, God will give it to you. You know, one of the things that I desire above most everything is wisdom. It's wisdom, most definitely, that the Lord would would increase my understanding and give me wisdom to live, especially as a pastor. Because over the years, I have encountered so many with so many needs and so many questions and yes, and so many parts and problems. And I tried to share this one time many years ago. I didn't make sense then. I won't make sense now, but the bottom line is most people when they know that I'm a pastor in my church or when people meet me and discover that I'm a pastor in one way or another, they're not interested in my opinions about a variety of things. I promise you that. They're interested in anything. They'd be interested in, and they'll say this kind of stuff, my take on certain things from the Bible. And I've always been interested in this, how that I'll be on a plane and I'll be seated next to a stranger and I kind of wait for them to ask me, what do you do? They'll be saying something nasty or whatever. Then they ask you, what do you do? And it's always fun. I remember many years ago, I was having a meeting at one of the local coffee shops and the waitress was pouring our coffee and I would go there every Tuesday and I'd go there early with one of my staff members and we'd have a business meeting over a cup of coffee. That's what we did. And we did it for a long time, a long time. So she had gotten to know me in the kind of way that a waitress knows somebody. Good morning, how are you? Fine, how are you? That kind of thing. And what will you have today? Coffee? Yeah, just a cup of coffee please. Okay, so she started doing that and she started getting real friendly. And then one day she walks up to me and we'd been going there for several weeks now and so it's kind of like friendly good morning kind of thing. And she looks at me and she says, I got to tell you a joke and I'm going, oh Lord, oh no. This lady, you know, she tells me a joke and it's a little off color and I smile at her.  You know, harlot? No, I didn't say, I didn't say, I just smiled at her, you know. And so she thought I thought the joke wasn't funny and she was right. But she goes, eh, she walks away and she comes back and she says to me, you're here every week. She goes, what do you do for a living? And I said, I'm a pastor.  I said, no, no. I'm a pastor. And she's like, shocked. And she thought I'm teasing her. You know, she had told me a joke.  I know. So really, you're not kidding.  No, I'm not. I said, and this is one of my staff members. She got red in her face. But the thing that made me laugh, she turned and said it to all the people in the restaurant, I just told a pastor a dirty joke. She told everybody in the restaurant. And then she looked at me and she says, you're not a pastor. Where's your uniform? I'll never forget that. Where's your uniform? Do you know that she came to church the next week and answered the invitation to get right with the Lord? Yeah, how cool was that? Yeah. So, you know, the bottom line is, is the Lord will give to you. And as you're treasuring all of this, he gives to wisdom and the ability to communicate this to others. But it's something you seek. And it's something you're prepared to give when given opportunity. The wisdom that we desire comes from the Lord. So he said, search for it and God will give it to you. In verse seven it says, he stores up sound wisdom for the upright. He is a shield to those who walk uprightly. He speaks of sound wisdom. The word sound wisdom speaks of efficient wisdom. You're going to abide in success, which is the effect of sound wisdom. Because wisdom is the foundation of security as well as safety. So his promise is, your life will be blessed and secure in him. Why? Because you are living in the wisdom of God. Listen, it is so basic. I mean, the wisdom of the Lord inspires us in every aspect of our life.  It's really simple. It's really not that complicated.  It's not that hard. And if you begin at your present age, whatever it may be, and it becomes a habit of your life, eventually what happens is it is who you are. And it is so inculcated in your soul, the word of God, that it's a normal response for you over time. The things that you'll say when you quote a scripture or you'll give a portion of what you've learned is just normal because you're absorbed in this. It's treasured in your heart. It's your foundation of life.  It says in verse 8, he guards the path of justice, preserves the way of his saints, then you will understand righteousness and justice, equity and every good and every good path. God protects those who takes the path of justice. Those who follow him as Christians. There are many traps and many temptations that we endure daily by seeking wisdom from the Lord. Our lives are protected from ungodly influences. Psalm 121 verses 5 through 8 reads, The Lord is your keeper. The Lord is your shade at your right hand. The sun shall not strike you by day nor the moon by night. The Lord shall preserve you from all evil. He shall preserve your soul. The Lord shall preserve your going out and your coming in from this time forth and even forevermore. He says in verse 10, when wisdom enters your heart and knowledge is pleasant to your soul, discretion will preserve you. Understanding will keep you. And so when wisdom is your chief desire, when it enters your heart, doing right becomes a joy. And your heart and your life is blessed. He says knowledge is pleasant. That word pleasant is, it means delightful. It speaks of something that is sweet. Again, like Jeremiah said, your words were found, I ate them. Your words were the joy and rejoices of my heart. Discretion, he says, will preserve you. Understanding will keep you. Now discretion is the ability to make a proper decision. Understanding speaks of a depth of insight. Discretion and understanding, two very important and needed qualities in our lives. Discretion, to be an individual who can make the proper decision no matter what. To have understanding means more than just a shallow kind of concept, but a depth of understanding. An insight that is deep because your relationship with God goes deep. He said these are the things that happened when wisdom enters your heart. And he said in verse 12, to deliver you from the way of evil and from the man who speaks perverse or twisted things. Wisdom is intended to deliver us from the way of evil.  That which is evil is that which brings pain, misery, and harm. And so he's about to speak to us concerning these things in just a moment. He's saying to us that it's important for us to understand that that wisdom keeps us from the man who speaks perversity. So he's going to speak about his character because what is in this evil man is going to be coming out of them. If you want a point of application, you can get from here. And again, when it says in verse 12, to deliver you from the way of evil, from the man who speaks perverse things. Let me speak to you from experience, just from experience. Choose your friends wisely. Did your daddy and mom ever tell you that? Anybody ever tell you that? Mine told me that plenty. I ignored them most of the time when I was growing up. Why? Because I thought my parents were just old and dumb. What do they really know? They were so right. They were so right. I still remember I was standing at the Whittier Jail, and I was looking from behind a little plastic sheet because I was in jail. And my friend Bill and my friend, one of my other friends was with him, and they were standing on the other side of the glass.   What are you doing here? And what I was doing there is I had burglarized a jewelry store, Hudson's Jewelers. I had stolen a couple thousand dollars worth of diamond rings, and I got caught 15 minutes after breaking into the store. I wasn't very good. My parents had told me to be careful about the company that I keep, and I wasn't. And so I wanted to impact and I wanted to impress and I wanted to be well known for being something.  Be careful who you hang around with. Be careful who you allow to influence you. This doesn't apply just to young people. This applies to all of us. You can either be an influencer or influenced. You're going to be one or the other. Try and be an influencer, but how can you be a good influence? Get in the word of God. Practice what God preaches, and you will become a person that learns to choose your friends wisely because he says it delivers you from the way of evil from the man who speaks perverse things. Choose your friends wisely. If your friends don't desire to serve the Lord, then they're not your friends. They're your ministry, and there's a difference. I had to learn that a long time ago because a friend wants to encourage you to go in the right path, but if you have someone in your life who is influencing you to go in the wrong path, avoid them. Avoid them. And when you're with them, I'm not saying be mean to them. I'm simply saying don't allow them to influence you. And when you're with them, pray and seek the Lord that you might be able to be a good influence on them. I had to learn that, by the way, a long time ago. A long time ago, Marie and I, when we were young, I had a friend of mine that I loved very much and very dear to me. When I did see this person, I can still remember, we'd pull up to the house, we're going to see him for a little while, my wife and I, and I would pray before I went in. And I would say, Father, help me to be a solid Christian. Help me to be a good man, because you know my friend tries to influence me for evil. That's just a fact. I want to be an influence for good. So I've made that decision a long time ago. I encourage you to do the same. Choose your friends wisely. They do influence you. So wisdom, verse 13, it says, from those who leave the paths of uprightness to walk in the ways of darkness, be on guard against allowing backsliders to influence you. Backsliders are a great danger to an innocent or a new believer, because backsliding, professing Christians, can influence others to sin. This person he's speaking about has left the path. And there are those who can make a believer feel ashamed when you remain on the path. I've had this, and even this may be hard to believe, but even as a pastor, I have had pastors who have told me, you know, lighten up. You're too serious minded, man. You've got to, you know, and even when our church first began, I like to joke. Forgive me. It's not all about me, but I'm just letting this kind of work through me as I'm sharing with you. I like to tease. I like to laugh. I enjoy it. And every once in a while, when I'm teaching, you'll see it comes out of me. But I'm very sober-minded. I just am. It may be part of my nature. I don't know. My dad was very sober-minded. It may be that I am too, because of that. I don't know. But I believe it has more to do with the spirits influence in my life and my desire to be a good example. And so I've had pastor friends who have said, Dave, lighten up, man. Why are you so uptight, man? I'm not uptight.  That's just the way it is, because I have friends that can be pretty dumb and do insaisily things that I don't, I just, it's not like they're sinful. It's just that I want to have opportunity to minister at any given time. And I'm very careful. I'm very guarded about that, because you never know who's watching you. You never know who's around. You never know who's listening into your conversations. I was at a restaurant a while back now and a pastor friend of mine was seated across. He's from from another city, you know, hundreds of miles away and he had come into the area and were having lunch. I've shared this with you before, but he was kind of bearing his soul to me as a pastor to a pastor. And what he was saying wasn't wrong. It was just one of those things that probably should be shared where nobody's listening, because people could misunderstand what he was saying. And so he said something to me and I just, I just drank my coffee or whatever. I just, I didn't respond. He said something else. I didn't respond. And changed the, he changed the subject. We continued to visit. We stepped out of the restaurant and he says you, you got quiet for a moment there. Didn't want to respond. I said, you never know who's next to you. You never know. I said, I'm very guarded. I said, my church is just down the street. You never know. And they may misunderstand. So I don't know. I won't talk. I am quiet. And because I had looked at this person who's right, you know, six feet away and there's another person right here, real close. They can overhear what's being said. And I'm, I'm looking at them, well they're like friends talking and I'm, I'm not going to respond. The next day, this was a Saturday, the next day Sunday night, we had a baptism and the guy who was sitting right there, I baptized him. The guy who was sitting there that I didn't know who was listening to our conversation, I baptized him. That has happened so many times where somebody I don't know is seeing me. They will walk up to me when I'm in a, in the store. They'll look into my, my basket to see what I'm buying. That's why my wine is Christian brothers. No, I mean, they will, they'll, be aware. Be aware of your influence and be aware of another's influence on you. And be aware also that those who have left the path can have great influence on you. And sometimes they can make you feel ashamed because you want to walk with the Lord. In Proverbs 419, the way of the wicked is like darkness. They do not know what makes them stumble. Again, backsliders, it's been said, are often as dangerous as heretics. He says in verse 14, who rejoice in doing evil, delight in the perversity of the wicked, whose ways are crooked and who are devious in their paths, who rejoice in doing evil. When they reject the Lord, their delight ends up by them choosing their own path. And the paths they choose lead them further away from the Lord. Eventually what happens is they become completely insensitive to sin. To deliver you from the immoral woman, from the seductress who flatters with her words, who forsakes the companion of her youth, forgets the covenant of her God, for her house leads down to death and her paths to the dead. None who go to her return nor do they regain the paths of life. So you may walk in the way of goodness and keep to the paths of righteousness for the upright will dwell in the land and the blameless will remain in it, but the wicked will be cut off from the earth and the unfaithful will be uprooted from it. Here we go talking about the immoral woman, the seductress. Wisdom is intended to deliver you from the immoral woman, from the seductress. The word immoral. This is interesting. I'm going to develop this and take a moment. The word immoral speaks of another family, immoral. The root speaks of another family or someone who is outside of the believing community. It's a word that actually describes somebody who's outside of the believing community. This would be speaking in context of a Jewish woman who is not practicing her faith. A seductress is a word that speaks of someone from another nation. The point that's being made is she is not practicing religious conventions of the community, though she is Jewish. And he's saying you need to watch out for somebody who gives you the appearance that they're right with the Lord when in fact they're not. She's one according to verse 16 who flatters with her words when it says this is a woman who flatters with her words she uses every device to draw a man away from the way of the Lord in order that they might sin greatly. In verse 17, it speaks of forsaking the companion of her youth and forgetting the covenant. When it says she forsakes the companion of her youth she rejected her husband whose love and whose counsel she once respected. She has rejected her first love and has rejected her relationship to God. So she's a person if you brought it up to today's kind of situation she's a person who wears the outside appearance of a Christian. She may be someone who goes to church she may be someone who reads the Bible. She may be somebody who prays and hangs around with other Christians. She may even be somebody who on occasion will talk about the Lord. But when they're alone with you they're open and available in a physical way. He's saying watch out for this. A person who has the appearance of being a believer but in fact isn't and will use her influence to draw you away from the Lord. They can destroy your walk with the Lord and they can leave a mark on your reputation. We're going to see in Proverbs chapter 6 verses 32 and 33 whoever commits adultery with a woman lacks understanding he who does so destroys his own soul wounds and dishonor he will get his reproach will not be wiped away. Sexual sin he's saying we need to avoid the temptation of sexual sin and when you read your Bible sexual sin is consistently forbidden throughout the Bible from the old to the New Testament but sexual sin is something that is so common today that it's very accepted. There are those today who refer to sexual sin in a way that they'll say well basically it's somebody's private matter it's somebody's personal behavior and that's the general tenor of our society it's a private matter but there are many Christians who have a low view of the severity of sexual sin. When we do premarital counseling we will ask each couple to honor God with purity. We encourage the couple to honor the Lord with their bodies in Hebrews 12 14 it says pursue peace with all people and holiness without which no one will see the Lord. So we encourage people to be pure to have relationships that are solid. A lot of people don't understand that. A lot of people don't value that even who go to church I've seen it so much in so many different ways even in this church and Bible studies even prior to even prior to me pastoring this church where people are not avoiding sexual sin they're they're engaged in it. From the beginning of this ministry I have tried to teach what God's word says in terms of the purity of our lives and the holiness and I'm only doing that because the Scripture tells us to 1 Thessalonians 4 3 says this is the will of God your sanctification you should abstain from sexual immorality Ephesians 5 3 says but fornication and all uncleanness and covetousness let it not even be named among you as is fitting for saints. Now when we do premarital some will say that well we're not we're not with each other physically anymore but they continue in sin obviously that's a matter of their own conscience before the Lord but when you start a marriage in that manner doesn't portend well for its success sin needs to be repented of not fostered and simply feeling bad about something doesn't change anything so you need to avoid it you need to plead for an occasion and he's saying this is a woman who is seducing she's flattering with her mouth and there is a result notice what happens verse 18 her house leads down to death her paths to the dead none who go to her return nor do they regain the path of life so strong warning sexual sin has consequences he says her house leads down to death her paths to the dead sexual sin always leads to destruction always it always destroys there are the unplanned pregnancies there are the abortions that will take place the diseases the guilt and the pain that results from that and he's saying if you become entangled in this sin your life will not go unscarred there are those who say well I didn't change any you know I just moved on but you carry the memories with you and sometimes it's very painful to deal with so you need to avoid it avoid sexual sin you see unrepentant sin reaps eternal consequences Ephesians 5 5 and 6 says this this you know that no fornicator unclean person nor covetous man who's an idolater has any inheritance in the kingdom of christ and god let no one deceive you with empty words for because of these things the wrath of god comes upon the sons of disobedience notice verse 18 how he says her house leads down to death and her paths to the dead the sin which they commit who have dealings with the strange woman is deadly leads on to death and from death there is no return nor a laying hold of or regaining he's saying the paths of life notice verse 19 none who go to her return nor do they regain the paths of life adulterers and hormongers are very rarely brought to repentance but are generally hardened by the power and deceitfulness of that lust that's true whenever I've done ministry and somebody gets into an adulterous relationship I don't know I I'm trying to remember if there's ever been a time when I've seen anything other than what I'm about to say and I don't think I have normally what I've seen over the years is somebody who enters into a an adulterous relationship ends up leaving their family because they want the new relationship more than they wanted the old one and that that's I think that's been every time I've ever had a counseling appointment or ministered to somebody who's entered into sin like that they don't return many well none of the ones that I have ever ministered to have ever said you know you're right I should remain with my mate they they normally say no no I'm not happy anymore I'm moving on it's time for me to be happy almost every time he says they don't regain the path of life they walk away so first 20 you may walk in the way of goodness keep to the paths of righteousness for the upright will dwell in the land the blameless will remain in it but the wicked will be cut off from the earth the unfaithful will be uprooted from it the upright inherit the promises of God but the wicked are uprooted judgment awaits the unfaithful but wisdom guides us in the path of righteousness Solomon is just simply saying listen listen to me listen to me I still remember one of my children when they were in their teen years and they were moving in a direction I was concerned about and I said don't go in that direction don't move in that direction you're going to regret it it's going to bring you pain and I still remember how they said to me you have your testimony and I'm forging mine and I said and I have said see the reason I raised you the way that I did is because I don't want you to have my testimony because let me say this and I'll close the prayer you know sometimes you'll hear somebody give their testimony and you'll say man what a life of sin look at what they did because a lot of times the sin is attractive it sounds like it was even fun how they did this and they did that how they but see I have a lot of friends who have amazing testimonies and I have my own I would give anything to not have my testimony and I didn't want my children to have my testimony I wanted them better I wanted them not to have the scars that I still deal with the memories that I still cast on the Lord the thoughts that can still invade at moments that I don't want a song that's playing that takes me 50 years back to a place I shouldn't have been I still deal with that and I wanted to raise my children to not have the pain that I still suffer with my son obey my commandments pursue the right life avoid the pain that's still good that's still good advice God help us to do that ourselves Amen