Showing posts with label wine. Show all posts
Showing posts with label wine. Show all posts

Sunday, June 13, 2010

Olympus Digital Wave Player -- Where Is Folder A? What Time Is It?

I was using an Olympus VN-960PC digital voice recorder, and was downloading recordings from that device to Windows XP via mini-USB cable.  Unlike the Olympus VN-6200PC, the VN-960PC used the Digital Wave Player (DWP) program to download and display recordings.  DWP showed the actual time and date when the recording was made.  That information was not visible in Windows Explorer; WinEx would just show the date and time when the file was downloaded.


I was able to rename DWP's files (in the format DW_A0001.wav) so that the date and time of creation were contained in the filenames.  I did this using the Aqua Deskperience screen capture program to save the onscreen data from DWP into a text file, and then massaging the contents of that file with text commands (e.g., MID) in Microsoft Excel to produce a batch file to rename the files.  The batch file would run on the WinXP command line, and each line in the batch file would contain the command to rename one file.  The Excel formula for this conversion was something like ="ren "&char(34)&[old filename]&char(34)&" "&char(34)&[new filename]&char(34).  (The meaning of that command becomes visible when you run it.)  The resulting batch file line would say something like "ren DW_0001 2010-06-03 08.41 Recording.wav."

To make that approach work, I needed to be able to view the downloaded recordings in DWP.  The recordings were typically saved in a folder whose name matched the name of the folder I had used to save them on the VN-960PC.  Since I typically used Folder A, the usual location of the downloads, in WinXP, was \My Documents\Digital Wave Player\Message\Folder A.

But now I had a problem.  I was copying the downloaded files from a machine running WinXP SP3 to another machine running WinXP SP2 in a VMware Workstation virtual machine (VM) on Ubuntu 10.04 (Lucid Lynx).  I had installed DWP in this VM, and when I ran DWP in the VM it did show the usual set of folders (Folder A, Folder B, etc.), but I could not find where on the computer those folders were actually located.

The answer was that I was looking for the wrong folder name.  It was not Folder A.  It was FolderA, without a space, and it was being created in the usual place.  That part was simple enough.  I wanted to explain my setup, though, so that I could address some questions that I have seen in other posts online, and to pass along a couple of related insights.

One such insight was that, as it turns out, it was also possible to run DWP in Ubuntu.  The basic solution was to install Ubuntu with Wine, and then just find the DWP installation file (setup.exe) and double-click on it.  (You could also use Wine to run other Windows programs.)  The DWP installation file was already on my system because I set it up as a dual-boot, but I could also have copied it over.

Someone had also created an Ubuntu command-line program to download files from the DVR.  My search led to the discovery that this program, odvr, also had a GUI in its latest version.

Incidentally, in case anyone wonders, I was not able to get the VN-960PC to work directly with Ubuntu itself, nor with WinXP in an Ubuntu VM.  In other words, I could run DWP in a VM to view the DW*.wav files that I had copied there, and I could run DWP in Ubuntu via Wine, but I could not get the hardware to work such that DWP would offer to transfer the files from the DVR to the computer.  All I could get in the WinXP VM was a "usb device not recognized" error.

The other thing I wondered was whether Ubuntu might have a way of extracting the date and time from the DW_A0001.wav file without making me jump through those hoops in Aqua Deskperience and Excel.  The creation date and time information had to be in there somewhere, but how could I get it out?

I took a look at a DW_A0001.wav file in WinXP (right-click > Properties > Summary).  It said it was a 4-bit mono file saved in IMA ADPCM format at a bit rate of 88kbps and an audio sample rate of 22 kHz.  Those values would probably have been different if I had been using the VN-960PC's SP or LP rather than HQ recording modes.  Properties did not state the correct date for file creation; as just noted, it claimed that the created, modified, and accessed dates and times were identical.  I couldn't figure out a solution, so I posted a question on it in an Ubuntu forum.  That didn't draw a quick response, so I tried again in a Windows forum.  No luck there either.  I wasn't turning up much in a search, so I had to let this slide for now.

Ubuntu 10.04: "rsync: failed to set permissions on [folder]: Operation not permitted" -- and Beyond Compare

Using rsync to automate backups on Ubuntu 10.04 (Lucid Lynx), I got a million iterations of this message:  "rsync: failed to set permissions on [target drive & folder]: Operation not permitted."

I had previously had a somewhat similar problem with an external USB drive.  The solution there had been to reformat the drive.  I didn't want to have to do that again if it wasn't necessary.  I ran a search and, following what i understood from one post, I set out to change ownership on the target folder so as to match the ownership of the source folder.  To do that, I went into Ubuntu's Terminal and typed "sudo nautilus," and then navigated Nautilus to File System/media/[target drive].  (It could instead have been in File System/mnt/.)  I right-clicked on that and got Properties > Permissions.  The owner was root.  When I tried to change it, it changed back.

I exited Nautilus and followed instructions in Ubuntu Community Documentation, combined with advice from another post and the Ubuntu manual page for chown.  I typed "sudo chown -R ray /media/[target drive]."  That ran for five or ten minutes, as the chown (change ownership) command recursed (i.e., -R) all of the subdirectories on the target drive.  But that, by itself, did not fix the problem; indeed, it didn't seem to change anything.  Root was still the owner of the target drive.  Then again, the properties of the target allowed others to create and delete files as well, so why was rsync complaining?

There appeared to be another way.  In Terminal, I typed "sudo gedit /etc/fstab."  I already had a line for the target drive, which I'll call simply TARGET.  That line was as follows:

UUID=[UUID for the drive] /media/TARGET ntfs-3g defaults,umask=000 0 0

The Ubuntu documentation I was now looking at said, "Permissions are set at the time of mounting the partition with umask, dmask, and fmask and can not be changed with commands such as chown or chmod."  So possibly that's why my chown command wasn't doing anything.  Following the advice, I changed it to dmask=027,fmask=137, since this was going to be just a backup drive anyway.  I also saw that "defaults" meant these options:  rw,suid,dev,exec,auto,nouser,async.  All of those were fine, as far as I knew, except for this information from the documentation:

