忘記密碼
 立即註冊
樓主: BYOB

打造終極 HiEnd HTPC - Linux 哇塞!

[複製鏈接]

14

主題

849

回帖

0

積分

新手上路

三星級會員

舊站積分
2319
舊站發表文章數
826
 樓主| 發表於 2011-5-5 14:03:46 | 顯示全部樓層

Re: Re: Re: Re: Arch Linux 硬碟掛載與播放軟體設定

原發表者是 bchsieh
[B]

1. 小弟直接把筆記上的記錄直接剪貼, 被BYOB兄抓包.. [:I] atime和diratime的確不用重複設定

2. discard 是要看kernel是否有支援, 應該跟使用什麼Linux distribution無關.
2.6.33以上應該就有支援, 而支援的fs好像只有ext4.
這個參數是開啟SSD的Trim功能, 可以大幅延長SSD壽命, 並增快讀寫速度.
所以trim不能用在非SSD上.

3. tmpfs 使用在 /var/tmp 的確不符合Linux Filesystem Hierachy standard (FHS).
對非HTPC專用的電腦, 是不適合的設定.
小弟的Linux是HTPC專用, 平常不跑播放程式以外的軟體, 連鍵盤滑鼠也沒有裝,
所以這樣的設定可以更延長SSD的壽命.

4. 標準的Linux預設scheduler是cfq.
RT system預設為deadline, 可以比cfq更確保realtime的特性.
所以deadline對RT系統裡"非SSD"的硬碟來說是好的設定.
對SSD來說, 最佳設定為noop.
把scheduler的設定放在grub的參數會對系統下所有的硬碟(包含SSD)做一樣的設定.
所以如果系統裡有一般硬碟和SSD, 就不適合使用grub參數來改變scheduler.
需要安裝sysfsutils, 然後在/etc/sysfs.conf裡面設定:
block/sda/queue/scheduler = noop  (如果sda是SSD)
block/sdb/queue/scheduler = deadline (如果sdb是普通硬碟)

[] [/B]


bchsieh兄 您果然是有料的 . . .

優化 SSD 表現 這個網站說 在SSD用 deadline I/O scheduler 會比較好, 我才如此認為的 . . .

後來查到 Wiki 的說法與您相同, Noop 適合固態設備像是Falsh記憶體 . . .(如果用在傳統硬碟則會增加轉動Latency)
Noop scheduler From Wikipedia :NOOP scheduler is best used with solid state devices such as flash memory . . .

除了Noop , Deadline , CFQ  還有最新的 BFQ, 但個人認為只是單純聽音樂應該用前面兩個比較simple的方式吧 !

"所以如果系統裡有一般硬碟和SSD, 就不適合使用grub參數來改變scheduler." (您的這個建議非常實用小弟收下了)

不過ubuntu與arch還是有點不同, arch原本已有安裝sysfsutils , 但是找不到這個檔案 /etc/sysfs.conf

變通作法如下: (如果要系統一開機就執行可以把指令放入rc.cocal)

用leafpad或其他文書編輯軟體打開 /etc/rc.cocal , 或於命令列下輸入
# leafpad /etc/rc.local

加入以下兩行內容 (當sda為SSD, sdb為一般硬碟時的作法)
echo noop > /sys/block/sda/queue/scheduler
echo deadline > /sys/block/sdb/queue/scheduler

*注意上面scheduler的路徑在UBUNTU可能不同

重新開機後驗證結果 :

[root@byob ~]# cat /sys/block/sda/queue/scheduler
[noop] deadline cfq
[root@byob ~]# cat /sys/block/sdb/queue/scheduler
noop [deadline] cfq

0

主題

165

回帖

0

積分

新手上路

二星級會員

舊站積分
171
舊站發表文章數
165
發表於 2011-5-5 22:54:00 | 顯示全部樓層
Hi,

did you try to configure the rtirq in realtime kernel?

I don't know whether it's supported for Arch linux but i'm using ubuntu studio right now with realtime kernel and after prioritize the soundcard and the clock devices the sound become much much better, for the realtime kernel per se the sound quality improvement is not so big compare to the generic one, at least in my system, if you have time you could give it a try you may be suprised!

