sam0402 / pcp-44.1KHz

9 stars 2 forks source link

Tidal Connect into piCorePlayer Xenomai #1

Open lovehifi opened 3 years ago

lovehifi commented 3 years ago

Hi Sam, I have tried many times to integrate Tidal Connect into your piCorePlayer Xenomai but failed due to the IPV6 module not working. I also tried integrating Tidal Connect into Noel RC1, I regret that Tidal Connect doesn't work on 64 bit.

  1. Can you help me build a version of piCorePlayer Xenomai that supports IPV6?
  2. If yes, is there a 32-bit version of Noel PCP 7.0?

You can try PiCorePlayer Tidal Connect here: piCorePlayer topic link

  1. You can be using the Tidal Connect package in the PiCore build of me integrate to your PiCore.

Thank you!

sam0402 commented 3 years ago

Hi Lovehifi, I just work for tuning the kernel to get the best sound on piCorePlayer. The piCorePlayer do not support IPV6, and I don't have ability to do this on webgui. I will not work for 32-bit version, because tuning the kernel spend too much time for me.

lovehifi commented 3 years ago

I got it, Thanks Sam!

lovehifi commented 3 years ago

Hi Sam, I flash piCorePlayer v6.1.0 add package dnsmasq.tcz with dependencies ipv6-4.19.122-pcpCore_v8.tcz http://picoreplayer.sourceforge.net/tcz_repo/10.x/armv7/tcz/ http://picoreplayer.sourceforge.net/tcz_repo/10.x/armv8/tcz/

I check IPV6 is OK

ifconfig |grep inet6 sysctl -a |grep ipv6

The piCorePlayer v6.1.0 4.19.122-pcpCore_v8 is support IPV6.

Current, I play music with SMPD Xenomai for Pi 2 / Pi 3 I add TC, Aprenderer, Aplayer out pipe - rtalsa. You can try this: https://drive.google.com/file/d/1bN4PpxfgfkX3NuhHwVVlmD_C1NOEcOTX/view

Pi 3 config.txt https://drive.google.com/file/d/1tIIW6_svCfKUjRppwty3WatwglHZVtzC/edit

I love the sound of Xenomai rt. I want to use piCoreplayer Xenomai for my Pi 4.

lovehifi commented 3 years ago

I have added package dnsmasq.tcz with dependencies ipv6-4.19.122-pcpCore_v8.tcz to piCorePlayer Xenomail, IPV6 doesn't work.

lsmod Not module ipv6

sam0402 commented 3 years ago

I updated the piCorePlayer6.1.0-Noel.img. It supports IPV6. Enjoy it.

lovehifi commented 3 years ago

Woww!!! Many thanks Sam!

starchivore commented 3 years ago

Hello quatmo,

I've been reading your posts @ hdvietnam.com and I appreciate what you've been sharing with everyone.

Since smpd might not be able support USB Audio in the near future, or maybe the author(s) wouldn't be interested in providing support for USB Audio at all, do you think that any forum members @ hdvietnam.com (e.g. tml3nr) could find a way to obtain the source code of Audio over Ether by any chance?

At some point Sam will begin working on pCP for the Apple M1 (i.e. also ARM64) but not sure if either Xenomai 3 or EVL were actually compatible with the hardware, apparently it's quite different from Cortex-A72 of Raspberry Pi 4B / Compute Module 4 etc.

Right now the "Front-End" part of Audio over Ether should be compatible with most hardware, though the "Back-End" part still cannot work with anything other than Raspberry Pi 4B. That's why we'll need access to the source code so that we could even get the "Back-End" portion working on Apple M1.


Back in December 2019 when they started their work on version 1.X of smpd, Audio over Ether wasn't available yet and therefore they're still relying on EVL as follows:

RPi4版は、Xenomaiの後継ソフトであるEVLを採用することにしました。

https://evlproject.org/

