Tuesday, November 6, 2018

Auto switching of audio output to headphones when connected on freebsd

It has been a lot of fun over a couple of months. I could have just written "fun" but it was really lot of fun. I have successfully installed and been using both freebsd and Openbsd on my laptop. Running operating systems with such long lineage on a modern 4K laptop is a dream come true. It is also testament to the amount of hard work hobby developers and users have put in keeping the BSD's usable to the next generation of users. I would like to write at length regarding my experiences in doing so. But, this post will only be related to configure auto switching of audio output to headphones when they are plugged in and vice-versa.

Let us start with enabling verbose boot from the boot menu. That is the screen u see the beastie once you boot freebsd from your favorite boot loader. The verbose boot option is not available in the first screen. Go to the next screen and choose it. Allow the OS to boot. Lots and lots of boot messages would scroll down on your screen. Dont worry this is a one time config. The next time you boot you will get back your non-verbose boot.

Get the dmesg output into a text file
$sudo dmesg | grep hda > boot.txt

The above command will save all the lines with "hda" which
Open the boot.txt with your favorite editor. Let us concentrate on the part


----------------------------
hdaa0: nid   0x    as seq device       conn  jack  
hdaa0: 18 b7a60130 3  0  Mic           Fixed Digital
hdaa0: 19 40000000 0  0  Line-out      None  Unknown
hdaa0: 20 411111f0 15 0  Speaker       None  1/8   
hdaa0: 22 411111f0 15 0  Speaker       None  1/8   
hdaa0: 23 90170110 1  0  Speaker       Fixed Analog
hdaa0: 24 411111f0 15 0  Speaker       None  1/8   
hdaa0: 25 03a11040 4  0  Mic           Jack  1/8   
hdaa0: 26 411111f0 15 0  Speaker       None  1/8   
hdaa0: 27 411111f0 15 0  Speaker       None  1/8   
hdaa0: 29 40600001 0  1  Modem-line    None  Unknown
hdaa0: 30 411111f0 15 0  Speaker       None  1/8   
hdaa0: 33 03211020 2  0  Headphones    Jack  1/8   
hdaa0: nid   0x    as seq device       conn  jack  
hdaa0: 18 b7a60130 3  0  Mic           Fixed Digital
hdaa0: 19 40000000 0  0  Line-out      None  Unknown
hdaa0: 20 411111f0 15 0  Speaker       None  1/8   
hdaa0: 22 411111f0 15 0  Speaker       None  1/8   
hdaa0: 23 90170110 1  0  Speaker       Fixed Analog
hdaa0: 25 03a11040 4  0  Mic           Jack  1/8   
hdaa0: 26 411111f0 15 0  Speaker       None  1/8   
hdaa0: 27 411111f0 15 0  Speaker       None  1/8   
hdaa0: 30 411111f0 15 0  Speaker       None  1/8   
hdaa0: 33 03211020 2  0  Headphones    Jack  1/8   
-----------------------------------
Now let us formulate a line which goes in /boot/device.hints

hint.hdaa.0.nid33.config="as=1 seq=15"

Let us go one by one

hint -> syntax
hdaa.0 -> is from the first column of all lines "hdaa0"
nid33 -> is from the second column and the number on the line of device column which has "Headphones"
config -> syntax
as=1 -> is from the column "as" corresponding to "Fixed analog" on column jack
seq=15 -> is from column "seq" and will be the most repeated number in that column

Dont forget to add
snd_driver_load="YES"   in your /boot/loader.conf

and
hw.snd.default_auto=1      in your /etc/sysctl.conf

Reboot. Profit.

Sunday, September 16, 2018

Should people work to live

There is one common thread in all of the world's religion. Work. Every living being has its purpose. This purpose is nothing but something to be done, work, again. All theologians talk about a super being and all the rules to worship that deity. They just differ in minor ways but the intent is to direct you towards an all encompassing entity. But, religion cannot exist out in thin air. It requires people, alive. How do you keep people alive. How do you provide for this. You make them work. Include passages/writings/rules in the framework which somehow tells this is one way to reach the one. In fact you can afford the path to the one only if you work. It is like a minimum requirement to be part of the religion. In fact work has created rifts among the people over the entire human history and continue to do so. With written knowledge now available to all the human beings, The classification is going to be different in the near future. We are going to have a world wherein everybody will be educated. There will no more be a situation where a select few can read the written knowledge being passed on from previous generations. Suddenly this generation can read all the knowledge generated over all the 20 centuries and is available to everybody with minimum effort. With this it will be difficult to get people to work based on old rules of caste/color/region etc. There have to be other means where you have to create dependency which in turn will force people to work willfully without knowing it. It will be more efficient compared to the older models where you forced them to work.

All the economic theories/political theories are not alien to it. In fact these ideologies talk about work in a direct sense. Working people is the basis of all the present economic/political frameworks. Even Marx's thoery starts and ends with work and workers. In fact it starts to quantify work in the best possible way. Ok...ok, I got it. You are telling me that there have been recent experiments where a minimum amount is paid as a "wage" and the individual is not required to work in the traditional sense. Why are the people in these experiments being paid. This is an ideology wherein the system is expecting contributions from the individual on his own. It is pressurizing the individual to contribute out of commitment by paying advance salary. It is a proven fact that actions/efforts happening unconsciously/willfully takes minimum effort of the brain. This arrangement of work can be utilized to increase the throughput of the effort required to complete a job.

