RandomSequence

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg

Tuesday, June 18, 2013

Samba Server on Android Media Player

Posted on 12:57 AM by Unknown
I recently bought an Android-based media player: the Minix Neo X5. It came with the original firmware, which had issues playing the MTS video files that my digital camera produces, so I promptly upgrade to the latest ver 011 of the firmware. That solved the MTS playback issue, but the firmware itself was not very stable and hang quite frequently. So I promptly installed Clockmod Recovery, followed by the CWM version of Finless V1.2b. Now everything is fast and stable!

Next, I needed an SMB server on the media player so that I can manage its content from other PCs in the house. Surprisingly this turned out to be harder than I thought given the hackish nature of Android.

SambaDroid was quite easy to install and work with. Unfortunately, it does not support files > 2GB in size. This is quite a major limitation given than many media files these days are > 2GB in size.

Samba Server turned out to be a dud. Despite having root access, I couldn't set it up so that it is accessible by other Windows PCs. I even performed some registry hacks to enable legacy NTLM without any success.

I had partial success with Samba Filesharing (V1.0.6) and it supports files > 2GB, but I could only get it to work occasionally after a lot of coxing. Turns out it does not yet support Jelly Bean, so the app crashes the other 99% of the time, even with the samba-rc hack.

With no other candidates to try, I tried hacking into Samba Filesharing to see if I can make it work better with JB. Armed with adb shell,  I found that the Android version of smbd and nmbd are found under /data/data/com.funkyfresh.samba/files and can be started by running:

> sh ./samba-rc restart

But the app itself interfered with the operation of the daemons. Perhaps it is trying to control them and ended up crashing/killing the daemons. Anyway, the conclusion is that there is a fully working version of Samba included with the app. It's the app itself that is incompatible with JB. The app is a wrapper that receives events so that it can start smbd and nmbd when the network is up, and kill the daemons upon user request or when the network goes down.

So what I ended doing was:

1. Install and configure Samba Filesharing. This properly configures samba-rc and smb.conf.

2. Perform adb pull /data/data/com.funkyfresh.samba/files. Then update samba-rc by adding a single line.

3. Uninstall Samba Filesharing. This gets rid of the app itself so that it does not interfere with the daemons.

4. Manually create /data/data/com.funkyfresh.samba/files via adb shell.

5. Zip up the files and upload via adb push. The zipping is necessary because adb push can only handle individual files. Then adb shell and unzip.

6. Perform chmod 0777 samba-rc smbd nmbd.

Then I try to manually execute sh ./samba-rc restart. This started the smbd and nmbd daemons and I was able to connect to the shares from another machine.

Now this left the problem of running the script when the machine starts up, after the network interface is brought up. The simplest way I found was to use Script Manager. There are probably other ways (eg. via DHCP hooks), but I am lazy and went with the simplest method that worked.

I am sure Samba Filesharing will eventually be updated to support JB fully. There is a very active thread here on xda-developers for this purpose. But in the mean time, if Samba Filesharing does not work directly on your device yet, I hope my experience here is of some help to get it working on yours.
Read More
Posted in android | No comments

Monday, June 17, 2013

General (lossy) method for normalizing volume of any video file

Posted on 9:56 PM by Unknown
I have an MKV video file (H264 video, AC3 audio) whose volume I need to normalize. Unfortunately, there doesn't seem to be any lossless way of normalizing the AC3 audio track. So I found out the general (lossy) way of normalizing the audio track of any video file is:

> ffmpeg -i input.mkv -vol nnn -vcodec copy output.mkv

nnn = 256 (no change)
nnn = 128 (half the volume)
nnn = 512 (double the volume)
etc.

This should work for any video file format that ffmpeg recognizes.

In addition, I can use the -map commands to remove any unwanted subtitles.

> ffmpeg -i input.mkv -map 0:0 -map 0:1 -ac 2 -vol nnn -vcodec copy output.mkv

This tells ffmpeg to only include track 0 (video) and 1 (audio) in the output file and ignore the rest.
Read More
Posted in video | No comments

Sunday, December 16, 2012

