搜索
Table_bottom

标签云
Table_bottom

分类
Table_bottom

声明
文章若未特別註明,皆採用 知识共享许可协议 請自覺遵守
Table_bottom

鏈。。。
Table_bottom

存档
Table_bottom

匆匆过客
83608
Table_bottom

功能
Table_bottom

春節好?不,你叫錯了

(本文是個人對所瞭解到的一些事情所進行的總結,如有錯誤還望不吝指正。)

在當代人們的心中,中國傳統的新年叫做“春節”,而且似乎也沒什麼問題——過年時總是在春天前後,而且“寒假”是冬天到春天的過渡期,而寒假的具體時間總是和新年相關。
然而很不幸,大家都被誤導了。

本文大約結構:首先拆穿錯誤,其次說明錯誤肇始,最後給出正確。

(爲了跟大家解釋清楚本文主題,這裏不得不先捋一下曆法的問題。)
人們一般都知道這麼一個常識:中國傳統的新年是夏曆(文革後亦稱農曆)的正月初一(順便一提,生肖也是按夏曆正月初一——而不是公曆——變換的,今天CCTV-1晚間新聞幹得不錯),而夏曆和公曆並不一樣,甚至一年的長短都不同。然而由於某些原因,人們往往將夏曆錯誤地稱爲“陰曆”,而又將公曆稱爲“陽曆”,然後就理所當然地認爲既然一陰一陽肯定不同,而沒有去仔細思考。
事實上,夏曆並不是什麼陰曆。(不過公曆確實是陽曆沒錯。)
所謂“陰曆”、“陽曆”,分別是“太陰曆”、“太陽曆”的簡稱。“太陽”是什麼,大家都知道;而“太陰”這麼個說法可能有些陌生,不過一些人可能腦子轉得比較快,應該能想到就是月亮。搞清了太陰、太陽,也就好弄懂什麼是太陰曆、太陽曆了:太陰曆(lunar calendar)指以太陰(月)的運轉(週期)爲根據而制定的曆法,例如伊斯蘭曆;太陽曆(solar calendar)指以太陽(日)的運轉(週期)爲根據而制定的曆法,例如格里高利曆(當今公曆)。有些人看到這可能會在腹誹:夏曆的每個月就是根據太陰的運轉而制定的,你前邊卻說它不是太陰曆,騙誰呢?各位請稍安勿躁,這裏請出另一尊大神來解決大家的疑惑:陰陽合曆。所謂陰陽合曆(lunisolar calendar),就是指同時考慮太陽和太陰的運轉而制定的曆法。而我們的夏曆,就屬於陰陽合曆。(再舉個陰陽合曆的例子:猶太曆。)
又有人要腹誹了:你說它是陰陽合曆,你告訴我說它“陽”的部分在哪啊?好,來大家想一想小學時期是不是背過這麼一口訣:春雨驚春清穀天……沒錯,二十四節氣!是不是有人當年還奇怪過:明明節氣和公曆上的“月+日”有一定對應關係,卻說它是中國傳統的東西?事情的關鍵就在這:二十四節氣正是夏曆中陽的一部分,而每個月則是其中陰的一部分。如果有人仍不願相信,那麼再來考慮這麼一個問題:大家都知道華夏是農耕文明,而對農業來說顯然地日關係比地月關係更爲要緊,那麼這麼樣一個文明的曆法可能會不考慮太陽運轉(“科學”的說法是地球公轉)麼?可能嗎?
大家知道,地日週期是365日餘不足366日,而地月週期是29日餘不足30日,無論如何無法得到一個整數使得地月週期乘上它得到地日週期,即:若以月球公轉週期爲月份長度,無法直接滿足地球公轉週期。那麼以太陰運轉定月份長度的夏曆,是如何保證其陰陽合曆的本質呢?這回您猜對了:閏月。

好了,說清了夏曆的本質後,新年這個問題就好講了。既然夏曆中的一年和地球繞太陽公轉的一年長度並不相同,那麼很顯然,每年的正月初一時地球並不處於公轉中的同一位置。這也就是我們站在公曆的角度看,每年過年的時間都不同的原因。好我們翻翻公元2000年開始到今年(公元2016年)的日曆,傳統新年最早(最接近冬至)的是甲申新年(癸未大寒次日/2004年1月22日),最晚的是乙未新年(乙未雨水當日/2015年2月19日)。這兩個新年之間相差接近一月,跨了冬春兩季,如何當得起“春節”之稱?