Are we born to work. Should we work to survive. Are we not entitled to live on this planet without doing any work. Is minimum wage the answer for the 1% to keep the 99% working. Should the 99% work.

Wednesday, September 12, 2018

All oppressions start with an idea and dont die

We have all come across news regarding multinationals/individuals/corporations being sensitive/insensitive to human existence/development/status quo etc... Yes, that sentence was a mouthful. I couldn't write it any other way. All those terms are so tightly tied that you can add way more to the same sentence. Why do people do what they do. It all starts with an Idea. Th idea of existence/persistence/growth/identity. now, when people talk about idea, they normally associate it with a huge business/science/technological idea. But these ideas are based on smaller ideas and also the other way. There have been smaller ideas coming out as branches from bigger ideas. The ideas i am talking about here are the destructive ones. The ideas are about taking inputs which are un-ethical. The output will definitely be something valuable in the real world for the oppressor. For the oppressed(input) the result would be devastation. The oppressor will never know and want to know that this devastation will hit him in the immediate future or a little ahead. The idea is so damn shortsighted

Well, what are we exactly talking about here. We are talking everything which is labelled under non-sustainable development. The problem here is two fold. One is the team carrying out the devastation with the core general idea.The other is the devastation surrounding the group trying to correct the whole non-sustainable thing. The thing concerning the core idea is that even if the idea generator gives the whole plan up, the idea is still up for use. The other complication is the branching from this core idea, the subsidiaries. In fact these subsidiaries have more at stake compared to the bigger ones. The bigger ones bail out once the hurdles for returns increase. The smaller ones continue and in fact all the smaller ones can coalesce and form one big juggernaut. These smaller ones never give up. This gives an impression that the problem is bigger and there is only one big oppressor

These smaller ones are like the hydra. You get one another takes his place. This is known by all the stake holders. So, they just continue. The more educated these are the more clean and polished the oppression. What are the roles of the oppressed, the government, the general public, the press and the international community at large to stop this. Who are responsible for stopping this. Who is responsible for the situation in the first place. What are the roles of these people in resolving this. Cant we live without technology which is at the core of this oppressor/oppressed scenario. Can the world be stable without this. Is the world not stable because of this. Is the world stable. Why are the majority oppressed and the minority the oppressor. Are humans such. Are all the animals such. Why is it that equality so difficult to incorporate in living beings. Marx who started with equality had to adjust to the superiority of a few. Wont the superior ones be constrained if they have to maintain equality with the mundane.

If this has to continue, then why question it in the first place. Why show it as something wrong. Why show people who do it as if they are wrong. Does anybody become right by just telling that this is wrong. What is actually "wrong". Do we understand the right and wrong. Are we programmed with points to clearly spell out right and wrong. If we are clear on this why is everybody bearing the wrongs. Why are people doing the wrongs. If a rule is beneficial to the majority is it any excuse for the minority to bear the brunt of it. Both the groups will have their own right and wrong which are totally incompatible.

Until a time every action of all living beings happen for general good without changing the status quo or improvement chances of all living beings.........

Wednesday, August 22, 2018

The full and the whole web

In the beginning days of the public internet people only talked about the web. The other definitions and classifications of the web was not existing. You access and search all the information available through gopher, ftp or the http protocol. All the computers connected shared whatever needs to be shared on the public network. The users also accessed the full content which the content creator wanted to share. Later on blogs simplified hosting content on the public network. But this content was still searchable, thought the before creating the content you had to login to access the blogging provider services. Once you  create a blog it was available to public consumption. One to one chats between users were normally not available to the general public and should be so.

Now there have been pretty various classifications and depths of the web. We all know the web which is searchable by the present search engines. Now people wanted to monetize the public network infrastructure. The ISP was always making money. Some content providers also wanted to make money. More than all these people there were people who provided infrastructure to use the public network in many other number of comfortable ways. This started the walled gardens of intermediaries who eased the use of the public network so that the number of content creators increased. For other people to access this content they should be a member of this walled garden otherwise the content here is not available to any user on the public network. Now this part of the web, i believe is larger than the visible web. What do you call this web which is behind closed doors? The term used here is the deep web. Now a banking website has to be hidden behind passwords, not content created by the general public. For the past few years majority of the content created on the internet is behind walled gardens which will not be available to the general public without keys to the locked doors.

Ok, now let us get on to one more classification of the web. The dark web. This is the most sinister compared to the other two classifications. In fact i would include the dark web as a subset of the deep web. Why, because both are not accessible by normal browsers which are used to access the visible portion of the public network. Anonymity and privacy are the corner stones of the internet. The visible network does not ensure either of it. So, is it a requirement for the visible network. Yes and No. Yes, it is requirement for people wanting to share knowledge and thereby getting the identification required. No, because the public network infra is also used for private communications among individuals and groups. There are applications which are trying to bring anonymity and privacy on the visible area of the internet. These again are resulting in walled gardens. The same application cannot be used to create content which is searchable on the visible internet. Though the content might be marked as public, it is public to all people inside the walled garden. It is solving only one issue that of ensuring anonymity and privacy for private communications. These technologies are not providing anonymity and privacy for content creators and consumers when required. This is solved by the portion of the public network called the dark web.