user - Permit any user to mount the filesystem. This automatically implies noexec, nosuid,nodev unless overridden.

nouser - Only permit root to mount the filesystem. This is also a default setting.
I wanted user, not nouser.  I decided it might be easier to spot this sort of thing, in future visits to fstab, if I just changed all occurrences of "defaults" to make these options explicit.  Besides, in light of the statements just quoted, it seemed that I would have to override several defaults anyway.  So the resulting fstab line looked like this:

UUID=[UUID for the drive] /media/TARGET ntfs-3g rw,suid,dev,exec,auto,user,async,dmask=027,fmask=137 0 0

I saved fstab and, in Terminal, typed "sudo mount -a" to mount the partitions according to these new instructions.  Then I ran the rsync command again.  Sadly, these changes made no visible difference.  I still got a million error messages.  So, OK.  I had been overlooking the first three error lines in the log output of my rsync command.  The second and third lines followed the pattern of this first line, but were for subdirectories:

rsync: failed to set times on /media/TARGET/.": Operation not permitted (1)

I hadn't previously investigated the "failed to set times" error, so now I did.  What I got out of the forums I came across was that possibly I had a syntax error in my rsync command.  Here's how it went:

rsync -qhlEtrip --progress --delete-after --ignore-errors --force --exclude=/.Trash-0 --exclude=/.Trash-1000/ --exclude=/lost+found/ /media/SOURCE /media/TARGET 2> /media/SOURCE/Backuplog.log

This was identical to the perfectly working rsync command that I was occasionally using to back up SOURCE to a different partition, with one exception:  in the one shown above, I didn't have a slash after Trash-0.  So I changed that to --exclude=/.Trash-0/ and re-ran it.  That didn't solve it.  I then noticed (I was using two desktops) that I had gotten a message telling me that the system was not able to mount the partition:  "Device or resource busy."  So possibly that fstab step still needed to be tested.  I rebooted the system.  None of the the parittions that I had adjusted in fstab were mounted.  I went back, deleted the dmask and fmask parts, and returned it to umask=000, and rebooted.  Now the partitions were all mounted.  I ran the rsync command again.  The problem had not changed.

I found an informative thread in which bscbrit suggested trying to use cp to copy a single file from the source partition to the target partition.  If it worked, s/he said, the problem was not with permissions; it was just with trying to use rsync.  So in SOURCE I copied a file, renamed it "x.txt," and typed "cp /media/SOURCE/x.txt /media/TARGET," and it worked:  there was a copy of x.txt on TARGET.  It sounded like there could be a kind of mismatch between the ext3 source drive and the ntfs target.  I also came across an informative post by djgrandmarquis that said rsync could have problems with Windows file systems.  That was in response to a question about very slow backup times, which  I had also experienced.  I needed Windows file systems because I was backing up to an offsite drive that I sometimes shared with a Windows system.

I had previously investigated Beyond Compare (BC) as another way of synchronizing drives.  BC had drawn  a lot of praise.  Since my previous writeup, I had bought a copy and had been using it for several months on Ubuntu, WinXP, and Linux.  I had subsequently found a comparison of many such programs; but since I had already bought BC and was using it with good results, I didn't explore that comparison.  I could verify that BC was fast and trouble-free when compared to rsync, especially when going between ext3 and ntfs drives.  I also liked the visible information about what was being changed and backed up.  So I decided to stop using rsync and start relying only on BC for my backups.

There were a few differences between the Windows and Linux versions of BC; but in an impressively thorough reply to my post, Craig from BC said that the portable version of BC ran well on Wine in Ubuntu.  I had already installed Wine, and I had also already been using the portable version of BC3; I preferred portable versions to save time during reinstallations, as I was able to save them elsewhere than drive C and therefore they weren't wiped out during a Windows reinstall.  So to try this out, I copied over the BC3 portable installation and tried using a funky procedure involving PortableApps to try the Windows version.  But now it seemed I had not properly understood or used that procedure:  PortableApps now appeared to be looking, not for .exe files, but for ".paf exe" files.  Meanwhile, it looked like Beyond Compare 3 would run fairly well under Wine, so I gave it a try.  Following the steps described in that previous post, in Terminal I navigated to the folder where I had the original BC installer, typed "ls" to get the exact filename, and typed "wine BCompare-3.1.10.11626.exe" to install that file.  Terminal reported some "fixme" and "err" messages; nonetheless, the Beyond Compare 3 Setup Wizard ran.  I had a licensed version, so I entered the license key, and followed the instruction to restart.  It worked, but now I came to the new realization that Windows identifies drives by letter (C: etc.), while Ubuntu identifies them by name (/media/DATA, etc.).  So of course a Windows version of Beyond Compare, looking for Windows-type folder paths, running in Ubuntu, is going to find only a limited number of Ubuntu locations.  I didn't pursue that problem.

This left at least one issue unresolved.  While I was OK with doing manual comparisons for now, I was still not at the point of being able to write scripts to automate BC backup processes.  I started another post on that.

Saturday, June 12, 2010

Ubuntu 10.04: IrfanView and Other Portable Apps via Wine

According to Tom Wickline, the process for installing IrfanView 4.23 on Ubuntu 8.04 was just a matter of installing winetricks and MFC42.dll and then installing IrfanView.  I wasn't sure how to do each of those steps, and I wasn't using quite the same setup as he was.  This post traces through my own installation process.

I was using Ubuntu 10.04 (Lucid Lynx).  I had just downloaded IrfanView 4.27, and thought I would try to install that latest & greatest version.  Also, unlike Tom's system, mine was not "a clean configuration directory, with no other applications or games installed."  According to Ubuntu's System > Administration > Synaptic Package Manager, I was using Wine 1.2.