當然了,我們無法否認現今階段華夏新年被稱爲“春節”。那麼我們就再來翻一翻歷史,看看華夏新年究竟是何時被稱爲“春節”的。如果這件事要我來做,那估計是要在我寫好一個趁手軟件之後再來的了。所幸已有前輩做過完善的整理,我們來看看前輩是如何說的:(節選自溪山琴況所作之文《正月飞雪庭燎光,元夕笙动春未央》)
“新年称为‘春节’的说法从何而来?说起来,这倒是一个不及百年、并不久远的故事。
……
1912年1月2日,孙中山发布《临时大总统改历改元通电》:‘中华民国改用阳历,以黄帝纪元四千六百九年十一月十三日,为中华民国元年元旦。经由各省代表团议决,由本总统颁行。订定于阳历正月十五日,补祝新年。请布告。孙文。’
……
风云突变,袁氏登上历史舞台。内务总长、登极大典筹备处长朱启钤于1914年1月21日提出《定四时节假呈》:‘拟请:定阴历元旦为春节,端午为夏节,中秋为秋节,冬至为冬节。凡我国民均得休息,在公人员亦准给假一日,本部为顺从民意起见,是否有当?理合呈请大总统鉴核施行。’袁世凯旋即批准。从此,夏历元旦被降格为一个季节性节日,‘春节’,而与中国文化毫无关系的西历岁首被称为‘元旦’和‘新年’,成为官方倡导的法定新年。
然而,民间信仰和习惯的力量是强大的。无论官方如何倡导新历新年,百姓并不买帐,民间仍然把夏历元旦当成最隆重盛大的新年来过。洋派的当权者终于按捺不住,一场‘废除春节’的闹剧在1930年上演。
1930年底,南京国民政府颁令‘废除春节’。
……
文化的传统再一次表现出强大的延续力量。虽然政客煞有介事地组织了各种‘国历新年’的活动,但官员多敷衍行事,民间也是消极抵制。相反,到了夏历新年时,民众仍然偷偷过年。几年后,‘国历新年’的活动逐渐销声匿迹,国人如常地过着除夕、元旦,‘废除春节’的闹剧无疾而终。一代代的政客已成尘土,但是‘春节’的概念却在不知不觉中在民众的心中植根,近百年来,几成新的‘传统’。回味略显苦涩,我们至今守着的,竟是袁世凯造出的概念,他留给国人几乎唯一的‘遗产’。”
而“春節”這麼一個似乎頗爲順口的稱呼,本來是在指代什麼呢?繼續援引溪山琴況文:“中国是一个岁时节日丰富的国度,也许是因为四季的节日太多了的缘故,华夏文化中,并不喜欢以某个特定的节日作为一个季节节日的代表,‘春节’、‘夏节’、‘秋节’、‘冬节’的说法在漫长的历史中稀疏少见,夏历的岁首……称为新年。古人偶用‘春节’时,所指为节气之首的立春。”

那麼傳統新年究竟應該叫什麼呢?如果各位讀上面那段文字時有過留心,便會發現其中有兩句甚是耐人尋味:“……定阴历元旦为……”;“……国人如常地过着除夕、元旦……”。按照通行的觀點,“元旦”乃是公曆一月一日,爲何這裏明明在說傳統節日,卻在用“元旦”的稱呼?聰明之人應當已經想到:“元旦”本就是對該日子的稱呼。
對於“元旦”這麼兩個字,《說文解字》中是這麼解釋的:“元,始也”;“旦,明也”。“元”的意義很明瞭,就是“開始”、“初始”;而“旦”則要稍稍考究一下字源了。仍然是《說文解字》中“旦”之一字:“從日見一上。”什麼意思呢?就是說“旦”這個字所表達的是:太陽(日)已從地平線(一)上升起可被人看到。我們用一個白話詞語來表達:初生(當然未必是“初”,也可能是“復”)。兩個字弄明白了,由它們構成的詞(字組)意義也就明瞭了:歲首(初始日)出現(初生)之時,也就是指每年的第一天(或按夏曆的說法叫“正月初一”)。
我知道:所有人看到這裏,都已看懂“元旦”便是指曆法中第一天,而且在中國的語境下特指夏曆正月初一;但是並非所有人都願意去修正自己的說法,因爲自己已經“習慣”了叫公曆一月一號爲“元旦”而叫夏曆正月初一爲“春節”。無外乎溪山琴況前輩在文中嘆息道:“‘春天的节日’成了安置华夏新年的单薄的躯壳,名已不正,言已不顺,多少年了,中国在漫天飞雪中过着‘春天的节日’,而别人的新年,已经被叫做代表岁时之首、新年起点的‘元旦’。”

行文至此,若是英語文章,則有可能會用一句“last but not least”來收尾例舉;而我想說的,卻或許可表達爲“last but at least”——至少最後請聽我一言:不求諸位將夏曆正月初一叫做“元旦”,因爲畢竟還有個公曆一月一日要被稱呼;只求諸位將夏曆正月初一叫做“新年”而不要叫做“春節”——至少叫它“新年”並沒有什麼障礙,而且它真的不是“春天的節日”。

請和我說“新年快樂”,而不要說“新春快樂”。

孤華
乙未臘月廿八