Adding "Stereo Mixer" to Windows 7 with Conexant sound card

Posted on 4:16 AM by Unknown
This procedure worked for my laptop (Thinkpad E530) with a Conexant 20671 sound card, but I suspect it will work for other sound cards in the Conexant family.

I was playing with CamStudio to do a video capture of a Flash-based cartoon so that I can put it on the WDTV media player and play it on the big screen in the living room for my kids. The video capture worked brilliantly, but to do a sound capture, I needed to do some hacking.

Apparently, there was this recording device called "Stereo Mixer" that was pretty standard in the Windows XP days. This allowed you to capture whatever was played to the speaker in all its digital glory. Then under pressure from various organizations on the dark side of the force, Microsoft and soundcard makers starting disabling this wonderful feature from Windows Vista onwards.

So after much Googling around, I found out that for most sound cards, the hardware feature is still there, just not enabled on the software side. Unfortunately, to enable the "Stereo Mixer" feature is not as simple as ticking a checkbox. The procedure is frequently complicated and is different for various soundcard chipset families.

Luckily, for the Conexant sound card on my laptop, the procedure to enable the stereo mixer feature was comparatively straightforward.

First, right-click on the "Sound" icon in the system tray and select "Recording devices":

 

Then right-click on the whitespace and select "Show Disabled Devices":


Make sure you don't see a "Stereo Mix" device that was previously hidden.

Now, you need to add some entries to the registry. Create a ".reg" file with a text editor with the following content:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4D36E96C-E325-11CE-BFC1-08002BE10318}\0000\Settings\EPattributes\EpSettings\StereoMixEnable]
"Enable"=hex:01
"MixAssocSeq"=hex:e0,e0
"MuteGainSettings"=hex:00,00


Double-click on the .reg file and enter it into the registry. Verify by firing up "regedit".


This enters the "StereoMixEnable" values under "HKLM\System\CurrentControlSet". You also need to enter this into all "ControlSet00x" subtrees under "HKLM\System". So for example, since I have "ControlSet001" and "ControlSet002" under "HKLM\System" on my machine, I edit the .reg file to:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\
ControlSet001\Control\Class\{4D36E96C-E325-11CE-BFC1-08002BE10318}\0000\Settings\EPattributes\EpSettings\StereoMixEnable]
"Enable"=hex:01
"MixAssocSeq"=hex:e0,e0
"MuteGainSettings"=hex:00,00


and double-click to enter it into the registry. I repeat for "ControlSet002".

Now reboot the machine. Then follow the previous steps to bring up the recording devices. If all goes well, you should now see a new, disabled "Stereo Mix" device in the list.

Right-click on the device and select "Enable":


Then set it to the default device by highlighting it, and selecting "Set Default".


Now, under CamStudio, I select "Options, Record audio from microphone". Since the default recording device is now "Stereo Mix", anything that is played through the speaker is now piped through to CamStudio for recording.

Mission accomplished!
Read More
Posted in windows | No comments

Sunday, December 2, 2012

Using Google Dashboard to manage your Android device backup

Posted on 5:23 AM by Unknown
I used to use AppBrain/Fast Web Install to keep track of which apps I have installed on my phone, and to make it easier to reinstall those apps when the phone gets wiped or replaced. But AppBrain had been going down the tubes, and Fast Web Install had always been a hit-and-miss affair.

Android's own "backup to the cloud" system had previously been even more unusable. There isn't a place where you can see what has been backed up. And when you setup a new phone with your Google account, you just have to wait and pray that your favorite apps will be restored to the phone. Typically all the stars have to be aligned just right for this to happen. More often than not, after waiting for an hour or so and nothing happens, you just curse under your breath and proceed to install your favorites apps manually via the Play Store.

But I just looked again recently and was pleasantly surprised that things are much more civilized now. Firstly there is a place now where you can look at all the apps that are backed up. It's called the Google Dashboard. This is where you can find out almost all the information Google stores on your behalf across its wide range of services, including Contacts, Calendar, Docs, Gmail, Google+ etc.

