AAC file re-visit


In my previous post, I mentioned about AAC and the ID3 tag. And I mentoined that

I have an AAC audio file (technically M4A) […]

I used Audacious previously, then change to DeadBeef. The main reason I changed was because I kept failing to play AAC audio file. What’s wrong? FFplay can play it, SMPlayer can play it, DeadBeef can play it, Clementine can play it, but Audacious cannot. Audacious has a AAC plugin, it should support AAC format.

But if I play the AAC file with Audacious, I will get this error,

Unknown playback error (check the console for detailed error information)
ERROR aac.cc:373 [play]: No valid frame header found.

Seach online and found that, it is the file extension issue. So, what is it?

Using the “exiftool”, I found that the MIME Type is video/mp4. That is the fix!!

I renamed the AAC file to Mp4. Now Audacious can play the file well.

Now, when it was in the AAC extension, in order to view the audio metadata such as author, title, ablum, I used Kid3 to edit the APE instead of ID3v2, so that FFplay can play it. ID3v2 is actually for the MP3 format. If use ID3v2 on the AAC extension audio file, FFmpeg cannot convert it and FFplay and SMPlayer both failed to play the audio file properly.

But after I rename the file into MP4, there is an issue. MP4 metadata (I think it is also ID3v2) cannot be written using Kid3, due to the existence of APE tag. (Kid3 doesn’t mention anything about this, I solve this heuristically.)

  1. So, I need to remove the APE tag using Kid3 by naming the file as AAC first.
  2. Then, I rename it to MP4 and use Kid3 to edit the ID3v2

As a conclusion, I use back Audacious as my primary audio player. It is the best!

(Why not DeadBeef? DeadBeef lack of the feature to copy-paste the songs from one playlist to another.)

AAC audio file and ID3 tag


I just found that, if I have an AAC audio file (technically M4A), and if I added the ID3 tag 2 (aka ID3v2), then the audio file will failed to be converted by ffmpeg.

It can be either converted to mp3

  • using DeadBeef audio player, or
  • remove the ID3v2 tag then convert

So, how to add the metadata like ID3 tag? Use the Kid3 and add the Tag 3 (aka APE tag). This will not affect how ffmpeg to read the file.

Bye-bye Xiaomi Mi 3


Prelude

Last weekend was a long story, that I my Xiaomi Mi 3 is screwed! It happened like this.

I was in the car, using the phone to surf net and go through the social networks. Then suddenly, it popped up a notification saying that my phone is too hot, asked me to cool down, with a system button “Cool Down”. I cannot guarantee that this is not a virus, but I believe that my phone doesn’t have virus. (I can hardly find the Cool Down feature online, this is the only one.) So, I pressed the Cool Down button. With this press, sorry my phone. You got a stroke, and never overcome. Bye-bye!

Recovering

Because of that one press, my phone fell into the bootloop. When I went home, I searched for some possible solutions online. And found that, the possible solution is to flash the stock ROM. I downloaded everything I needed. Moreover, the most important thing is to get all my data especially photos, which I didn’t make any backup recently.

So, I followed the steps in this wonderful page for how to perform a flash. WARNING: This will flash everything, meaning, you will loss your data, including everything in the internal storage, such as photos. So, before I flash the stock ROM, I followed this forum to learn how to restore the data.

Summary:

  1. Get all the necessary drivers and software. Actually can be found in the official site. Important software are: MiFlash. It also requires drivers which can be found here. So that you can use “fastboot” command (and also “adb” command) and detect the phone when USB connected.
  2. Get the stock ROM and recovery ROM. I used TWRP.
  3. Boot into fastboot mode (read the instruction from the “wonderful page” mentioned above).
  4. Use command-line “fastboot” to flash the recovery ROM TWRP. And boot into the recovery mode.
  5. Once successfully boot, your computer can detect the phone (as MTP), then you can access the internal storage and copy all the files.

The luckiness within the unluckiness (不幸中的大幸), I managed to boot into recovery mode. Immediately copied everything from the phone to the computer. After this, I tried to flash the stock ROM. But failed. Tried various times, but none of them work. Even wanted to boot into the TWRP recovery mode was very difficult. But luckily, I got all the photos from the phone before these.

Searched for the solution again, I found this forum. Probably my battery got serious problem.

Yet, because my phone was bought through the mobile phone shop, not from Xiaomi official website. The phone is actually from Taiwan. And there is no nearest Xiaomi service centre at my area (and never will be). So, I can only say “bye-bye” to my phone. It is the time to “let it go”.

Epilogue

Most important thing is data. As long as you have the data, put it in any phone, then that is your phone. Just like your soul and spirit resides in any body, make it you yourself!

Linux no sound after boot into Windows


Just now was trying to boot into Windows, by plugged in the HDMI cable, which supports for video only. But then, I rebooted into Linux without plugged out the HDMI cable. Then, it caused no sound in Linux.

Try 1: I killed the pulseaudio, then delete the ~/.config/pulse, and rebooted Linux. Failed.

Try 2: Run alsamixer, turned on everything, and do Try 1 again. Failed.

Then I guessed it was caused by the HDMI cable, which the Windows may assume there is audio, then caused my computer somehow ouptut the audio through the HDMI, even I rebooted into Linux.