My first hurdle was to figure out how to install MFC42.dll.  A WineHQ webpage said that I could get MFC42.dll from Microsoft or via winetricks.  They said I might already have gotten winetricks installed during my Wine installation, but they also said that I could run it even if it wasn't installed; I would just have had to type "sh winetricks" instead of just "winetricks" to run it.  I checked Synaptic.  Sure enough, there it was.  The purpose of winetricks seemed to be to add Windows-friendly support files so that Wine would run Windows programs.  That sounded about right.  The winetricks webpage listed MFC42.dll among the files that it was prepared to help me with.  I went ahead and typed "winetricks mfc42.dll."  That ran and appeared to change some settings.  I went into the wine subdirectory under my Ubuntu user folder:  File System/home/ray/.wine/drive_c/windows/system32.  Tyler Style had said that it needed to be there, but it wasn't.  Amusingly, he had posted that a few months earlier in response to my previous attempt, a year earlier, to get IrfanView running in Ubuntu.  Well, I thought, maybe MFC42.dll had known what it was doing when it installed itself; maybe Tyler was wrong as to the location where it would be found.  The other thing he said that I needed to do was to go into Applications > Wine > Configure Wine > Libraries tab and register MFC42.dll there.  I typed mfc42.dll into the "New override for library" box, at that location, and clicked Add.  It seemed to accept it:  it listed "mfc42 (native, builtin) as an Existing override.  I clicked Apply > OK.

This was fine, for whatever it was worth, but it didn't add IrfanView to my program menu.  To install IrfanView, I had gathered somewhere that I needed to type "wine iview427_setup.exe" to install IrfanView.  I tried that.  It replied with this:

wine: cannot find L"C:\\windows\system32\\iview427_setup.exe"
That raised two questions, which may be summarized as "why not?" and "so what?"  I didn't know why the error message had put that L in front of the C, but whatever; I had since discovered that, in Windows, IrfanView would install as a standalone program, and had therefore moved it to a different partition where I kept all of my Windows standalones (so that I wouldn't have to reinstall them whenever I had to reinstall Windows, but could instead just copy the whole folder to drive D (or whatever) on the new computer.  In other words, I wondered whether I could skip the installation; I wondered whether Wine could run portable or standalone programs.  According to MoebusNet, it could, and one way to make it do that was to download and install PortableApps to the USB drive where you were going to keep your portable programs.  In my case, I wasn't going to keep them on a USB drive; I was going to keep them in a folder on my hard drive.  I wasn't sure how that would work, but I gave it a try.  I downloaded and ran the little 2MB PortableApps Platform.  They said it was self-contained -- PortableApps was, itself, portable -- so I wondered if I could install it on the folder on my hard drive where I kept my other portable programs.  After a brief search, I decided the best way to find out was just to try it.  So when it came time, in the installation process, to choose the install location for PortableApps, I named that folder as the destination.  When the installation finished, in Windows Explorer I copied my IrfanView portable folder to the PortableApps folder.  (I kept a copy in the original location so that it would be available outside of Portable Apps as well.  I thought I would probably prefer to run it that way from my WinXP boot.)  I deleted iv_uninstall.exe from this copy, since I didn't want the uninstaller to show up in PortableApps.  I created a shortcut to PortableAppsPlatform.exe and put that in my Start Menu.  I started up PortableAppsPlatform and, following instructions, clicked on its Options > Refresh App Icons.  I clicked on the IrfanView icon and, sure enough, IrfanView started up.

So now that I had acquired this lovely knowledge about PortableApps, it was time to get back to what MoebusNet had started telling me, about running portable apps in Ubuntu via Wine.  I typed this:
wine "/media/DATA/Standalones/PortableApps/PortableApps.com/PortableAppsPlatform.exe"
and that worked:  IrfanView started up.  So the concept seemed to be that any portable app that I would put into a folder on the same level as the PortableApps.com folder would show up when I ran that command.  So I could make a single PortableApps menu pick for Ubuntu, and it would lead, via PortableApps, to any portable application program that I would set up that way.  I set up a launcher for that wine command by highlighting, right-clicking, and copying it into the Ubuntu Applications menu:  right-click on Applications and choose Edit Menus > Applications > Accessories > New Item.  Name it PortableApps, paste the copied command into the Command box, and Comment it as "Launch portable Windows applications."

This was all wonderful.  But when I tried to play a .wav file in IrfanView, I was still getting the same error message from the previous year, the one that Tyler Style had tried to help me with.  The message read as follows:
IrfanView
Error:  Windows can't play this file!
Windows error text:  Invalid MCI device ID.  Use the ID returned when opening the MCI device..
You can try to install additional video/audio codecs from this site:
http://www.fourcc.org/indexcod.htm
or try the DirectShow option in 'Properties->Video'
The fourcc.org/indexcod.htm webpage seemed to offer video but not audio codecs.  Some Ubuntu documentation pointed me toward the Ubuntu restricted extras repository.  I thought I had already set myself up for everything I could get from there, but the documentation was saying, "Installation only works completely and properly when done from the command-line Terminal. The entire package will not usually install completely from within a Package Manager."  So possibly Synaptic had not brought me all of the codecs I needed.  I killed IngrfanView and then, obeying the documentation, I typed this:
sudo apt-get install ubuntu-restricted-extras
but it said I already had the newest version.  I could have tried completely removing and reinstalling ubuntu-restricted-extras, but that sounded like it could lead to other difficulties.  Besides, another post made it sound like the codecs might actually be in Medibuntu, which I had also installed.

There were two other things to think about.  One was that I might just try a different audio player.  I posted a question on that.  The other was that I maybe I should take a shot at that actual error message.  What did "Invalid MCI device ID" mean?  Turns out I had posted a bug report on it the previous year.  I posted an update to that bug report.

Meanwhile, in response to the question about an alternative audio player, I got a suggestion to try an older version of IrfanView (namely, 3.98), or to try mpg123 if my reason for wanting IrfanView was to enable skipping to the next file in a folder with just one keystroke.  IrfanView 3.98 dated from 2005, so I would be missing out on some newer functionality.  It didn't seem to be available on the official IrfanView site, but I found numerous other locations for it.  It was a bit harder to find the plugins for version 3.98, but eventually I did.  I installed 3.98 and its plugins on a Windows XP machine and then moved the installed folder over to the Ubuntu machine.  I deleted the previous IrfanView folder from the PortableApps folder, and put this new IrfanView 3.98 folder into PortableApps in its place.  (This time, I didn't keep a copy outside of PortableApps, since I didn't plan to run 3.98 in WinXP.)  Once again, I deleted the Uninstall.exe file from this IrfanView 3.98 folder.  I went to Ubuntu's Applications > Accessories > PortableApps > Options > Refresh and then clicked on IrfanView.  It opened up.  I went to Help > About.  Sure enough, I was now running version 3.98.  To test it, I hit Print Screen.  This opened Ubuntu's Save Screenshot dialog.  I clicked Copy to Clipboard, moused to IrfanView, and hit Ctrl-V.  Sure enough, I had the screenshot in IrfanView.  I tried cropping it (left mouse click / drag / release, Ctrl-Y), set View > Display Options > Fit Images to Window, and, sure enough, IrfanView was functioning normally.  Cool!