Xenomaiのメンテナの1人であるPhilippe Gerumさんが開発を進めているソフトです。 PhilippeさんはXenomaiのarm/arm64向けパッチの大半をコミットしてきた方で、メーリングリストで"今後はEVLに注力する"と発言されてらっしゃいました。


XenomaiカーネルではPi4でUSB利用時にハングアップする現象を回避することができませんでしたが、EVLではカーネルにパッチを当てることでUSBも動作するようになりました。(あくまで応急処置に過ぎず、安定動作とまではいきませんが、、、外付けSSDが実用レベルになりましたので開発が捗ります)

年末年始に、aplay-rt/rtalsa/xsinkをEVLに移植する作業に取り掛かりたいと思います。


RPi4版のスペックは

  • Linuxカーネル 5.x系を採用
  • リアルタイムカーネルにEVLを採用
  • カーネル/アプリケーションは全て64bitでビルド
  • RPi4専用のビルドオプションを使用
  • コンパイラにgcc9.2 (またはgcc10)を採用
  • EVL向けにデバイスドライバを新規開発

となりそうです。

And then they decided to change the directions in mid-March 2021 since future versions of smpd wouldn't require several key components anymore, the advantages of implementing Audio over Ether should give them to opportunity to drop EVL / Xenomai / RTDM driver / aplay-rt etc. altogether due to a lower (thanks to Remote Direct Memory Access of Audio over Ether) playback load:

低負荷をもう一段掘り下げるためにXenomai廃止・RTDMドライバ廃止・aplay-rt廃止を計画しております。そのプロジェクトの一環としてDoP256にも対応していくというスタンスで臨みたいと思います。


Xenomaiカーネルそれ自体が少なからずオーバーヘッドを生じますので、Xenomai専用ソフト・Xenomai専用ドライバが不要であるならXenomaiカーネルは無いに越したことがありません。

AoEによって、PCM再生をごくシンプルな仕組みに落とし込むことができました。入り口(=NIC)から物理メモリにDMA転送、そこからさらに出口(=シリアライザ)へDMA転送という具合ですから、CPUを一切介さずにハードウェアからハードウェアへ直接データが流れていき、それで再生が完結します。

現状のRTDMドライバが何をしているかというと、DMAコントローラに転送指示を出すという役割を担っています。 これはAoEパケットを受信するタイミングでも可能なものですので、これらの処理を全てnetmapドライバ・aoeserverの方に実装してしまえば、Xenomaiは不要になる見込みです。

Further updates in late-March 2021 as shown below:

今回のアップデートは音質向上を目的としたものです。 不要な処理を一つ一つ剥がしていき、将来的にXenomaiを完全に取り除くための第一歩、、、といったところです。


これまでのRTDMドライバー(rtalsa.ko)は、シングル構成での再生とAoEでの再生の両方をサポートしていました。(aoeserverを起動するとAoEモードに切り替わるような作りです)

β19ではAoEのみに特化させ、シングル構成用のロジックを極力取り除きました。これと合わせてシングル構成用のxsinkドライバも削除しています。 これによりRTDMドライバーのバイナリは3割ほど軽量化されています。

さらに、aoeserver・RTDMドライバー・netmapドライバーの三者が相互に参照している重要データ(AoEパケットの格納先アドレスを管理しているテーブル)がCPUキャッシュをうまく活用できるようにプログラムを改良しました。

このような対策により、分岐予測成功率とCPUキャッシュヒット率が改善し、処理性能が大きく改善しています。


β18までのAoE実装は、smpdの再生エンジン(aplay-rt/rtalsa/xsink)をベースにしてそこへAoEを外付けするような構成でした。言うなればAoE実装の第一世代です。

この第1世代でPCMデータのメモリ間コピーを完全に排除することに成功し、CPUサイクル消費量・メモリアクセス量の大幅な低減によってAoEのコンセプトを実証するものとなりました。

その一方で、再生エンジン側が受け持っている処理はアンダークロック化・1コア化に追随できなくなってきておりました。