The technologies used to produce and access the dark web ensures anonymity and privacy for both the content creator and the consumer. The search engines doing searches on the dark web also have to ensure the same. Is there a requirement for such a setup? Am I the right person to comment on this? Have I got the right to write and talk about it? Should any general public talk about it? Should the general public know about it? Is anonymity and privacy a requirement only for pirates and terrorists? Should such setup be used only to buy and sell drugs, guns etc? This is the right platform for illegal porn, Should it be allowed? Is this portion of the web also to be policed? So many questions. What are the answers? Who will give the answers? Should the internet be modeled on the dark web technologies?

Wednesday, August 8, 2018

Centralized social networks ending as de-centrailized

There are plenty of articles written on the social network and what plagues them and definitely they will fail as is evident from the recent activities of these behemoths. I have seen people enter their most private information while creating a f*&$book profile as though they are filling up and admission form for college, as though they were to be awarded a lottery without winning. Humans want to belong but at the same time want individuality which I will not try to dwell into since I cannot and leave it to the philosophers. The public network is all about discovering content. The content as envisaged by the pioneers of the public network are linked files. Now to get to that particular linked file the search engines did the homework continuously day and night to have a dictionary of all the links on the public network. Tools were created so that people with minimum computer language added on the links and create sub links and so on.... Now the question is to monetize this situation. Since the Public network was designed to be open and not to be controlled by any single individual/corporation it was difficult. Thus was born the concept of advertisements. This was to put a layer on top of the basic web so as to lock the user out and provide a virtual screen between the content the user wants and the user in front of the computer screen. The user sees the advertisement or the popup and then he is allowed access to the content.


The public did work around this problem by making ad blockers/pop up blockers so that the user gets direct to the content. Now here again we are into two kinds of content creation strategies. Content creation on the public network for the fun of it/use of others and the other is for monetizing every glance a user throws on the content. The second group had no option but to lock the user out completely until he removes all the tools used for blocking ads/pop ups or request the use to allow ads and also consume the content. The second group of content creators were not happy with the situation. Enter social networks. In the beginning stage of the social network boom, users were mostly sharing links to their friends. This was still a healthy situation since these links were still available to the general public without any virtual walls. Trouble started brewing when the people who were sharing links they had created or others had created started creating content on the social network itself. Now this content got locked up within the social network. You cannot share these links with the general public and goes out of scope of search engines. This yielded itself to all sorts of monetization. This also created an artificial beehive where people swarmed to taste the new content created and shared.

Complete wedding albums, Family photographs, Friends photographs, photographs of houses, offices all uploaded with gay abandon to the social network. The network grew in al directions to hoard all this precious content. The content which people were not ready to put up for public consumption and for selective sharing. The same was now available to the social network. The social network is not in vaccum. It is a machine. It has to be maintained. It has to be checked for faulty components. It has to be updated/upgraded. Where does money for all this come from. It has to come from the users. But the users definitely will not pay. They would move to an alternate option or some individual/group might have created a free alternative. Think email.

So how would the user pay. He will pay in ways and means he will not know. The social network will make money from the content created without telling the content creator about these ideas. Why because the content creator is still a human being for whom sharing is at his heart.The thing with content creators is they want to reach the maximum number of consumers. They thought that the social network was the best way they can have this reach. The second level is the metadata of the members which has been collected over the years. The metadata, first and foremost includes the content and then all the other personal aspects of the creator. This combined with the personal aspects of the consumer can be extrapolated to target further creators and consumers. it is all about connecting the creators and consumers and keep them within this walled garden. Then start monetizing. The problem here is corporations also become content creators and the content can be created as though it has been created  by and individual which in turn carries more following. There is always content created to satisfy the need of the consumers rather than the urge of the creator. This is the most dangerous content.

The content, the creators and the consumers create such vast amount of data, the uses of which are impossible to gauge. It is difficult to tell what would be the uses of this data. It is limited only by the capabilities of the researcher. With the amount of computation power at our finger tips, the limits are endless. The trouble with this walled garden is that the monetizer is himself within the walled garden. He is already having an insider view and the holistic view would be provided by the social network data centers. This give a 360 degree view of any individual in this walled garden. You can throw ads at him, You can control his timeline. You can control the reach of his content and what not. Censoring content is most easy here. Since the user don't have any control over the working of this social networking machine. Censoring can happen influenced by big corporations, wealthy individuals, chauvinistic nations etc.

At a time where we have to decide the meaning of privacy, these walled gardens are not helping the cause. People don't know the value of privacy which is similar to the concept of freedom. The main issue is that this is too much of data in the hand of one corporation. How about the content creator owning his content and provide documented ways to access it. Welcome to the de-centralized social network. Think mastodon, Pleroma, peertube etc..