To try IrfanView's audio functioning, I navigated to a folder containing several .wav files, double-clicked on the first one, and it played -- in Ubuntu's Totem Movie Player.  Oops.  I right-clicked on the .wav, but Ubuntu wasn't listed as a possibility for the program to play it in.  I went back to PortableApps and started IrfanView again.  I went into its Options > Properties -- but, of course, I had already set those.  So, a problem:  could I get Ubuntu to treat IrfanView as the default viewer or player for a filetype?  My first search didn't turn up much.  PortableApps had a live support chat, but no joy for me there, so I posted a question on it in a PortableApps forum.  Then, resuming my tinkering, I right-clicked on the .wav again and chose Open With > Other Application > Wine Windows Program Loader, but that gave me "Error:  There is no Windows program configured to open this type of file."  Well, I had definitely configured IrfanView to do so, but maybe Wine didn't agree.  I tried a search for that error message, and followed one particularly painful thread from that search.  Somewhere along the way, I got the idea to try Ubuntu's Applications > Wine > Configure Wine > Applications.  With Windows XP as the version of Windows specified at the bottom of the dialog, I clicked on Add Application and navigated to the folder where I had put PortableApps; and in there, I navigated to the IrfanView folder, selected i_view32.exe, and clicked Open > OK.  Now I went back to the original Ubuntu right-click on the .wav, selected Open With > Wine Windows Program Loader . . . and still got the same "no Windows program configured" error.

I had forgotten the option of installing IrfanView as an Ubuntu application via Wine.  Following my steps from a year earlier, I navigated to the IrfanView 3.98 folder and typed "wine i_view32.exe."  But no, that wasn't right; that just ran the portable version.  That command-line approach wasn't necessary anyway; I discovered that I must already somehow have set up Wine to run .exe files automatically, apparently following advice like that provided by a relevant Community Documentation page.  All a bit puzzling.  I continued playing and posting on it, trying to dig my way out.

Meanwhile, I experimented with mpg123.  Some time had passed, and I couldn't remember if I had already installed it, so I just typed "mpg123" at the Ubuntu command line.  This gave me an odd error message:
The program 'mpg123' is currently not installed.  You can install it by typing:  sudo apt-get install mpg321.
What was odd was that the installation line said mpg321, not mpg123.  I checked Synaptic.  It confirmed that I didn't have mpg123 installed yet, and it also showed me a program called mpg321 on the next line.  The description of the latter characterized it as an "mpg123 clone that doesn't use floating point."  Apparently someone at mpg123 decided that mpg321 was a superior alternative, and thus gave me that command line suggestion to use mpg321 instead.  Just to be sure, I did a search and got the impression that mpg123 began as nonfree software, so mpg321 was prepared as a free alternative and it just became more popular.  I installed both of them in Synaptic, but after playing around with them for a half-hour or more, I was still not getting playlists to work properly.

I found a page listing top Linux music players.  I looked at the webpages for several on that list, but none of the six or eight pages I looked at provided a simple explanation of how the players actually worked -- of whether, to cite an example, you could hit the 6 key on the numeric console at the right end of a standard keyboard to move on to the next file, as you could do in Winamp.  From that list, in the name of trying something rather than nothing, I installed Audacious.  It was a nice enough player, but it did not have the ability to delete a file that I was listening to, as IrfanView did.  It was also not as responsive:  IrfanView would stop immediately when I told it to, so that I could mark a file for resorting or other handling; Audacious would continue on for maybe a second or so, which is not much except when it results in the program's moving on to the next file, which was not the one that I wanted to delete, re-listen to, or otherwise handle.  I decided, once again, that what I wanted was undeniably IrfanView, until further notice.

By this time, Ringi had replied to my latest post in that thread.  It seemed that s/he was doing just fine with the latest version of IrfanView in Ubuntu.  Since there seemed to be no need for 3.98 after all, I deleted the IrfanView 3.98 folder from PortableApps and replaced it (again, without the uninstall.exe) with a copy of 4.27.  Ringi asked whether I had installed IrfanView's plugins, and that was a good question; I was not sure.  Actually, by now I wasn't even sure I had actually installed IrfanView via Wine; it wasn't appearing in Applications > Wine > Programs.  Returning to my notes at the start of this post, I decided that the PortableApps thing was a dead end, at least for purposes of getting IrfanView to run the way I wanted.

I went back, specifically, to the advice (above) that I needed to type "wine iview427_setup.exe" to install IrfanView.  In Terminal, I navigated to the original setup folder (i.e., not the unpacked, ready-to-run standalone folder) where I had stored iview427_setup.exe and irfanview_plugins_427_setup.exe.  I typed that  Wine command:  "wine iview427_setup.exe."  It said, "err:module:import_dll Library MFC42.DLL (which is needed by L"D:[path]\iview427_setup.exe") not found."  So, OK.  I had not correctly installed MFC42.DLL after all.  Following the Winetricks instructions, I typed "sh winetricks mfc42.dll."  I got an error:  "Can't open winetricks."  I verified, in Synaptic, that I did have cabextract installed.  Synaptic also confirmed that I had winetricks installed.  Nonetheless, following those instructions, I typed "wget http://www.kegel.com/wine/winetricks."  It ran.  I tried "sh winetricks mfc42.dll" again.  This time, it said, "Unknown arg mfc42.dll," followed by a list of the packages that it did have.  Oops:  just plain mfc42, not mfc42.dll.  I retried:  "sh winetricks mfc42."  It ran without error.  So, interesting:  it seemed that Synaptic (or whatever approach I had used previously) had not done the job of installing winetricks properly.  Now I got a dialog for "VCRedist Installation."  I okayed through that; something ran in Terminal; and it concluded with this statement:  "Install of mfc42 done.  Winetricks done."  Cool.  I had finished the mfc42 part.  Now back, once more, to "wine iview427_setup.exe."  This gave me the IrfanView Setup dialog.  I set it to install for all users in C:\Program Files\IrfanView\.  It completed, and IrfanView was up and running.  I killed it and typed "wine irfanview_plugins_427_setup.exe."  That ran OK, and now I had an IrfanView entry in Applications > Wine > Programs.  I started IrfanView and set its options, including naming it as the default handler for all audio files.