AoE実装の第2世代は、従来の再生エンジンを全て取り去り、AoEネイティブな実装としていきます。

割り込みハンドラがAoEパケットを取り回し、ハードウェア(NIC)からハードウェア(I2Sシリアライザ)へとDMAでデータが中継されていくだけで音楽再生が完結するという、極めてシンプルなものになる予定です。 ここに至った段階でベータテストを終了とし、AoEを正式版としてリリースしたいと思います。

Not having to implement EVL would save Sam quite a bit of time when we don't even know if that were compatible with Apple M1 to begin with, therefore it should be easier to get things done with pCP if I weren't mistaken.

Actually it would be fantastic if we're able to combine the power of Sam's tuning of the Linux kernel, followed by the low playback load of Audio over Ether, as well as soundcheck's tuning kit available here:

https://github.com/klslz/tuningkitpcp

Once we've got access to the synergistic effect of Apple M1's 5-nanometer CPU performance and also multiple software mentioned above, most likely we should be able to create something that's superior to the Windows 10 / JPLAY combo:

https://www.my-hiend.com/vbb/showthread.php?5404-走向超值而極緻的-HI-FI電腦訊源(連載)&p=243472#post243472

Of course the Quantum version could bring something even better to the table when we're compiling the source code ourselves with properly powered hardware, though we might have to wait until the pandemic is over.

lovehifi commented 3 years ago

Hi starchivore, Thank you for sharing your projects.

I'm talking to some members @ HDVN, when I have the info I'll send you later.

Hi Sam, By the way, I have finished adding TC, Aplayer, AP to your piCorePlayer6.1.0-Noel. You can try it here.. (sorry, I set it to overclock: none, because my Pi 4 v1.1 above 65°C).

Members of @ My-hiend, stsd99 can try it.

sam0402 commented 3 years ago

Hi Lovehifi, Thank you for sharing the Noel_AP_TC Version. This is good news for the members of my-hiend and STSD99.

lovehifi commented 3 years ago

Hi Sam, More info Tidal Connect: https://github.com/shawaj/HiTide/blob/main/install.sh https://github.com/shawaj/ifi-tidal-release I port TC from that source to PiCorePlayer.

Play directly from Tidal App (phone/PC) to PicorePlayer (not through a 3rd app, for the music highest quality).

https://tidal.com/connect

With piCorePlayer6.1.0-Noel (TC,AP):

  1. Setting DAC
  2. AP port: 7778, Setting number card (DAC)
  3. Open your Tidal app play to PiCore connect.
starchivore commented 3 years ago

https://www.my-hiend.com/vbb/showthread.php?13157-piCorePlayer6-1-0-Xenomai-44-1-48KHz雙機入門簡易安裝教學

Oh my goodness, the entire thread disappeared earlier today.

Is it still OK to share piCorePlayer or not?

marcgarciamarti commented 1 year ago

Hi Sam, More info Tidal Connect: https://github.com/shawaj/HiTide/blob/main/install.sh https://github.com/shawaj/ifi-tidal-release I port TC from that source to PiCorePlayer.

Play directly from Tidal App (phone/PC) to PicorePlayer (not through a 3rd app, for the music highest quality).

https://tidal.com/connect

With piCorePlayer6.1.0-Noel (TC,AP):

  1. Setting DAC
  2. AP port: 7778, Setting number card (DAC)
  3. Open your Tidal app play to PiCore connect.

Hi there! did you ever manage to get this to work with pCP?

sam0402 commented 1 year ago

Hi Marcgarciamarti, I have no Tidal account, and Tidal does not serve for Taiwan. So I will not port TC on picoreplayer in short term.

marcgarciamarti commented 1 year ago

Hi Marcgarciamarti, I have no Tidal account, and Tidal does not serve for Taiwan. So I will not port TC on picoreplayer in short term.

Hi Sam! If you can't create an account from where you are, I can aid in creating one trial account and have it point your email address. Trial accounts typically allow 30 days of enjoying premium features. Would this help?

thanks!