|
Home | Forums | Rules | Articles | diyAudio Store | Blogs | Gallery | Wiki | Register | Donations | FAQ | Calendar | Mark Forums Read |
PC Based Computer music servers, crossovers, and equalization |
|
Please consider donating to help us continue to serve you.
Ads on/off / Custom Title / More PMs / More album space / Advanced printing & mass image saving |
![]() |
|
Thread Tools |
![]() |
#121 |
diyAudio Member
Join Date: Apr 2005
Location: Pilsen
|
Well then the capture device is closed, the script says it clear:
Code:
while [ "$(cat /proc/asound/card3/pcm1c/sub0/status)" != "closed" ] .... done ... echo "Capture device closed. Clock rate control disabled (clk: 1000000)." |
![]() |
![]() |
#122 |
diyAudio Member
Join Date: Nov 2007
Location: Netherlands
|
Found that out too...running now
pi@realtimepi:~ $ sh softclock.sh uptime: 000000s bufsize: 8192 filled: 12% clk: 99000 |
![]() |
![]() |
#123 |
diyAudio Member
Join Date: Apr 2005
Location: Pilsen
|
Very good. Please keep us updated how fast the feedback will stabilize.
|
![]() |
![]() |
#124 |
diyAudio Member
Join Date: Nov 2007
Location: Netherlands
|
Well, to my understanding uptime,buftime and clk should update in terminal, right?
However it does not. |
![]() |
![]() |
#125 | |
diyAudio Member
Join Date: Apr 2016
Location: Lund
|
Quote:
The capture thread uses blocking io to read N samples per channel (given by buffersize setting). When done, it converts them to float, and packages them in a message that is sent in a channel to the processing thread. The channel is basically a queue shared between the treads and can hold more than one message. Once sent it goes back to reading another set of N samples. The processing thread waits for a message, does the processing and sends the processed data as a message on another channel to the playback thread. The playback thread waits for a message. Once received the data is converted to the right format for the device, and then written to the device using blocking io. Once all the data has been written, it loops around to wait for the next message. In practice the capture device is the one deciding the rate. If the playback queue will slowly grow with not yet played data. If it instead runs faster, once in a while the message will be late, meaning that the playback device will run out of data. Once a new message has been received, playback is resumed. |
|
![]() |
![]() |
#126 |
diyAudio Member
Join Date: Apr 2005
Location: Pilsen
|
Henrik, thanks a lot for the explanation. I like your 3-thread architecture, IMO the most robust and technically sound solution.
IIUC, the buffer fill (/proc) should be read from the playback soundcard, adjusting the loopback device on capture side, just like you said. |
![]() |
![]() |
#127 | |
diyAudio Member
Join Date: Apr 2005
Location: Pilsen
|
Quote:
Look at the script. The information is echoed only when new = different clkrate is identified: Code:
# set clock rate of snd-aloop if [ $clkrate -ne $lastclk ] then amixer -c 3 cset numid=7 $clkrate > /dev/null echo "uptime: "$up"s bufsize: "$loopc_bufsize" filled: "$buf_ratio"% clk: "$clkrate fi Try to print the buf_ratio to see the value: Code:
# fill rate in percent buf_ratio=$(($loopc_buf_avail*100/$loopc_bufsize)) echo "buf_ratio: $buf_ratio" # <---- You need to read buffer fill of the playback soundcard, IMO. |
|
![]() |
![]() |
#128 |
diyAudio Member
Join Date: Nov 2007
Location: Netherlands
|
Yes, for Camilladsp the playbackcard should be read, I know.
I tested this morning with brutefir. Still some glitches. |
![]() |
![]() |
#129 |
diyAudio Member
|
Please help NO !!
//
__________________
More distortion to the people! Timing . . . . is paramount. |
![]() |
![]() |
#130 |
diyAudio Member
Join Date: Jan 2010
|
Agreed. Maybe it is not necessary to cheat.
There are indeed perfect solutions already implemented into audio programs: The aforementionned playhrt player which I use in my pipe provides a parameter --extra-bytes-per-second which performs exactly what is discussed here. This parameter allows to specify a correction for the differences between the soundcard's and the computer clocks. Maybe a look into the code of playhrt could be interesting: Bitbucket |
![]() |
![]() |
Thread Tools | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
The room correction or speaker correction? What can we do with dsp power now availabl | Raimonds | Full Range | 233 | 28th January 2017 08:51 AM |
Introducing OpenDRC, Open Digital Room Correction engine | minidsp | miniDSP | 20 | 20th January 2016 06:37 PM |
What the difference between dsp room correction eq and software correction | erez1012 | PC Based | 0 | 10th March 2014 08:07 PM |
Writing a Cross-Platform, Free Software Modeling Tool and TS-Parameter DB | justinzane | Software Tools | 6 | 31st December 2013 07:55 AM |
FS: DAC, room-correction, active crossovers, amp, speakers! | taloyd | Swap Meet | 4 | 14th April 2009 04:16 PM |
New To Site? | Need Help? |