So IrfanView now seemed properly set up for sure.  In IrfanView, I did a File > Open.  It was listing only image files, but I changed it to show all files, and then tried to play one of the .wav files in that folder.  It gave me the "Error:  Windows can't play this file!" message again, same as before.  I killed IrfanView, double-clicked on a .wav file in Nautilus, and the file played -- in Totem!  It certainly appeared that I had installed IrfanView correctly -- at least once, if not multiple times -- and yet it was still not functioning properly for me in Ubuntu.  I returned to a Wine bug report that I had started to file a year earlier.  I didn't know how to file bug reports, but I gave it a whirl.  The concept seemed to be that you get a debug trace on the uncooperative program.  In this case, that seemed to call for going to the folder where I had installed portable IrfanView and running the following command:

WINEDEBUG=+relay,+seh,+tid wine i_view32.exe &> /tmp/output.txt

That opened IrfanView and waited while I repeated the steps I had taken:  open a .wav file, get a repeated error message, etc.  When I closed IrfanView, the output file was there.  But when I looked in it, it only contained repeated instances of this message:  "fixme:mciwave:MCIWAVE_DriverProc Unsupported yet command [2115]."  That last number changed, in each of the six repetitions of that message:  2115, 2114, 2132, 2114, 2132, 2132.  Maybe that was all it was supposed to say.  Whatever.  I attached the output.txt file to the bug report and sent it off.  Meanwhile, I posted a link to this note in the discussion thread, in case Ringi or someone else felt like reviewing it and possibly detecting what I had done wrong.

Wednesday, July 29, 2009

Other Virtualization Solutions to Play Audio in Ubuntu 9.04

I was running 64-bit Ubuntu 9.04 (Jaunty Jackalope). I wanted to use IrfanView to listen to .wav files. I had been using it in a VMware Workstation 6.5.2 virtual machine (VM) running Windows XP, but I had lately been having a problem with stuttering audio playback, and my efforts to fix it had failed so far. It was possible that I had not correctly applied all of the suggestions I had encountered, so one option was to go back and review the recommended steps, perhaps by spending a few weeks working through the Comprehensive Video & Multimedia Howto. Since there seemed to be users whose problems persisted after trying those suggestions, however, I thought perhaps I should try out some alternatives. I posted a question about the VMware problem and left it at that for the time being, reserving the option of trying the supposedly surefire solution of installing a second sound card.

One alternative was to try running IrfanView directly on Ubuntu, with the assistance of Wine. I had made some progress on that, but that, too, was still pending resolution of a posted question. Another possibility I had overlooked was to use VMware Player instead of VMware Workstation. Player (a free download) had been installed when I had installed Workstation, and was now available to me in Ubuntu at System Tools > VMware Player. I opened a VM that I had powered down (i.e., that was not merely suspended) in Workstation. I hadn't really used Player before. I was pleased to see that it seemed to run VMs a little faster and simpler than Workstation.
I tried playing audio in VMware Player. To my surprise, both IrfanView and Windows Media Player played .wav audio files just fine, with no stuttering! I had shut down the machine the previous evening and powered it back up again that morning, so I wondered whether the cold restart had made a difference. I started up Workstation, resumed a previously paused VM, and tried playing .wav files in there. Those, too, played fine. Apparently the restart had indeed temporarily fixed the problem - might, indeed, have been the reason why the other solutions I had tried had seemed to work. I had rebooted the system previously, but it now seemed that I simply hadn't left it turned off long enough.
Since the problem seemed to be fixed, I abandoned (at least for the time being) the other possibilities that I had begun to explore. In case I (or someone else) needed them, however, that list of possibilities included the following:
  • Perhaps I could successfully run IrfanView inside a virtual appliance. These would seemingly be subject to the same VMware Workstation problems, but perhaps not, somehow. I searched the VMware Virtual Appliances webpage for IrfanView but, not surprisingly, found nothing. My Google Search for WinXP applications in the VMware catalog didn't seem to turn up anything special, but a search for "Windows 7" indicated that, for $10, I could download something called the Bagvapp RC Windows 7 beta. They said this thing also came with additional software installed. (Microsoft provided additional information on this free (possibly bug-filled) Release Candidate.) For ten bucks, of course, it made huge good sense to just buy the pre-installed VM from Bagvapp; but since I didn't really need it, I contented myself with signing up for Bagvapp's RSS feed. (Most of their stuff was free, but they said they were swamped with orders for the RC and had to pay for a ton of bandwidth.) There also seemed to be other free Windows 7 beta virtual appliances, such as one from Tuxdistro, although not all appeared to be as fully tricked-out as the one from Bagvapp. The Win7 RC, in any case, was said to be valid for another eight months, until March 2010.
  • In March 2009, Jonathan DiPrizio discussed four virtualization options in Linux. Those four were Qemu, Parallels, VMware, and VirtualBox. DiPrizio found VMware and VirtualBox to be the clear winners among these four, and actually preferred the latter. So I would have the option of trying to run IrfanView in VirtualBox, if the VMware problems continued.
  • I had also located Wikipedia articles on application virtualization and platform virtualization. These led to consideration of other possibilities, such as Microsoft Virtual PC and DosBox.

Tuesday, July 28, 2009

Installing and Using IrfanView for Audio in Ubuntu 9.04