本文遵循CC-BY-SA協議(https://creativecommons.org/licenses/by-sa/3.0/cn/deed.zh)傳播(中文可另考http://creativecommons.net.cn/licenses/meet-the-licenses/),轉載請註明作者、出處(http://renyuneyun.is-programmer.com/2016/2/7/chinese_new_year.194929.html)及是否有修改。

Linux下的聲音質量

這主要是一篇翻譯,原帖在 https://www.linuxquestions.org/questions/linux-newbie-8/sound-quality-in-linux-610168/

該帖子比較老(2010年),其中所說的有些狀況現在已有了改變——當然是朝好的方面改變——但道理無誤。


發帖者說他對其朋友的一段話比較疑惑,所以發這麼一個帖子問問大家的意見。朋友的話是這麼回事:

he is not satisfied with the quality of sound in Linux(fedora7).

他對Linux (fedora 7)下的聲音質量不滿意。

All of u try this : play the same song simultaneously on a linux &
windows machine, u will notice difference in sound quality.

你們可以這樣試一下:同時在一臺Linux和一臺Windows機器上放同一首歌,(這樣)你們會注意到音質的不同。


While looking at the sound settings, he found that Fedora uses generic
ALSA sound drivers. He think that the quality is not good because the
drivers are generic, they are not specific.

當查看聲音設置時,他發現fedora使用通用的ALSA音頻驅動。他認爲這樣的質量不夠好,因爲這是通用驅動而非專用驅動。

下面數個樓層(1#到15#)主要話題是這麼幾個:“根據我的經驗來說並沒有什麼不同”;“在兩臺不一樣的機子上比較的結論並沒有什麼意義”;“認爲不同的請去做無偏見測試(blind test)然後再來說”;“‘聲音質量’是個很模糊的術語,請詳細描述”。

其中技術性較強的是:“ALSA上沒有什麼‘通用’(generic)驅動”;“有可能是設置的問題,你可以如何如何做一下試試”。

10-12#是兩個人在爭,其中10#的內容我沒看懂,期望哪位(如果有)幫忙解釋一下他在說什麼。

重頭戲在於14#及其在16#、18#回覆的內容:其中16#給出了這個問題最直白的答案,14#和18#也都很有意義。

16#是對15#的回覆;15#是對14#的回覆;18#是對17#的回覆。

這裏先翻譯一下16#以饗衆人,14#、15#、18#的翻譯隨後附上:

I totally agree with you on what you've said. There is no difference.

我完全同意你說的。它們之間沒有區別。

To make clear once and for all, people should keep in mind we're talking about **digital signals** here, processed in a lossless (PCM) manner. If there are no resamplings or any other effects applied to the PCM stream, any OS is pretty much the same!

爲了一勞永逸地說清楚這個問題,人們需要在腦中時刻牢記我們在討論數字信號——已處理成無損的(PCM)形式。如果沒有重採樣(resampling)或任何其他附加在PCM流中的特效的話,任何操作系統都是一樣好的!

It works just like this:

這個過程大概是這麼回事:

*You open the application that will play your songs.

你打開一個要播放你歌曲的程序。

*The application uses the appropriate demuxer (to deal with .mp3, .wma, .ogg, .m4a... extensions) to get the encoded stream (wma, mp3, aac, flac, ogg...).

這個程序使用合適的分離器(demuxer)(爲了處理.mp3、.wma、.ogg、.m4a等擴展)以得到編碼後的音頻流(wma、mp3、aac、flac、ogg等)。

*Then there is a decoder that will convert back the encoded stream into a PCM stream [the application could, then, make use of some DSPs to resample or up / downmix by itself].

然後這裏有個解碼器,它會將編碼好的流轉換回PCM流[應用程序可以——在此之後——使用一些數字信號處理技術(DSP)來自己進行重採樣或是up / downmix]。

*The PCM stream, most likely to be untouched by the application, is sent to your sound system.

該PCM流——一般情況下未被應用程序碰觸——被送到你的聲音系統。

Now, when it comes to the PCM stream and the sound system, things are just like this:

現在,輪到PCM流和聲音系統時,事情是這麼回事:

*If you have a sound server, like Pulse Audio, the PCM stream is sent to the Pulse server. Pulse up / downsamples the PCM stream if it is different of its own settings (you can change Pulse default sampling rate by editing the "/etc/pulse/daemon.conf" file, it also up / downmixes the PCM file if its told to,

如果你有一個音頻服務器(sound server)——如Pulse Audio——該PCM流會被送到Pulse服務器。Pulse會對該PCM流進行向上/向下採樣(up  /downsample)——如果它和Pulse自己的設置不同的話(你可以通過編輯/etc/pulse/daemon.conf文件來修改Pulse的默認採樣率,它也可以在被告知如此做時up / downmix該PCM文件)。

*and, at last, the processed (or maybe untouched) PCM stream is sent to ALSA system.

以及,最後一步,被處理過的(也可能是沒被碰觸的)PCM流被送到ALSA系統。

I'm not going to get into deeper details on how things work under Windows or OS X, for example, because things are almost the same with all of them. The point is: the **true** maximum audio quality is achieved but getting the PCM stream untouched to the sound card. That ANY operating system can do, including Linux.

我不打算深入如Windows或OS X中事情如何工作的細節,因爲事情在它們中幾乎是一樣的。重點在於:真正的最大聲音質量由(原文中是but,疑似by之訛誤)傳輸未碰觸的PCM流至聲卡中來達成。這是任何操作系統都可以做到的,包括Linux。

ALSA is able to do the resampling stuff on its own, but it's not as configurable as Pulse Audio. I myself like to set Pulse to 44,1 KHz sampling and S32_LE resolution all the time, except when I have to deal with 48 KHz audio samplings. I know for sure my sound card works only at 48, 96 or 192 KHz on Linux, but its audio processor (X-Fi) has an excellent resampler using advanced techniques. So, I prefer to always let the sound card to the processing.

ALSA可以自己進行重採樣工作,但沒有Pulse Audio那麼好的可配置性。我個人喜歡始終設置Pulse爲44.1KHz採樣率以及S32_LE分辨率(resolution)——除非當我需要處理48KHz音頻採樣時。我很確定我的聲卡在Linux下僅可以工作於48、96或192KHz,但它的音頻處理器(X-Fi)有極好的使用高級技術的重採樣器。所以,我傾向於始終讓聲卡自己來處理。

If you don't have such hardware capabilities, I guess you'd really want to consider taking a look at this website.

如果你沒有這樣的硬件條件,我猜你會想要看一下這個站點

Up and downmixing on Linux, anyway, is flat and 2 dimensional as I've said. I've already tried ALSA "vdownmix" plugin, it works but it's not yet as well implemented as Creative's own HRTF technology.

在Linux中,Up 及 downmixing始終是平(flat)的以及2維的——就像我說過的那樣{參見14#}。我已經試過ALSA “vdownmix”插件——它可以工作,但是尚未有創新自己的HRTF技術那樣實現完備。

Amarok has a built in equalizer that does its job, specially when set to "Rock" if I'm not wrong. aTunes also has its own equalizer but it sounds horrible and is not worth a try.

Amarok有它自己的均衡器來做這件事,尤其是當設置成“搖滾(Rock)”時——如果我沒記錯。aTunes也有它自己的均衡器,但聽起來極其可怕並且不值得一試。

So, quality is the same on every OS if you know how to set them up. Here I've left the tips of mine to help anyone who would occasionally be interested.

所以,在任何操作系統中,只要你知道如何設置,聲音質量都是一樣的。這裏我留下一些我自己的建議,以幫助任何可能有興趣的人。

> Preferably, don't do any resamplings.

> 最好不要做任何重採樣。
> Tell Pulse and / or ALSA to always use the highest definition for your sound card (mine is 24 bit, so I use the S32_LE instruction both under Pulse and ALSA).

> 告訴Pulse和/或ALSA總是使用你聲卡的最高精確度(我的是24位,所以我在Pulse和ALSA下均使用S32_LE指令)。
> Avoid multichannel if all you have is a pair of speakers or headphones, or try the not so well implemented "vdownmix" plugin for ALSA.

> 如果你僅有一對揚聲器(speaker)或者耳機(headphone),避免多聲道,或者使用ALSA中尚未完善的vdownmix插件。
> Try Amarok equalizer (probabily set to "Rock") to help improve a bit the perceived sound quality.

> 嘗試Amarok均衡器(很可能是設置爲“搖滾(Rock)”)以幫助增強一點感知到的聲音質量。

Best wishes to everyone here and to Linux in the hope that it continues to improve and to be a more and more appealing alternative to MS Windows or Apple OS X.

致祝願於這裏所有人,以及給Linux——期望它可以繼續改進並且成爲一個愈來愈吸引人的MS Windows或Apple OS X替代選擇。

14#:

I don't know precisely what problem you guys are talking about, anyway, I want to leave here the comment of mine on this subject.

我並不確切你們在討論什麼問題,不過不管怎麼說,我想在這留下我對這個主題的看法。

I own a Creative SoundBlaster X-Fi XtremeMusic. On Windows, Creative's drivers offer you technologies fully implemented in hardware like Crystalizer and CMSS-3D.

我有一個創新的聲霸卡X-Fi XtremeMusic。在Windows上,創新的驅動提供了全部由硬件完成的技術,如Crystalizer和CMSS-3D。


Crystalizer stands for a really dynamic equalizer which adjusts itself according to the quality of the sound the card is fed with. For example: if I'm playing a 96kbps MP3 file, with considerable loss of high frequencies, the card is able to play with its own equalizer, the one specifically called Crystalizer, so you can kind of restore the lost frequencies (that's the illusion you have).

Crystalizer代表一個真正動態的均衡器的,它可以根據卡片收到的音頻的質量進行自我調整。舉例子:如果我在播放一個96kbps的MP3文件——其中顯然會有高頻中的大量丟失——這個卡片可以用它自己的均衡器——那個叫Crystalizer的東西——來播放,所以可以在某種程度上恢復那些丟失的頻率(這是你會感受到的幻覺)。

CMSS-3D stands for a multi purpose surround sound mixer. For example: if you have a 5.1 home theater speakers setup and want to play a stereo sound, the CMSS-3D technology is able to identify instruments on the sound the card is fed with and dynamically distribute it through all the available speakers. It's a totally active design, that's why I say "dynamically". If on the other hand, all you have is a pair of speakers or headphones, the card is able to mix into stereo channels up to 8 surround sound channels with Creative's proprietary HRTF technology. It immerses you into your DVD / BD movies or 3D games.

CMSS-3D代表一個多用途的環繞聲混音器。舉個例子:如果你有一個5.1聲道的家庭劇場設備,並且你想放一個立體聲音頻,CMSS-3D技術可以分辨出卡片收到的音頻中的樂器並且(然後)由所有可用的音箱中動態地分發它。這是一個完全主動的設計——這就是我爲什麼說”動態“。如果說是另一種情況——你只有一對音箱或者耳機(headphone)——該卡可以利用創新的專有HRTF技術在立體聲的聲道中插入最多8個環繞聲聲道。它可以讓你沉浸入你的DVD/BD影片或者3D遊戲中。

That could all be implemented on Linux for sure IF there was any sort of interest from Creative's Linux driver people. Anyone knows for sure it'll never happen anymore, thus, we're left with a complete 2D and raw sound experience with Linux or any other OS except Windows with Creative's sound cards.

這些當然可以在Linux上實現——只要創新那寫Linux驅動的人有那麼幾分興趣。(然而)任何人都很確定這並不會發生,因此我們在Linux或任何其他非Windows的系統上使用創新的聲卡時,均被離棄在一個純2D和裸的聲音體驗中。

I often test new Linux distributions but can never stay with anyone of them because of the lack of such important technologies. I have 3 headsets, high fidelity ones (12 to 28 KHz frequency range and near 20 bit sound quality), and I very frequently watch 5.1 CH videos and play 5.1 CH games. I just couldn't live without CMSS-3D. Besides that, X-Fi Crystalizer is just so amazing I have no pleasure on listening to anything without it.

我經常測試新的Linux發行版,然而無法在其中任一上停留——因爲缺乏如此重要的技術。我有3個耳機(headset)——高保真的(12到28KHz的頻域以及接近20位的聲音質量)——並且我時常看5.1聲道影片和玩5.1聲道遊戲。我簡直無法離開CMSS-3D。另外,X-Fi Crystalizer也是那麼的令人驚奇以至於我在離開它聽任何東西時都覺得索然無味。

Linux, OS X and Windows do have almost no difference in sound quality. Up to XP, with such a good card as the X-Fi, Windows was the best out of the three. Having them all properly set up not to make any sort of resamplings, they're all the same. Each, of course, deal with latency a different way. I'm not quite familiar with other OS'es but at least Windows has WASAPI and works admirably with ASIO 2.0 and OpenAL (hardware accelerated, opposed to software rendered on Linux and OS X). These APIs are quite good on latency, specially ASIO. Anyway, without resampling and not taking into consideration latency, any OS should be the same.

Linux、OS X和Windows在聲音質量上真的幾乎沒有什麼區別。直到XP,在使用如此好的X-Fi卡片時,Windows是它們三個中表現最好的。把它們都設置好且不使用任何重採樣(resampling)之後,它們(的表現)都是完全一樣的。當然了,它們使用不同的方法對待延遲(latency)。我並不特別熟悉其他的操作系統,但是至少Windows有WASAPI並且在使用ASIO 2.0和OpenAL(硬件加速,和Linux及OS X上的軟件渲染相反)時表現極好。這些API在延遲上表現良好,尤其是ASIO。(當然)無論怎麼說,在不使用重採樣並且不考慮延遲時,任何操作系統的表現都應當是一樣的。

Now, when it comes to improvements implemented in hardware / driver, no doubt Windows wins (on Creative's side, specifically).

現在,當考慮到硬件或是驅動上實現的增強時,Windows贏得毫無疑問(僅限創新)。

I'll just keep using Linux once in a while with its 100% software rendered, mixed, resampled audio, quite flat and 2 dimensional.

我仍舊會時不時地使用Linux——100%軟件渲染、混音、重採樣音頻,特別平(flat)的以及2維的(聲音)。

For the best quality and user experience and full use of my hardware capabilities, I'll unfortunately have to stay with Windows.

爲了追求最好的質量以及用戶體驗,並且完全使用我的硬件規格,我很不幸地不得不留在Windows上。

By the way, have any of you ever realized that Linux just doesn't grow on the "hardware accelerated" industry? The most it gets is OpenGL. There are no solutions to fully decode in hardware video streams, like MPEG2 or H.264, or to mix audio streams from different sources, or to process MIDI, or EAX effects, or audio resempling, downmixing, or TCP offload, or whatever. Everything, except OpenGL is software implemented. I shame indeed!

順便說一下,你們是否意識到Linux並不長在”硬件加速“的產業上?它得到得最多是OpenGL。沒有任何的硬件解碼視頻流——例如MPEG2或者H.264——,或者合併不同源頭的音頻流,或者處理MIDI,或者EAX效果,或者音頻重採樣、downmixing,或者TCP offload,或者其他東西的方案。任何東西——除了OpenGL——都是軟件實現的。我實在感到恥辱。

15#:

Well, that is of course the whole issue. Most hardware manufacturers put all their efforts into developing drivers for Windows. Linux, if it is even considered at all, is an afterthought at best. The companies that fully support linux and open source their drivers (for example Ralink wireless cards) have hardware that works just as well in linux as it does in Windows.

說起來,這當然就是所有問題所在。大多數硬件製造商將它們的精力全都放在開發Windows驅動上。至於Linux——如果它被考慮了的話——最好的情況也是一個靠後之事。那些有完善Linux支持並且願意公開驅動源代碼的廠商(例如Ralink無線網卡)所產硬件在Linux和Windows上的表現一樣好。

For those who swear that sound is "better" in Windows, perhaps try a blind comparison. Install Windows and linux on the same computer. Have a friend boot either Windows or linux randomly and play some music. See if you can consistently tell whether Windows or linux is playing the music. You may be surprised at what you find. Even the (supposedly golden eared) high end audio reviewers at Stereophile magazine dare not do blind comparisons of audio hardware.

對於那些信誓旦旦說在Windows中聲音“更好”的人,你們應當嘗試一下無偏見比較(blind comparison)。在同一臺電腦上安裝Windows和Linux。讓一個朋友隨意啓動Windows或Linux並且播放同一首音樂。看看你能否始終如一地分辨出播放音樂的到底是Windows還是Linux。你或許會對你自己的發現感到驚訝。即使是那些Stereophile雜誌中(號稱金耳的)高端音頻評測者也不敢對音頻硬件做無偏見比較。

17#提出了這麼一個問題:“在播放音樂文件時候Windows上和Linux上效果一樣,但是在放DVD影片時候Windows中音量比Linux下大,不知道爲什麼。”

18#:

The "problem" you talk about exists on Windows too. We're actually talking about a Dolby Digital issue. It's not exactly a problem though, nothing that has got to be fixed. Dolby Digital has a lower audio range, output, volume, whatever they call it, meaning it sounds lower than other formats, like DTS (which happens to be better concerning audio quality).

你所說的這個“問題”在Windows上其實也有。我們在討論的其實是Dolby Digital的事情。它其實並不是個問題,所以也沒什麼可修復的。Dolby Digital有一個更小的聲音範圍/輸出/音量——不管怎麼叫它吧——,意味着在和其他格式——例如DTS(考慮到聲音品質時它恰好更好)——比較時它聽起來聲音更低。

Windows 7, for example, has a built-in Dolby Digital decoder. If you right-click the video screen (on Media Player) and go to "Enhancements" (I'm not sure that's what it's like on the English version of the software since I use the Br-Portuguese version) you can click "Dolby Digital settings" and it will give you three options for you to choose: "Normal", "Night" and "Cinema". If you choose "Normal" you're going to have a boost on low volumes and a decrease on the excessively high ones. If you choose "Night", you'll have the same softened output but a slight increase on the dialogs (I guess this one sounds better for onboard sound solutions). Now, if you choose "Cinema" mode, then you'll have the same exact output that the DVD was intended to have, called full dynamic. At times the sound will be low, and at times high, it'll vary dynamically. Most people won't like it if they don't have a good sound card, capable of high dynamics in audio, and a good speaker system or headphones too.

Windows 7——例子而已——有一個內建的Dolby Digital解碼器。如果你在視頻界面上右鍵(在Media Player中{即Windows Media Player,Windows自帶的播放器})並且轉到“增強(Enhancements)”(我不確定在英文版中它到底叫什麼,因爲我用的是巴西葡萄牙文(Br-Portuguese)版),這樣你可以點擊“Dolby Digital設置(Dolby Digital settings)”,然後它會給你三個可選項:“正常(Normal)”、“夜間(Night)”、“影院(Cinema)”。如果你選擇“正常”,你會在低音量時得到增強且在高音量時減弱;如果你選擇“夜間”,你會得到相同的柔化了的(softened)輸出但在對話中得到輕微增強(我猜這會在板載(onboard)聲音解決方案{集成聲卡?}中聽起來更好一些);現在,如果你選擇“影院”模式,你會得到同該DVD被預期得到的效果完全一樣的輸出——這被稱爲全動態(full dynamics)。有時聲音會低,有時會高——它會動態變化。多數人並不喜歡它,因爲(if)他們沒有一塊好聲卡——適用於音頻中的高動態——以及好的揚聲器(speaker)系統或耳機(headphone)。

I don't know which Dolby Digital decoder you've chosen under Windows XP, since it doesn't have a built-in one, I'd recommend, by the way, AC3Filter, it's one of the bests out there. Anyway, it seems your decoder under Windows is set to something like the "Night" mode, giving you pretty much the same (high enough) volume experience throughout the whole video.

我不知道你在Windows XP中選的是哪個Dolby Digital解碼器,因爲它沒有內建的——順便一提,我建議AC3Filter,它是上佳之選中的一個。不管怎麼說吧,看起來你在Windows所用的解碼器被設置爲類似於“夜間”模式——給你在看整個視頻時以還原很好(pretty much the same)(足夠高)的聲音體驗。

Linux, on the other hand, doesn't have the same configurability of Windows 7 and other decoders like AC3Filter, and instead of choosing the "Night" mode equivalent as does your Windows XP decoder, it chooses the "Cinema" mode for quality purposes. As I've said, preferably, the encoded, compressed sound should be decoded and sent to your audio system **untouched**. If you have your system sound output set to stereo there is surely some processing done with the decoded DVD audio in order to fit it to 2CH outputs. Anyway, the Linux decoder tries to convert the compressed audio stream to PCM **as it is**, with the same output volume as is in the DVD. As said, too, Dolby Digital has lower volume if compared to other compression formats, like DTS, MP3, etc.. Thus, you have the impression that Linux sounds worse, which isn't true. Actually, it sounds better since it doesn't play with audio volume.

然而另一方面,Linux沒有如同Windows 7或者其他解碼器如AC3Filter之列的配置能力,並且它沒有像你的Windows XP解碼器那樣選擇“夜間”模式的等價物,而是出於質量考慮選擇“影院”模式。像我說過的那樣,較好情況下,該編碼、壓縮了的聲音應當被解碼並且原封不動地送往聲音系統。如果你將你系統的聲音輸出設置爲立體聲,其中顯然會有一些處理過程施加在解碼後的DVD音頻上——爲了使其適用於雙聲道(2CH)輸出。不管怎麼說吧,Linux解碼器會試着將壓縮過的聲音無差別地(as it is)轉換到PCM——同DVD中一模一樣的輸出音量。依然如前所述,Dolby Digital和其他格式——如DTS、MP3等——比起來音量更低。因此,你產生Linux聲音更差的感覺——其實並不正確。實際上,它聽起來更好,因爲它沒有調戲(play with)音量。

I don't know any solution to this but trying to increase both the PCM and Master volumes under ALSA Mixer (type on terminal "alsamix").

我並不知道該事情的解決方案——除了在ALSA Mixer(在終端中輸入“alsamix”{至少現在arch上應當爲alsamixer})中嘗試調高PCM和Master的音量。

I myself can't stand watching DVD's or any multichannel audio under Linux. Firstly because it has no advanced audio downmixing with well implemented HRTF techniques, as Creative's CMSS-3D. Secondly, it has no hardware accelerated MPEG-2 decoding. There are good [paid] choices for Windows out there, but for Linux the best you're gonna have is VLC which has plenty of choices for deinterlacing. Anyway, none of them have come even near to the quality of my hardware dedicated decoding under Windows. My ATI Radeon HD 3850 deinterlaces using vector adaptive algorithm with "pulldown" detection, that makes my DVD's look gorgeous! Let alone if I had a better card, like the 4000 series, with upscaling techniques!!! I like most Linux Mint and Ubuntu. I have made extensive tests with Mint 10 RC and Ubuntu 10.10. I can say that Totem DVD player, or Gnome Mplayer look just like Apple's DVD player on Mac OS X. Sound for me is not an issue on DVD's because of my better sound card.

我自己無法忍受在Linux下播放任何DVD或是多聲道音頻。首先,因爲它沒有任何使用實現良好的HRTF技術——例如創新的CMSS-3D——的高級音頻downmixing。其次,它沒有硬件加速的MPEG-2解碼。Windows上有許多良好的[付費]選擇,但是在Linux上你能得到的最好一種應當是VLC——它擁有大量的deinterlacing選擇。不管怎麼說,它們中沒有任何一個表現得哪怕是接近我在Windows下的硬件專用解碼。我的ATI Radeon HD 3850 deinterlaces使用帶有“pulldown”檢測的vector adaptive算法,它能讓我的DVD看起來絢爛奪目!更不用說假如我有一個更好的卡片——例如4000系列——擁有upscaling技術會如何了!我最喜歡Linux Mint和Ubuntu。我對Mint 10 RC和Ubuntu 10.10進行了多方面的測試。我可以說Totem DVD播放器或者Gnome Mplayer看起來就像Mac OS X上蘋果的DVD播放器一樣。歸功於我良好的聲卡,DVD的聲音對我來說並不是個問題。

 

習LXC遇諸

爲了解決某些問題(後來發現不可),這兩天看了看coolshell中LXC的“教程”[1][2],在運行“示例”之時發現有些執行結果和原文中所說並不一樣,遂上網查之,有得解,有未得解。

(本文作於9.26日)

继续阅读

解決device not accepting address *, error -*

豫:實際上這裏提出的做法並不可稱爲“解決”,因爲沒有找到具體原因,而只有解決方案。

最近手上的Kingston DTR30 32G U盤(屬USB閃存設備)出了問題,在試圖查壞塊時候意外發現了另一個問題(已驗證和U盤無關):

  • 插入U盤之後檢測到USB設備(lsusb),但是不出現對應的塊設備(lsblk);
  • 查看dmesg,輸出中有多行如下內容:
    usb 1-1.2: new high-speed USB device number 92 using ehci-pci
    usb 1-1.2: device descriptor read/64, error -110
    usb 1-1.2: new high-speed USB device number 93 using ehci-pci
    usb 1-1.2: device not accepting address 93, error -110
    
  • 之後信息反復(並不一定和上面完全相同),其中設備號不斷上升;
  • 多次之後變成:
    unable to enumerate USB device

其中的設備號完全可以是其他值,錯誤號也可以是其他值,例如下面的:

usb 1-1.4: new high-speed USB device number 103 using ehci-pci
usb 1-1.4: device not accepting address 103, error -71
usb 1-1-port4: unable to enumerate USB device
usb 1-1.4: new high-speed USB device number 104 using ehci-pci
usb 1-1.4: device descriptor read/all, error -71
usb 1-1.4: new high-speed USB device number 105 using ehci-pci
usb 1-1.4: device descriptor read/64, error -71

在網上搜索多時,總共找到兩個相關內容,分別如下:

  1. 過熱之說(網址1 網址2
    • 其中說道:“這極爲可能是硬件問題(failure)而不是驅動或者內核bug。USB有‘電流過載(over-current)保護’,會在接口電量消耗過大時觸發。”
    • 解決方案是:“拔下所有USB設備,關閉電源,等一兩分鐘。然後接回所有設備並啓動系統。”
  2. 驅動bug之說(網址
    • 該論壇主題中,許多人遇到了這樣的問題;
    • 2樓(Rocket2DMn)提出了一個解決方案:
      sudo rmmod ehci_hcd
      並說該問題有時候會發生在USB2.0設備上,但他也不清楚究竟是如何觸發的;
    • 再下面9樓(jhoderd)提出卸載ehci驅動模塊會導致無法使用高速USB,他也很糾結這個問題。

對於我碰到的問題,分別(是的我碰到了好幾次)嘗試上面兩個方案的結果如下:

  1. 分爲兩個階段,貌似管用
    1. 關機,睡覺起來之後再開,當時沒有再遇到問題;
    2. 開了一段時間以後(電腦服役五年了且散熱不好,最近濟南氣溫也比較高)溫度又昇上去(九十度),想起來再試,再次出現問題。
  2. 和論壇主題中說的解決方案有一定出入
    1. 卸載ehci_hcd模塊時候提示被ehci_pci模塊依賴,無法卸載;
    2. 同時卸載ehci_pci、ehci_hcd模塊之後所有(?)USB設備均不可使用;
    3. 重新裝載ehci_pci之後均再次工作,且未再出現問題。

在尋找問題過程中,還有過其他猜想,但經嘗試發現當可排除。猜想、原因及嘗試方案(結局均爲“問題依舊”,故不再贅述)如下:

  1. USB接口問題
    • 原因:電腦服役多年,且已知某接口可能接觸不良
    • 方案:更換到其他接口上(共3個USB2.0、1個eSATA/USB)
  2. USB接口供電/休眠問題
    • 原因:開機自動啓動powertop進行調節,其中包括USB接口自動休眠
    • 方案:關閉所有相關項目的自動調節功能
  3. 內核bug
    • 原因:出現該問題前兩天剛剛把內核更新到4.1.2
    • 方案:使用3.14.48(arch官方源中的linux-lts)內核

雖然就目前來看,問題得到解決,但是由於不清楚具體問題何在,難保日後不會再碰到。

如哪位知道具體問題何在,煩勞周知,多謝!