If this is the first time you are visiting Google Dashboard, you will be shocked how much Google knows about you. If you are not (and you own an Android smartphone with location history turned on), then you should definitely take a look at "Google Location History" (under "Latitude"). Even my wife doesn't know that much about me!

Anyway, under "Play Store", you should see an "Installed Applications" link.


Click on that link and you will be brought to a page that shows 1) the apps currently installed on your devices 2) all the apps you have ever installed on your devices


You can quite comfortably manage your entire app library from the web browser, including install/update/delete apps. The only thing missing is probably batch install, which I hope will be added later. But if you choose multiple apps for installation, the system is smart enough to install the apps sequentially so as not to max out the device CPU and storage I/O.

Note that this only tackles app backup. App settings will only be backed up if the app explicitly built it into its code. You can check which apps backup their settings to Google's cloud by looking under "Android devices, More data stored about this device".



Not sure why this information is provided on a separate page. It would have been more intuitive if this was integrated into the "Play Store" page IMHO.

Nevertheless, this is a major improvement compared to what we had previously. All the details about the backup on each device are displayed, and managing apps from the page works very robustly from my testing (compared to Fast Web Install). All we need now is batch install function. Google, are you listening?
Read More
Posted in android | No comments

Friday, November 30, 2012

Jamming Flagpoles

Posted on 6:22 PM by Unknown
Today I read a report about Iran's alleged "flagpole jamming network".  Reading all of this, it became plainly obvious that, "of course this is a method they're using."  Here in the States, we already use flagpoles to conceal cellular communications towers.  You can see an example of such towers here.  So, it makes a certain amount of sense that tyrants (Islamofascists, Democrats, Republicans, etc.) would use similar means to conceal a "secret" jamming network.

The one problem I have with the story reported by Fox news is simply this: a jamming system requires both power and communications connectivity.  I.e. you can't just throw a flagpole in the ground and magically make it a part of a larger jamming network. Hasn't anyone reported seemingly excessive communications or electrical work being done around these flagpoles?  Instead of offering subjective reports about juvenile cancer rates, etc., why not identify the concrete things that would prove the purpose of these mystery towers?

Media.
Read More
Posted in | No comments

Monday, November 19, 2012

Sex and its irrationality

Posted on 7:36 PM by Unknown
I am probably your average heterosexual male specimen. Having gone through a younger period where sex is at the top of my list of priorities, my hormones have calmed down somewhat and now it appears I can finally examine sex with more rationality.

Recently it is beginning to get to me that sex is not something that one can rationalize. It lies outside the realms of rationality. The fact that a heterosexual male gets aroused by the sight of breasts or the vagina is not something one can deconstruct. In fact, there is nothing inherently attractive about these things other than the fact that millions of years of evolution have built their sense of attractiveness into us, without which our species cannot survive. If an alien from another planet were to land on Earth, they will never understand why we find breasts or vagina sexy, much as we can understand how a peahen will find the large and bright tail of a peacock sexy.

And we have discovered for a long time that there is a large variety of sexuality outside of the standard male-female model. You have the asexual (not interested in sex), homosexual (interested in same sex), heterosexual (interested in opposite sex), bisexual (interested in both sexes), transgender (female persona trapped in a male body, and vice versa). Within a particular category, there are also huge variations i.e. interest in different sexual organs, or even symbolism of sex (eg. brassiere or panties).

It is probably unique to the human species that we have the mental capacity to tie ourselves in knots over variances in sexuality outside of the standard model. There have probably been more debates about the morality/immorality of sexual variances than how to rid our world of hunger. Heterosexuality, being the majority, has always occupied the moral high ground. Other forms of sexuality have always been the deviant form. In some countries, being homosexual or transgender can get you killed. In fact, I have encountered few people who even understand the difference between being homosexual and being transgender. Most people still associate being effeminate as being homosexual (for males), for example.

It puzzles me to no end how most people do not question the irrationality of heterosex itself, that finding sexual organs of the opposite sex attractive is just as illogical as finding sexuals organs of the same sex attractive. To most people, heterosex is just "natural", whereas other forms of sexuality are not. This is crazy, and how people can live with that conclusion is beyond me. It is probably the highest form of prejudice there ever is, that your irrationality is somehow more "natural" than some other irrationality. I mean, this is not some argument over whether one algorithm is better than another, because then you can use logic/numbers to justify your decision. This is a case of my preference is more "natural" than yours and 1) that's it, 2) end of discussion, 3) you are a deviant/outcast.