I have an Olympus VN-960PC digital voice recorder (DVR). It saves its recordings in compressed .wav format files. When I listen to those recordings, I usually use IrfanView to listen to them. I have been using IrfanView for years, and have found it to be markedly more useful and flexible than any other program for many image editing, audio listening, file viewing, and other multimedia tasks. It is really amazing freeware.

I use IrfanView for this particular task because I have not yet found another program that allows me to move from one recording to the next so quickly. I listen to the notes I have saved on the DVR; I highlight some of them, one by one, in Windows Explorer, and then I cut and paste the selected recordings to subfolders for further use. I have developed the habit of beginning many of my recordings with a single word (e.g., "Monday" or "shopping"), so I know right away which folder it goes into. Sorting a number of audio recordings this way is very fast.
IrfanView was a Windows-only program. I could not find anything in the Linux world that could replace it, for my purposes, so I looked for ways to run it in Ubuntu. One possibility, which I used for a long time, was to run it in a virtual machine in VMware Workstation (or perhaps I could have used a freeware virtualization program) on Ubuntu. I was engaged in a long-term effort to move away from dependence on Windows, though, and sometimes virtual machines could be somewhat clunky.
Finally, at one point I reached a situation where I invested a bunch of time and still could not resolve a VMware audio problem. This seemed to be the opportunity to try running IrfanView, a Windows program, in Ubuntu. I planned to do so via Wine, which (in that wacky Linux way) is short for "Wine is not an emulator." The stable release of Wine at this point was 1.0.1, and that is the version that was available in Ubuntu's (System > Administration > ) Synaptic Package Manager. I searched for wine in Synaptic, marked it, and clicked Apply. It downloaded and installed the necessary stuff. Next, following the steps I had researched when I had tried Wine a year earlier, I proceeded as follows, typing these commands into Ubuntu's (Applications > Accessories > ) Terminal at the command prompt:
wget http://www.kegel.com/wine/winetricks
sh winetricks mfc42
Then, in Ubuntu's File Browser (Places > Computer), I navigated to the folder where I had saved the downloaded IrfanView program. This program was called iview425_setup.exe. I copied the Location of this folder from the address bar at the top of File Browser and put it, between quotation marks, after a cd command in Terminal, as follows:
cd "/media/CURRENT/Miscellany/Installation/Programs"
and then I typed the Wine command to install IrfanView:
wine iview425_setup.exe
This gave me the regular IrfanView Setup dialog, just as if I had been installing it in Windows. I told it to install a link on the desktop, and it did; but I could not get that link to run. So I used cd again, to get to where it had been installed (cd "/home/ray/.wine/drive_c/Program Files/Irfanview", where "ray" was my username), and typed wine iv_uninstall.exe. This removed everything except iv_uninstall.exe itself from that folder; I deleted that last file manually.
I decided to try an older, simpler version of IrfanView. I went to OldApps.com and downloaded IrfanView 3.0. Then, as above, I used cd to navigate to the place where the downloaded file was. In this case, the program (after extraction from the downloaded .zip file) was named i_view32.exe, so I used that instead of iview425_setup.exe in the installation command presented above, as follows:
wine i_view32.exe
Unfortunately, this installer did not run at all. About this time, I rediscovered Wine's reports on the various efforts people made to run different Windows programs under Wine. In particular, I found the reports on IrfanView. These, supplemented with the instructions and replies posted at Wine-Reviews.net, seemed to indicate that what I really needed was to use relatively recent versions of both Wine and IrfanView.
To get a version of Wine more recent than the one that was available in Synaptic (above), I had to modify Synaptic. That is, I had been using Synaptic out of the box, the way it came in the original Ubuntu installation; but Synaptic could be configured to look in additional places for more software. In this case, I wanted it to look in the WineHQ repository. So I went back into Synaptic and clicked on Settings > Repositories > Third-Party Software > Add. In the APT line box, following the WineHQ instructions for Ubuntu 9.04, I typed this:
deb http://wine.budgetdedicated.com/apt jaunty main #WineHQ
Then I clicked on Add Source. Next, while still there in Software Sources, I went to the Authentication tab and clicked on Import Key File. I didn't have the key file yet, so I had to go to the webpage that they call Scott Ritchie's Key to get it. I saved that page (in Firefox, the command is File > Save Page As). Its default name was Scott Ritchie.gpg, so I accepted that. So now, back in the Software Sources > Authentication > Import Key File window, I navigated to where I had saved Scott Richie.gpg and selected it. Then I clicked on Close > Close. Now, back in Synaptic, I clicked Reload. I could have done a Quick Search, there in Synaptic, to see that Wine now needed to be updated; but I decided instead to update everything on my system that might need to be updated at that point. So I closed Synaptic and went to System > Administration > Update Manager and installed everything it had for me.
Normally, it can be more convenient and/or easier to remember one's way around by using the Graphical User Interface (GUI), as just described. In this case, though, for some reason the whole thing about Scott Ritchie was a little weird and hard to remember (though not Scott Richie himself, oh, no, we'll never forget ol' Scott), and I would probably have found it simpler just to copy and paste these lines into Terminal from the bottom of the WineHQ instructions page:
wget -q http://wine.budgetdedicated.com/apt/387EE263.gpg -O- | sudo apt-key add -
sudo wget http://wine.budgetdedicated.com/apt/sources.list.d/jaunty.list -O /etc/apt/sources.list.d/winehq.list
sudo apt-get update
sudo apt-get install wine
but whatever. It was done, and I had my other updates to boot. Plus, I got a free opportunity to screw around with Synaptic. (Later, I discovered that I should have uninstalled the older version of Wine first. I also discovered that apparently I should have been doing my work in a folder dedicated to Irfanview.) Now, at any rate, I had some more recent version of Wine installed. To see which one, I went back into Synaptic and searched for Wine again. It was 1.1.26. This was more bleeding-edge than the 1.1.14 that they had used in that Wine-Reviews article. I wasn't sure how to get back to 1.1.14, though, and anyway that was a half-year earlier, and they were using Ubuntu 8.04, so maybe this was better for my purposes. The Wine-HQ report indicated that Sven Plaga had just recently used 1.1.25 with great success. The version of IrfanView that Sven had used was apparently 4.25. He had used it with a beta release of Ubuntu 9.10, which I wasn't up to yet; but if it worked now, I figured that might defer whatever updating I might otherwise have to do later.
So now I tried again to install IrfanView on this newer version of Wine. I had already done the whole winetricks and mfc42.dll routine (above), so this simplified the process for me. Following the Wine-Reviews and Wine-HQ instructions and comments (with some help from some older Ubuntu Community Documentation), I repeated the foregoing steps of navigating to the folder where I had stored iview425_setup.exe, and then I typed this:
wine iview425_setup.exe
The installer ran, but again I couldn't get IrfanView to start. This time, though, it was not surprising. According to the instructions, I next needed to go into the installation directory (in my case, /home/ray/.wine/drive_c/Program Files/IrfanView) and delete the i_view32.ini file. The comments indicated that IrfanView would replace it with a simpler i_view32.ini that would cause no problems. I had forgotten to download and install the IrfanView plugins, so I did that now:
wine irfanview_plugins_425_setup.exe
Now I had an embarrassment of riches, in terms of IrfanView launchers. There were three different Ubuntu icons on my desktop, and they all worked. I deleted the two that didn't have the Ubuntu red cat (or whatever that is) on them. I also saw that Wine had installed itself as an option under Applications on the Ubuntu menu, and under Wine > Programs I had an IrfanView menu plus an apparent freebie, a link to an actual working copy of Notepad.
The key question, now, was whether IrfanView would now function in Ubuntu as it had functioned in Windows, for purposes of listening to and moving through .wav files. I went into IrfanView's Options > Properties and adjusted the settings to my preference. Then I double-clicked on an audio file . . . and watched it open in Totem Movie Player. OK, so this was my opportunity to learn how to set the default application program in Ubuntu. I started to Google for some guidance, and then I realized this was probably somewhere under System > Preferences - and, sure enough, there it was: Preferred Applications. I went to Multimedia and indicated that I wanted to use a Custom multimedia player. I right-clicked on the IrfanView desktop icon and went into its Properties > Basic tab. I copied its Command line to Terminal, to try it out. It worked: IrfanView started. So then I copied that same command line into the Multimedia command box. But either way, with or without the "Run in terminal" box checked, it didn't default to IrfanView; I was still getting Totem. So yes, I had to Google the question after all. The answer was easy enough (apparently a lot easier than it had been a year earlier): right-click on a .wav file and select Properties > Open With > IrfanView > Close.
Ah, but now, when I double-clicked on a .wav file, I got an error message:
Error: Windows can't play this file! Windows error text: Invalid MCI device ID. Use the ID returned when opening the MCI device.. You can try to install additional video/audio codecs from this site: http://www.fourcc.org/indexcod.htm or try the DirectShow option in Properties->Video.
Weird thing: I got that same error message three or four times in a row. I'd click OK, and there it would be again. And then, when it stopped, I got a little "No Device" window and the audio file played after all. But then that No Device window wouldn't go away; I had to kill IrfanView to banish it. I went into IrfanView's Properties and tried clicking the DirectShow option as advised. Same result. Seeking truth, I went back to Google. And I could tell that I was at last getting close to the truth indeed, because this time my search turned up only a small number of results, none of which seemed relevant. Fortunately, I was able to revise my search into something even less helpful. As the day drew to a close, I posted a question on this at Wine-HQ. Someone there suggested that I should post it as a bug in Wine, so I did that. I didn't know how long it would take them to address and resolve this bug, if that's what it was, so I decided it was time to post this message as-is and think about other ways of getting Irfanview to work.