also you should blacklist those unnecessary devices, the sound will improve as well.

for playback software you could try Audacity which can playback from RAM.
but it is not that user friendly.

cheers!

14

主題

849

回帖

0

積分

新手上路

三星級會員

舊站積分
2319
舊站發表文章數
826
 樓主| 發表於 2011-5-5 23:46:51 | 顯示全部樓層
原發表者是 solo16
[B]Hi,

did you try to configure the rtirq in realtime kernel?

I don't know whether it's supported for Arch linux but i'm using ubuntu studio right now with realtime kernel and after prioritize the soundcard and the clock devices the sound become much much better, for the realtime kernel per se the sound quality improvement is not so big compare to the generic one, at least in my system, if you have time you could give it a try you may be suprised!

also you should blacklist those unnecessary devices, the sound will improve as well.

for playback software you could try Audacity which can playback from RAM.
but it is not that user friendly.

cheers! [/B]


HI, solo16  welcome to Taiwan !

I learned many things from your Setup guide for Ubuntu studio 10.10  [;)]

I am trying RT-Kernel just right now.  It's a little better than none RT-kernel.
Could you teach me what your settings about  IRQ Priority.

something like these . . .

chrt -f -p 99 `pgrep sirq-hrtimer/0`
chrt -f -p 99 `pgrep sirq-timer/0`
chrt -f -p 99 `pgrep irq/8-rtc0`
chrt -f -p 99 `pgrep irq/21-RME96`
chrt -f -p 99 `pgrep sirq-tasklet/0`

Thanks for your advice, I'll try it.

16

主題

1772

回帖

0

積分

新手上路

四星級會員

舊站積分
6295
舊站發表文章數
1683
發表於 2011-5-5 23:57:15 | 顯示全部樓層
原發表者是 BYOB
[B]

HI, solo16  welcome to Taiwan !

I learned many things from your Setup guide for Ubuntu studio 10.10  [;)]

I am trying RT-Kernel just right now.  It's a little better than none RT-kernel.
Could you teach me what your settings about  IRQ Priority.

something like these . . .

chrt -f -p 99 `pgrep sirq-hrtimer/0`
chrt -f -p 99 `pgrep sirq-timer/0`
chrt -f -p 99 `pgrep irq/8-rtc0`
chrt -f -p 99 `pgrep irq/21-RME96`
chrt -f -p 99 `pgrep sirq-tasklet/0`

Thanks for your advice, I'll try it. [/B]


請看後面的rtirq設定..
http://subversion.ffado.org/wiki/IrqPriorities

全部設為99並不是最好的做法. 還是要有高低區別會比較適當.

0

主題

165

回帖

0

積分

新手上路

二星級會員

舊站積分
171
舊站發表文章數
165
發表於 2011-5-6 00:02:12 | 顯示全部樓層
Hi BYOB,

i'm actually out of town, once i get back i can share my setting to you guys.

for the soundcard i do not suggest you to set the irq to too high, for me i just set it just under the clock let say 90 -85, and beware that for those who use dual core the clock have two process which should be similar to like rtc-0 and rtc-1 so you have to set both priority at the same level

and also you could set the software priority as well which you can see the script in that forum someone have mentioned before.

if for those who use firewire dac they should set the firewire card / chipset before the dac / soundcard, hope you can get the logic here.

actually i've been reading this forum many years and my set up basically just copy and paste from you guys []

let's keep this thread rolling!!!!

cheers!

16

主題

1772

回帖

0

積分

新手上路

四星級會員

舊站積分
6295
舊站發表文章數
1683
發表於 2011-5-6 00:06:45 | 顯示全部樓層

Re: Re: Re: Re: Re: Arch Linux 硬碟掛載與播放軟體設定

原發表者是 BYOB
[B]
bchsieh兄 您果然是有料的 . . .
[/B]


有料的都沒出聲.. 小弟的油比較多. []

小弟因為工作的關係, 跟Linux和Unix-based的作業系統朝夕相處了將近二十年.
但雖如此, 一般Linux/Unix伺服器和桌面系統的管理和設定, 和HTPC的要求是天差地遠.
所以在Linux HTPC的世界裡, 小弟還是菜鳥一隻, 只能慢慢摸索試誤才能有些微的進展.