Is it just me, or does anyone else find this crazy as well?
Read More
Posted in life and the universe | No comments

Roomba navigation algorithm

Posted on 12:52 PM by Unknown
I have been a long time user of the Roomba vacuum robot, starting from version 1 till now. It has made a big difference to my life, and I enthusiastically recommend it to all my friends.

One thing that stands Roomba apart from other vacuum robot is its navigation algorithm. There is no high-level mapping involved. Instead it uses localized decision making, much like how insects forage for food:

Our robot computes its algorithm 67 times every second, constantly stitching together information about its environment and recomputing its path. When it starts you’ll notice a spiral pattern, it’ll spiral out over a larger and larger area until it hits an object. When it finds an object, it will follow along the edge of that object for a period of time, and then it will start cris-crossing, trying to figure out the largest distance it can go without hitting another object, and that’s helping it figure out how large the space is, but if it goes for too long a period of time without hitting a wall, it’s going to start spiraling again, because it figures it’s in a wide open space, and it’s constantly calculating and figuring that out. It’s similar with the dirt sensors underneath, when one of those sensors gets tripped it changes its behaviors to cover that area. It will then go off in search of another dirty area in a straight path. The way that these different patterns pile on to each other as they go, we know that that is the most effective way to cover a room. The patterns that we chose and how the algorithm was originally developed was based off of behavior-based algorithms born out of MIT studying animals and how they go about searching areas for food. When you look at how ants and bees go out and they search areas, these kinds of coverage and figuring all of that out comes from that research. It’s not exact, obviously, I’m not saying we’re honeybees, but it’s that understanding of how to search out an area in nature that is the basis behind how our adaptive technology is developed.
The algorithm is actually quite effective and robust in the real world. For a short while, I used to house two cats in a room, and you can imagine how dusty that was. Roomba never failed to clean up the room for me after I left it to its devices. It was squeaky clean after each session, and all I had to do after that was to give the wooden floor a quick mop.

Don't take my word for it. Check out this video providing a time-lapsed coverage test of various vacuum robots, including The Roomba 5 series.


However, I never fail to notice, both online and off, how Roomba's navigation algorithm invokes all kinds of negative feeling in users. Comments typically are of the types:

... It is just going in random directions
... Personally I will not vacuum like that
... Why does it go over the same area twice?
... It is not very efficient, it takes too long 

I have seen people just standing there and supervising/criticizing their robot's every move! This is crazy! Do you stand there and supervise your washing machine? I mean, you just dump your clothes in, set a wash cycle, and come back in 45 mins or whatever. What's so difficult about that? Instead you have people just hanging around and second guessing every move the robot makes. Absurd!

I can understand maybe a robot vacuum cleaner is something new to a lot of people, it hasn't become quite as mundane as a washing machine. Or maybe a localized or bottom up algorithm is just harder to understand/accept compared to a top-down algorithm. Rodney Brooks, the co-founder of iRobot, the company that makes Roomba, is a pioneer in the field of bottom-up robotics. He famously created robotic insects that do not have a central "brain", but instead make localized decisions based on the feedback from various sensors (much like the Roomba). In the physical world, that approach turns out to be extremely robust and resilient.

AFAIK iRobot has never organized any campaign to dispel such negativity. I guess maybe it is just too difficult and technical to make people understand that a bottom-up approach is superior to a top-down (mapping) approach. I hope I can make a small difference by blogging about this here. Roomba's navigation algorithm in the real world is robust. You can move furniture around while the robot is running and not have to worry that it won't come back again. You can let it bump into your foot if you are doing stuff in the same room while it is running, but you can be assured that will not have a large impact on what it is doing.

You don't want a robot to vacuum like you do. Otherwise, cars will have legs, and washing machines will have arms. Just clear the room, set the robot down, let it run, grab a cuppa and come back an hour later. The room will be clean. Trust me.
Read More
Posted in hardware, roomba | No comments
Newer Posts Older Posts Home
Subscribe to: Posts (Atom)

