2026年6月16日 星期二

audio related problem (2) pipewire/wireplumber with usb DAC

 Ubuntu 26.04 用 pipewire/wireplumber  for audio, 那以前為了 usb speaker MM-1 音量問題設的
/etc/pulse/default.pa
load-module module-udev-detect ignore_dB=1

要怎麼改? google / try error -> result

--------------------------------
add in /usr/share/wireplumber/wireplumber.conf.d/alsa-vm.conf

  {  matches = [ { device.name = "alsa_card.usb-Bowers___Wilkins_MM-1_304-00"  }  ]
     actions = { update-props = { api.alsa.ignore-dB = true }  }  },

  {  matches = [  { node.name = "~bluez_output.*" } ]
     actions = { update-props = { api.alsa.ignore-dB = false } }  },

第一段是呼應以前的 ignore_dB=1, 然而, 明明 device.name 都寫明了, 還是會影響到 bluetooth speaker, 加了第二段就 OK,很怪, 但有用就好

#device name 是用 pactl list short cards 得來的

------------------------------------
另外,usb speaker 有時會破音和奇怪的噪音,google 來修改
/usr/share/pipewire/pipewire.conf
default.clock.allowed-rates = [ 44100 48000 ]

好像有用?

2026年6月14日 星期日

adb start google tv to play recorded files via samba

 adb shell am start -a android.intent.action.VIEW -d 'smb://10.42.0.1/1recording/news.ts'

2026年6月10日 星期三

install Ubuntu Mate 25.10 and upgrade to 26.04

 Ubuntu mate 沒有 26.04 了, 好傷心

本來想認命的放棄 mate, 但原來一些自動化script 在用的 xdotool/xrandr/wmctrl 都要找代替品, 有點煩, 所以想說先裝 Ubuntu 25.10 , 用到幾時算幾時,結果一裝完它就問要不要升級到26.04,對喔,可以這樣玩。

1. 可以整個 copy 的config :
/var/lib/bluetooth : 藍牙設備可以被視為同一台,不用重連
.config/[browsers] browser history/bookmark 全部重現
.android : adb devices 也是被當成同一台
.config/VirtualBox, .config/calibre
.themes 桌面重現

2. python 從 3.10 -> 3.14, 討厭的就是很多不讓你從 pip install, 改用 apt install python3-xxx, 然後 google-genai 沒有這個選項, 只好在 pip3 install 時加個 --break-system-packages

3. on board sound 終於回來了, 當年討厭它, 不知改了什麼完全disable掉 =_=|||

4. wifi hotspot 2.4G 可用了, 速度也OK, kindle oasis 可以連了,但想起來為什麼當初要改用 5G頻段 : 會干擾 bluetooth speaker

目前為止的問題:

1. workspace switcher 比例不對, 尤其是 panel 放在左右兩邊時
2. 會Hang, 不知為啥... 

2026年4月25日 星期六

kindle update 見鬼之三

太久沒有在 kindle scribe 上寫 notes, 今天要寫時, 找不到 =_=,
highlight 之後 popup  menu 上沒有 'note' 這個選項

google 了半天, 發現正確的搜尋字眼應該是 Annotation, 然後搜到這個影片

https://www.youtube.com/watch?v=fF_EqPukbq0

原來折一角那個符號就是以前的 'note', 還有如何讓 highlight 之後 pop up menu 像以前一樣立刻出現, 感謝影片主人 Charlie Samways

kindle update 真是有夠見鬼的, 折一角符號不應該是 bookmark 嗎? 

2026年4月15日 星期三

Kindle 直排書 format 見鬼 part 2 (for firmware 5.19.3)

 Kindle scribe update to 5.19.2 , 災難! 
5.19.3.0.1 好一些, 記錄一下目前為止的解法

==== best solution ===========
1. opf : <dc:language>ja</dc:language>
            <spine page-progression-direction='rtl' toc="ncx">
       or <meta name="primary-writing-mode" content="vertical-rl"/>             