相對來說, BYOB兄在短短一個月內就有如此成果, 實在令小弟五體投地, 佩服不已.

14

主題

849

回帖

0

積分

新手上路

三星級會員

舊站積分
2319
舊站發表文章數
826
 樓主| 發表於 2011-5-6 00:20:24 | 顯示全部樓層
原發表者是 bchsieh
[B]

請看後面的rtirq設定..
http://subversion.ffado.org/wiki/IrqPriorities

全部設為99並不是最好的做法. 還是要有高低區別會比較適當. [/B]


這篇連結我也有參考, 因為其他網站講法不一, 也有人真的都設99, 所以才造成我的疑惑 !

bchsieh 兄 也是用RT核心嗎, 不知您的設定如何!

16

主題

1772

回帖

0

積分

新手上路

四星級會員

舊站積分
6295
舊站發表文章數
1683
發表於 2011-5-6 00:22:01 | 顯示全部樓層
原發表者是 solo16
[B]
if for those who use firewire dac they should set the firewire card / chipset before the dac / soundcard, hope you can get the logic here.
[/B]


就如同solo16兄所說的一樣.
priority的設定基本上就是要看資料流的方向,還有控制層的主從關係.
從控制層來看, 時間相關的priority是最高, 接下來就是負責分配APIC irq分配的softirq等等.
從資料流方向來看, 如果使用的是USB或是firewire等dac或是數位輸出裝置,
因為資料是要通過USB或firewire送到裝置去,
所以USB或firewire的priority必須比裝置本身的priority更優先.

16

主題

1772

回帖

0

積分

新手上路

四星級會員

舊站積分
6295
舊站發表文章數
1683
發表於 2011-5-6 00:25:20 | 顯示全部樓層
原發表者是 BYOB
[B]

這篇連結我也有參考, 因為其他網站講法不一, 也有人真的都設99, 所以才造成我的疑惑 !

bchsieh 兄 也是用RT核心嗎, 不知您的設定如何! [/B]


小弟"用過" RT核心一陣子, 但因為某些操作因素只能暫時把RT廢了.
不過就算不是RT核心, chrt仍然有作用.

小弟的設定很基本.
ksoftirq (在其他的linux distribution會是不同的名字, 甚至分成好幾個process) 設成 98
audio device 設成 90

如此而已.. [:I]

14

主題

849

回帖

0

積分

新手上路

三星級會員

舊站積分
2319
舊站發表文章數
826
 樓主| 發表於 2011-5-6 00:43:20 | 顯示全部樓層
原發表者是 bchsieh
[B]

小弟"用過" RT核心一陣子, 但因為某些操作因素只能暫時把RT廢了.
不過就算不是RT核心, chrt仍然有作用.

小弟的設定很基本.
ksoftirq (在其他的linux distribution會是不同的名字, 甚至分成好幾個process) 設成 98
audio device 設成 90

如此而已.. [:I] [/B]


你講了好多重點我好像快要豁然開竅的感覺 . . .

您果真是有料又有油 ! []

我先Reboot到非RT去測一下~

[root@byob ~]# ps -eLo pid,cls,rtprio,pri,nice,cmd | grep -i "irq"
    3  TS      -  19   0 [ksoftirqd/0]
1536  TS      -  19   0 grep -i irq
[root@byob ~]# chrt -f -p 98 `pgrep ksoftirqd/0`
[root@byob ~]# ps -eLo pid,cls,rtprio,pri,nice,cmd | grep -i "irq"
    3  FF     98 138   - [ksoftirqd/0]
1562  TS      -  19   0 grep -i irq

audio device 應該如何下指令 ?
interrupts 內容如下:
  21:          0   IO-APIC-fasteoi   RME96
您需要登錄後才可以回帖 登錄 | 立即註冊

本版積分規則

Archiver|MyAV視聽商情網 test

GMT+8, 2026-11-19 15:07 , Processed in 0.124461 second(s), 41 queries .

Powered by MyAV!

快速回覆 返回頂部 返回列表