Try 3: Plugged out the HDMI, booted into Windows. I checked the audio in Windows. It plays well. Then rebooted into Linux without plugged in HDMI. Yeah! It works. Passed.

Next level

Then I found that, though the sound works fine, my headphones doesn’t work. Tried out many methods as I asked in forum.

At the end, it is solved by shutdown, and boot again.

MIUI 7 Google Calendar sync problem


Recently, I found that, the calendar item (agenda) created in MIUI 7 Calendar does not sync to my Google Calendar. Then I ignore it.

And until today, I found that, the agenda from Google Calendar does not sync to MIUI7 Calendar too. Then this will be serious. So, I search around the forum, and finally get this solution.

Install Google Calendar! This will solve the calendar syncing problem. Enjoy!

Xfce4 Power Manager, NVIDIA, Nouveau backlight issue


Recently I move back to use my (around) 4 years old laptop, HP Pavilion dv3. It has NVIDIA graphic card. But since I (re-)installed Arch Linux 64 bit on it, I failed to run the X11 with the proprietary NVIDIA driver. As a result, I used the Nouveau module instead. Then, I tried several times and finally successfully run the X11 with NVIDIA driver.

To use the Nouveau module, in the mkinitcpio.conf, we have to add in “nouveau” module, then build the initramfs (refer to wiki page). And use the “Xorg -configure” to generate the xorg.conf.

But in order to use the NVIDIA driver, firstly, has to identify the NVIDIA graphic card and download the related drivers. Secondly, since I am using 64 bit, but also running 32 bit packages, so I have to install all the corresponding lib32 NVIDIA packages. Moreover, the nvidia*-libgl are conflicted to mesa-libgl, which is used by Nouveau. After installing NVIDIA, use “nvidia-xconfig” to generate the xorg.conf.

We can also disable the splash screen (logo) when starting the X11, by adding

Options "NoLogo" "1"

in the “Device” section in the xorg.conf.

Then after using the NVIDIA, I face a serious problem, that is the xrandr (in fact I am usign ARandR) cannot change the screen resolution. This is troublesome as I need to make the changes towards the projector (2nd screen) frequently, such as two screens (left screen and right screen), laptop only (disable the projector), or clone (both laptop and the projector share the same screen). With the NVIDIA, xrandr cannot detect other resolutions, consequently I cannot make clone of the screen. So, I decided to use back Nouveau.

However, I have another serious problem with Nouveau module, that is, adjusting the backlight brightness (screen brightness). When I use xbacklight, it shows

No outputs have backlight property

I cannot adjust the backlight brightness using the usual keyboard key with Xfce4 Power Manager. Some forums stated that adding “acpi_backlight=xxxx” to the kernel parameter. But none of them works.

In my /sys/class/backlight, there are acpi_video0 and nv_backlight. Actually, I can change the backlight by echo the value to the acpi_video0/brightness, with “su”. Yet the nv_backlight does not show any effect.

I found that, I can use the keyboard key to adjust the brightness before start the Xfce4. Once the Xfce4 started (with Power Manager), the brightness change takes no effect. And the changes of the brightness is affecting the nv_backlight/brightness. So, I concluded that it is actually fixable by fixing the Xfce4 Power Manager.

As a result, I patched the Xfce4 Power Manager by editing the source code, to remove the “nv_backlight” from the priority. Install this patched package, restart the Xfce4, and now, it works!

MIUI upgrade


Today I just upgraded the MIUI to version 7. Actually, it prompted for the  upgrade since some times last week. But I failed to upgrade, expected to be server problem.

So, today I determined to find the solution for manual upgrade. The upgrade version is MIUI 7.0.5.0. I visited the official site and searched the ROM, but the official site does not have this ROM. As a result, just did a search, and found the target ROM in the MIUI official forum. Then everything becomes easy now.

In order to upgrade manually, we have to identify the filename of the target ROM. If we can start downloading the ROM file partially, then we can get the filename from the folder downloaded_rom.

Then to download using our desktop web browser such as Firefox, make a search online for the filename. For my case, it is “miui_MI3WMI4WGlobal_V7.0.5.0.KXDMICI_9830c22421_4.4.zip”. Make sure you are downloading from the official forum, where the file is located in the true MIUI server.

After download the ROM file, copy it to the downloaded_rom folder, run the system upgrade, then the phone will use the ROM directly. The phone skips the step downloading the ROM which may be very time exhaustive.

Finally, reboot, and upgrade success.

今天升级了MIUI 7。事实上,前几天(上个星期那样)就已经有提示让我升级了。不过试了很多次,都升级失败。应该是服务器的问题。

所以,今天我决定要手动升级。升级版本为MIUI 7.0.5.0。尝试了上官方网站找,但找不到这个ROM。结果,就上网搜寻,在官方讨论区找到。接下来就不是什么问题了。

首先,我们必须要知道ROM的文件名。这可以从downloaded_rom文件夹里看下载到一半的ROM。知道文件名之后,就可以用浏览器上网搜寻并下载。我所下载的是miui_MI3WMI4WGlobal_V7.0.5.0.KXDMICI_9830c22421_4.4.zip。为安全起见,所下载的文件应该是由官方讨论区而来,文件也应该是从MIUI的服务器下载。

下载完毕后,就复制到电话里的文件夹downloaded_rom。然后就来个系统升级。这个,就跳过了由电话下载ROM的步骤。

最后,重启,升级成功。