2. xml footnote 一定要用  <a class='noteref' | <div class='footnote'  配對
3. line-height 好像沒有作用
4. html margin可以不設, 要擴大文字範圍可設, 
    margin 左右無用 (都還是留白一大截), 上可至 -1.5em, 下可至 -0.5em , 

然後, 用 kindlepreviewer  3.96.0 (不知新版如何, 這一版確定可行), 生成 kpf, 
calibre-debug -r "KFX Output" -- xx.kpf xx.kfx, 
以上這兩行 calibre on windows 可能可以一次做完(call kindlepreviewer ?)

usb 傳入 Kindle scribe

優點 : 翻頁方向正確, footnote popup 且不會被截掉, 劃線動作正常, 可調行距
缺點: 不能調行距, default font 是日文字型 (但中文顯示沒問題)

2026/5/20 update: kindlepreviewer 3.104.0 亦可, 劃線動作似乎比舊版略佳


=== good solution ==============
1. opf : <meta name="primary-writing-mode" content="horizontal-rl"/>
            <dc:language>  zh-hant/zh/zh-TW 都一樣 ja 也無妨
2. 同 best solution 

epub send to kindle

優點 : 翻頁方向正確, footnote popup 且不會被截掉, 可調行距
缺點: 劃線動作不正常, default font 是簡中


=== 2026.05.10 update

==== best solution for no footnote pop-up =========

1. opf same as best solution

2. css add : div.vpage { margin-left: 2em; margin-right:1em; margin-top:-3.2em; margin-bottom:-2.5em; padding: 0; }
3. for all content, add a <div class='vpage'> under body tag


or 2_3 . html { margin : -3.2em 1em -3em 2.5em; }

優點 : 翻頁方向正確, 劃線動作最美, 文字可以佔滿整個scribe畫面 ( oasis 應該會超出畫面?)
缺點 : 不能調行距, footnote 不能 popup, 會跳到 footnote 那頁

===================
因為對劃線動作比較介意, 所以 better/good 是這麼排的

暫時都不連線以免又有什麼奇怪的 bug update, 下回連線之前得記得要搜一下 kindle update 災情

2026年1月14日 星期三

Kindle 直排書 epub fomat 見鬼

Old : kindlegen Linux v2.9
New : send to Kindle 2025

1. vertical-rl  (old) vs horizonal-rl (new)

according to https://kdp.amazon.com/en_US/help/topic/GFFHCXVPHRZW8SJ5, vertical-rl 才是正確的, 然而, 新的 kindle (2023 ? 以後), 如果在 opf 用
<meta name="primary-writing-mode" content="vertical-rl"/> 
send to kindle 會有 warning, 然後在 kindle 2024 還會無法開啟 =_=|||, 好在偉大的FB網友們試出來要用 horizonal-rl (in opf only,  css 還是用 vertical-rl -> 感覺是個 bug ? )

kindlegen 必需用 vertical-rl, 否則會有上下空白太多, 左右貼著牆壁的問題


2. footnote problem

New (with 1.horizonal-rl ) : epub:type noteref for a , epub:type footnote for div 註解才會完美呈現, 不然會跳轉到註解所在頁面 (2026/01/19 update, noteref 似乎非必要)
New (with 1.vertical-rl ) : 不需要 epub:type, 註解可pop-up, 但 kindle scribe with 5.18.6 會截斷長註解, 而且註解是一整個buttom長條

Old : epub:type 會導致無法 click (but clibre's ebook-convert OK )

..........

2026/02/05 update

by ebook-convert

for emphasis :

text-emphasis-position: under right; 
-webkit-text-emphasis-style: filled dot; -epub-text-emphasis-style:   filled dot; 

figure best on scribe , and oasis ok: 

figure { -webkit-writing-mode: horizontal-tb; -epub-writing-mode: horizontal-tb;  text-align: center;   margin : auto 1em;    page-break-inside: avoid;    page-break-before: auto;    }

figure img {  width: 60%vw;   page-break-inside: avoid;    }