Popular Posts

  • 110GB+ worth of photos/videos on a microSD memory card #2
    In my previous post, I talked about wanting to write a script to see how far I can squeeze 110GB worth of media (photos and videos). I wrote...
  • Looking for the perfect car MP3 player/FM transmitter
    I have bought quite a number of car MP3 player/FM transmitters from DealExtreme and other similar websites. A car MP3 player/FM transmitter...
  • Children - The ultimate test in anger management
    Having just spent two full holiday weeks with my kids, it occurred to me this morning that raising young children is the ultimate test in an...
  • Coding the Liturgical Calendar
    For a long time, I've wanted to integrate the Roman Breviary into a couple of projects (nothing public) but have never been able to find...
  • Ubuntu: WebDAV + DAVfs2 + FUSE == Thunar Goodness
    One of the corner-stones of any *nix utility is that it should do a simple job and do it well. Every piece of software that I can think of ...
  • Fast Diet - Hunger Pangs
    When I am doing the Fast Diet , I frequently experience long periods of calm after a brief period of hunger pangs. It is as if the body has ...
  • ...and this is why I'm Catholic
    When I was looking for answers from the Methodist church about all the things I was wondering about as a teenager, I was dismayed to find t...
  • Fast Diet - Incredible Body Hack
    In terms of body hacks, the Fast Diet probably ranks all the way at the top for me. I first read about it in the papers and found the techn...
  • Jamming Flagpoles
    Today I read a report about Iran's alleged "flagpole jamming network".  Reading all of this, it became plainly obvious that, ...
  • Freeing up phone storage with Link2SD
    Another more powerful way of freeing up phone storage is with Link2SD . Using this method requires you to have a rooted phone. If you don...

Categories

  • a2dp
  • administrata
  • android
  • antivirus
  • avi
  • bluetooth
  • chrome
  • coding
  • culture
  • dos
  • eee
  • faith
  • family
  • fastdiet
  • firefox
  • gadgets
  • geeekry
  • geekery
  • hardware
  • homeschooling
  • howto
  • java
  • laptop
  • life and the universe
  • linguistics
  • link2sd
  • linux
  • migration
  • mp4
  • pdf
  • politics
  • printer
  • roomba
  • security
  • soapbox
  • software
  • transcode
  • travel
  • ubuntu
  • video
  • virtualization
  • webapps
  • windows

Blog Archive

  • ▼  2013 (11)
    • ▼  August (3)
      • 110GB+ worth of photos/videos on a microSD memory ...
      • 110GB+ worth of photos/videos on a microSD memory ...
      • Coding the Liturgical Calendar
    • ►  July (6)
    • ►  June (2)
  • ►  2012 (25)
    • ►  December (2)
    • ►  November (4)
    • ►  October (4)
    • ►  September (1)
    • ►  June (11)
    • ►  May (3)
  • ►  2011 (11)
    • ►  December (1)
    • ►  September (2)
    • ►  August (1)
    • ►  July (3)
    • ►  April (1)
    • ►  March (1)
    • ►  February (1)
    • ►  January (1)
  • ►  2010 (10)
    • ►  December (2)
    • ►  October (1)
    • ►  September (1)
    • ►  August (2)
    • ►  July (1)
    • ►  May (1)
    • ►  March (1)
    • ►  February (1)
  • ►  2009 (29)
    • ►  December (2)
    • ►  November (2)
    • ►  September (1)
    • ►  August (3)
    • ►  July (2)
    • ►  June (5)
    • ►  May (2)
    • ►  April (2)
    • ►  March (6)
    • ►  February (3)
    • ►  January (1)
  • ►  2008 (57)
    • ►  November (2)
    • ►  October (4)
    • ►  September (1)
    • ►  July (8)
    • ►  June (3)
    • ►  May (8)
    • ►  April (12)
    • ►  March (6)
    • ►  February (8)
    • ►  January (5)
Powered by Blogger.

About Me

Unknown
View my complete profile