Tuesday, September 30, 2008

Ubuntu and VMware: Summary for Now

This is the final entry in a series of long posts on my effort to make the transition from Windows to Linux. I had gotten to a point with Windows XP where I was able to get a lot of things done, but (a) I was having to reinstall the operating system, and otherwise spend a lot of time fooling around with maintenance stuff, and (b) what I was hearing about Windows Vista as an alternative to XP was not encouraging. So I decided to make the switch to Linux. I chose the Ubuntu flavor. The version I installed was Ubuntu 8.04, also known as Hardy Heron. My initial strategy was to replace Windows programs with Linux programs wherever possible. But after a certain point, I found myself mostly just trying to find some way to continue to use my Windows programs. That is, there were probably some viable Ubuntu alternatives that I did not discover or explore. There were several reasons for that. First, I typically knew what I wanted to do, and I knew how to do it in Windows and didn't know how to do it in Ubuntu. There were some cases where that was not true -- where the Ubuntu alternative was just as good as, or better than, the Windows program for my purpose. One example was OpenOffice Calc, which for casual spreadsheeting seemed pretty much interchangeable with Microsoft Excel. Another example was Ubuntu's Nautilus file manager program, which for some purposes (e.g., obtaining properties of a partition, copying or deleting large numbers of files) performed more reliably than Windows Explorer. Of course, having Ubuntu as the underlying layer was generally preferable to having Windows as my foundation: it so rarely crashed, it shut down and started up faster, its Hibernation feature worked faster and more reliably (so that I could quickly resume, the next day, where I had left off the night before), its program installation and update features were smoother and less disruptive, and so forth. It was also nice to have a familiar, alternative way to get to my files and get work done, at those times when Windows decided to be uncooperative (and of course it was very handy to be able to jump files over to the other computer, or do browsing on the other computer, if I had to reboot or reformat or do other maintenance on one computer). So I was able to make substantial changes in my former way of doing things -- was able, that is, to transition a considerable number of activities to Ubuntu Linux programs. But there were also quite a few tasks for which that wasn't possible, and for those programs I still needed to run the more familiar Windows programs. A second reason why I did not fully explore Ubuntu alternatives was that they required time, interest, and/or expertise that I did not have. I probably could have done more with Wine, for example; there were probably Windows programs that I could have run directly in Ubuntu if I had learned more about Wine and had mastered the possibilities that it, or other programs like it, might offer for my preferred Windows applications. Another example, arising at the end of my effort, was rsync. I needed a reliable backup tool; people were saying that rsync was the one for me; but I no longer had the time or interest to investigate it in enough depth to master its usage. Backup was important to me, and that might seem to imply that I should have been more motivated to master rsync; but my experience with backup is that, unless you know what you're doing, you can pretty much expect to have a nasty surprise at some point, when you discover that the program you thought was doing well really wasn't. So at this point I had to fall back to the inferior solution of doing manual copying of whole folders or partitions to some other location. Certainly this was something that I would want to explore and work out at some point, but I couldn't do it now, and for that reason Ubuntu wasn't really sufficient for me. Another reason for my failure to fully explore Ubuntu alternatives to Windows programs was experience. After trying with a number of programs, my default assumption increasingly tended to be that the Ubuntu alternatives would lack features that I would need. Again, I knew what I wanted to do, and I knew how to do it in Windows, and it was discouraging to invest time in an Ubuntu alternative that ultimately proved unable to do what I wanted. My sense, in this regard, was that maybe a subsequent version of Ubuntu would come closer to providing solutions for these kinds of tasks. A final reason for my failure to fully explore Ubuntu alternatives was that there seemed to be some things that would just have to be done in Windows. There were, at this time, no Linux drivers for my multifunction scanner/copier/printer/fax machine. Unless I wanted to spend a chunk of money and time to shop for and buy a replacement that would work out as well as this one had done, it just made more sense to retain my dual-boot version on my secondary computer and use that as my primary avenue for printing and scanning. That wouldn't have worked so well if I hadn't been free to reboot the secondary computer into Windows pretty much whenever I wanted, or if I'd had a large volume of scanning and printing to do. For my purposes, this approach was good enough. Likewise with my USB devices: most of them (particularly my digital voice recorder and PDA) were not recognized by Ubuntu, which meant I couldn't back them up or transfer data from them to the computer unless I booted into Windows first. VMware for Linux made it much easier to take care of non-hardware Windows needs. That is, WinXP running in a VMware Workstation virtual machine would still not recognize my printer or those other USB devices; but it would run Microsoft Word, Adobe Acrobat, and other Windows-based programs that I needed. So for Windows hardware purposes, I would reboot the secondary computer; and for Windows software purposes, I would run the programs in a VMware VM on Ubuntu. That still did not work for Adobe Premiere Elements -- on my machine, the VMs were just too slow for video editing, and therefore I had to do that work in a native WinXP boot -- but it worked just fine for most other stuff. So what I had, at this point, was a two-computer setup. Using a keyboard-video-mouse (KVM) switch, I was able to tell my keyboard and mouse to work on the primary computer or, by tapping the ScrollLock key twice, I could instead tell it to turn to the secondary computer. (For this and other items discussed in this post, search my blog for the term that interests you. In most cases, you'll probably find a more detailed description.) Using another KVM switch, I was able to punch a button and tell the secondary monitor whether to show part of what was happening on the primary computer (in, that is, a multiple-monitor arrangement, in tandem with my primary monitor) or, instead, to show everything that was happening on the secondary computer. Both of these computers were dual-boot WinXP and Hardy Heron setups. On both, I mostly used Ubuntu to run Firefox 2.0.0.16 for my web browsing. (FF 3 was not working well when I tried it, during this process.) On the primary computer, I used VMware to run nine different virtual machines. Most of them were allocated 1GB of RAM (two were just 512MB) and 15GB of disk space (the smaller ones got just 10GB). I had enough RAM to run four or more of them at once, but almost never did, because the hard drive would just be running constantly, trying to keep up -- and anyway, it was more efficient for me to reduce my focus to just a few projects until I reached a point in my work where I would want to suspend one and resume another. I created those machines in the first place by using VMware Converter to convert my nearly perfect basic Windows XP native installation (hint: don't enable or perform updates) into a working virtual machine, which I then enhanced with updates etc. from within the safety (I hoped) of a virtual machine running on Linux behind a Linux-based router firewall. I hoped, later, to try using VMware Player to run one or more of those virtual machines on the secondary computer, but I hadn't really needed to do that so far. The numerous posts in this series, going back over the past two or three months, mention many problems that I was not able to work through completely, or for which there did not then seem to be a solution. As I become more familiar with Ubuntu, and as new versions come out this fall and next spring, I expect that some of these problems will disappear. I will also probably keep working away at some of these problems on an occasional basis, though I don't know whether I will blog the steps I take to work through them. For my own future reference (and for any other diligent soul who may have been slogging through all this with me), one of the issues that I have yet to resolve is VPN. I need to use VPN to access some websites, and so far I have not been able to make it work in Ubuntu. (Again, a previous post in this blog provides further details.) There were some other problems and needs that I had touched upon previously. Google Desktop did not seem to be working in Ubuntu. I had not yet started trying to figure out how to network these two computers within Ubuntu. The clock within WinXP running in VMware ran at its own hyper pace, maybe twice as fast as reality. I had yet to return to the dual monitor issue, now that I had ordered and installed a video card that seemed more compatible with Ubuntu. I hoped to replace Microsoft Outlook with Evolution on Ubuntu, and I hoped to play around with some VMware appliances (available through their website) and see whether they had anything to offer me. It seemed advisable to figure out a RAID arrangement for the drive that was running VMware Workstation, because hard disk startup and shutdown activity could take a half-hour, an hour, or even more, depending on how many virtual machines I tried to start up at once, and the machine would be virtually unavailable during that time. There were probably quite a few others that I was not able to remember at this particular moment. Suffice it to say that I had spent years becoming familiar with the oddities and workarounds in WinXP, and I expected the same would be true in Linux. The advantage of doing it here was that I was learning things that tended to be on the command-line level; and while that was harder and riskier in some regards, it seemed likely to be much more durable knowledge. Having spent decades using my DOS knowledge acquired in the early 1980s, I felt that this was a good investment of time. Unlike the case when a person had to learn how to switch from one version of Windows to another, I expected my learning in Debian Linux (on which Ubuntu was based) to continue to be useful for years to come. So my present plan, as of the end of September 2008, was to keep fiddling with Ubuntu as time permitted, but not to revisit the matter in a major way until summer 2009, by which time there would hopefully have been quite a few more steps forward in Ubuntu, VMware, Wine, and other programs.