• WANTED: Happy members who like to discuss audio and other topics related to our interest. Desire to learn and share knowledge of science required. There are many reviews of audio hardware and expert members to help answer your questions. Click here to have your audio equipment measured for free!

RPi4 + CamillaDSP Tutorial

melomane13

Active Member
Joined
Jul 24, 2023
Messages
100
Likes
71
Location
France
Thank you now it works but:

i scan an Button it is this:
'KEY_MIN_INTERESTING', 'KEY_MUTE'
i put it in the flirc.py Script instead of KEY_RIGHT but it didn't work ???

now i will try KEY_RIGHT again if its work than ....

Strange things happen:

KEY_RIGHT works, also KEY_SELECT for Mute

But not

'KEY_MIN_INTERESTING' or 'KEY_MUTE'

This are all scanned Keys on my Remote:

Select devices [0-5]: 5
Listening for events (press ctrl-c to exit) ...
time 1712162823.782942 type 4 (EV_MSC), code 4 (MSC_SCAN), value 786498
time 1712162823.782942 type 1 (EV_KEY), code 103 (KEY_UP), value 1
time 1712162823.782942 --------- SYN_REPORT --------
time 1712162823.974961 type 4 (EV_MSC), code 4 (MSC_SCAN), value 786498
time 1712162823.974961 type 1 (EV_KEY), code 103 (KEY_UP), value 0
time 1712162823.974961 --------- SYN_REPORT --------
time 1712162826.695103 type 4 (EV_MSC), code 4 (MSC_SCAN), value 786499
time 1712162826.695103 type 1 (EV_KEY), code 108 (KEY_DOWN), value 1
time 1712162826.695103 --------- SYN_REPORT --------
time 1712162826.759118 type 4 (EV_MSC), code 4 (MSC_SCAN), value 786499
time 1712162826.759118 type 1 (EV_KEY), code 108 (KEY_DOWN), value 0
time 1712162826.759118 --------- SYN_REPORT --------
time 1712162828.583215 type 4 (EV_MSC), code 4 (MSC_SCAN), value 786501
time 1712162828.583215 type 1 (EV_KEY), code 106 (KEY_RIGHT), value 1
time 1712162828.583215 --------- SYN_REPORT --------
time 1712162828.775225 type 4 (EV_MSC), code 4 (MSC_SCAN), value 786501
time 1712162828.775225 type 1 (EV_KEY), code 106 (KEY_RIGHT), value 0
time 1712162828.775225 --------- SYN_REPORT --------
time 1712162829.83128 type 4 (EV_MSC), code 4 (MSC_SCAN), value 786500
time 1712162829.83128 type 1 (EV_KEY), code 105 (KEY_LEFT), value 1
time 1712162829.83128 --------- SYN_REPORT --------
time 1712162830.023297 type 4 (EV_MSC), code 4 (MSC_SCAN), value 786500
time 1712162830.023297 type 1 (EV_KEY), code 105 (KEY_LEFT), value 0
time 1712162830.023297 --------- SYN_REPORT --------
time 1712162832.263417 type 4 (EV_MSC), code 4 (MSC_SCAN), value 786497
time 1712162832.263417 type 1 (EV_KEY), code 353 (KEY_SELECT), value 1
time 1712162832.263417 --------- SYN_REPORT --------
time 1712162832.359423 type 4 (EV_MSC), code 4 (MSC_SCAN), value 786497
time 1712162832.359423 type 1 (EV_KEY), code 353 (KEY_SELECT), value 0
time 1712162832.359423 --------- SYN_REPORT --------
time 1712162833.351487 type 4 (EV_MSC), code 4 (MSC_SCAN), value 786496
time 1712162833.351487 type 1 (EV_KEY), code 139 (KEY_MENU), value 1
time 1712162833.351487 --------- SYN_REPORT --------
time 1712162833.543494 type 4 (EV_MSC), code 4 (MSC_SCAN), value 786496
time 1712162833.543494 type 1 (EV_KEY), code 139 (KEY_MENU), value 0
time 1712162833.543494 --------- SYN_REPORT --------
time 1712162834.535552 type 4 (EV_MSC), code 4 (MSC_SCAN), value 786658
time 1712162834.535552 type 1 (EV_KEY), code 113 (['KEY_MIN_INTERESTING', 'KEY_MUTE']), value 1
time 1712162834.535552 --------- SYN_REPORT --------
time 1712162834.663552 type 4 (EV_MSC), code 4 (MSC_SCAN), value 786658
time 1712162834.663552 type 1 (EV_KEY), code 113 (['KEY_MIN_INTERESTING', 'KEY_MUTE']), value 0
time 1712162834.663552 --------- SYN_REPORT --------

I gues i need to bind this key to an other function on Flirc Software ;)

Robert
elif attrib.keycode == ['KEY_MIN_INTERESTING', 'KEY_MUTE']:
 

Frunse

Active Member
Joined
Feb 21, 2024
Messages
133
Likes
20
elif attrib.keycode == ['KEY_MIN_INTERESTING', 'KEY_MUTE']:
OK i will try this :)

It works fine now!

Thank You a lot.

That i would never suggested this way.....
But the Key Scan showed it this way and i was blind ...LOL

Robert
 
Last edited:

Wirrunna

Member
Joined
May 27, 2021
Messages
93
Likes
45
Location
South Coast, NSW, Australia
Frunse, attached are the flirc files from my RPi5 system, the username for CamillaDSP on my system is "camilla" - easy to remember but maybe a bit confusing at first.
 

Attachments

  • flirc.zip
    1 KB · Views: 14
Last edited:

Frunse

Active Member
Joined
Feb 21, 2024
Messages
133
Likes
20
Frunse, attached are the flirc files from my RPi5 system, the username for CamillaDSP on my system is "camilla" with password of "cam1lla" - easy to remember but maybe a bit confusing at first.
I got one already form First Side of this Forum, its working fine now but thanks.

Now i need to know why you provide me youre Password?
Its only the flirc.py in that Package, i can copy and place it to my flirc.py.
Dont need Password for that, so i am again a bit confused ;)
like alwasy LOL

Robert
 

terryforsythe

Senior Member
Forum Donor
Joined
May 4, 2022
Messages
492
Likes
517
Only issue to be aware of is that the MCHStreamer has different clocking options, it can either use it's own internal clock or a clock derived from the SPDIF input. You can change the clocking via amixer or alsamixer. It's been a while since I used the MCHStreamer but I think it has issues if you attempt to start CamillaDSP with the clocking set to SPDIF input but no SPDIF input is present. Could probably write a simple script to always start using the internal clock and then switch to the SPDIF clock if you are using a SPDIF input.
I have been playing around with the MCHStreamer and CamillaDSP. Even using the SPDIF clock, sample rate changes mess things up. E.g., I set my WiiM to stream at 192k/24-bit. That works for songs Tidal is actually streaming at that rate, but if Tidal changes the sample rate on their end (it varies from recording to recording) the song comes out garbled, even if the MCHStreamer is set in alsamixer to use the SPDIF clock. Everything works fine, though, if I set the WiiM to output 44.1k/24-bit.

I put in a support ticket to miniDSP requesting a firmware update to get the MCHStreamer to output a 'Capture Rate' control to ALSA. If they do that, theoretically I should be able to use camilladsp-setrate to automatically initiate CamillaDSP to change to the proper configuration file for the received sample rate.

We'll see if miniDSP implements the requested firmware update. It doesn't seem like it would take too much work on their part since the MCHStreamer already outputs a number of controls to ALSA and only one additional control is needed, but I'm not a programmer, so this is only speculation on my part.

Thank you, Michael, for all of your help and contribution!!!!!
 
OP
M

mdsimon2

Major Contributor
Forum Donor
Joined
Oct 20, 2020
Messages
2,516
Likes
3,380
Location
Detroit, MI
I have been playing around with the MCHStreamer and CamillaDSP. Even using the SPDIF clock, sample rate changes mess things up. E.g., I set my WiiM to stream at 192k/24-bit. That works for songs Tidal is actually streaming at that rate, but if Tidal changes the sample rate on their end (it varies from recording to recording) the song comes out garbled, even if the MCHStreamer is set in alsamixer to use the SPDIF clock. Everything works fine, though, if I set the WiiM to output 44.1k/24-bit.

I put in a support ticket to miniDSP requesting a firmware update to get the MCHStreamer to output a 'Capture Rate' control to ALSA. If they do that, theoretically I should be able to use camilladsp-setrate to automatically initiate CamillaDSP to change to the proper configuration file for the received sample rate.

We'll see if miniDSP implements the requested firmware update. It doesn't seem like it would take too much work on their part since the MCHStreamer already outputs a number of controls to ALSA and only one additional control is needed, but I'm not a programmer, so this is only speculation on my part.

Thank you, Michael, for all of your help and contribution!!!!!

Sample rate changes on SPDIF always seem to be an issue and it would be assume if that firmware update goes through!

As it stands I think a constant sample rate source (i.e AppleTV at 48 kHz or Wiim set to 44 kHz max) is the way to go with CamillaDSP.

Michael
 

KrafKloot

Member
Joined
Oct 12, 2023
Messages
17
Likes
3
Is there any progress with using HDMI for multichannel output for use with an AVR? There was a corresponding thread on the other site, i haven´t found the time to do my own research up until now. Would love a quick heads up though, maybe i´ll get into it.
 

MCH

Major Contributor
Joined
Apr 10, 2021
Messages
2,666
Likes
2,282
Is there any progress with using HDMI for multichannel output for use with an AVR? There was a corresponding thread on the other site, i haven´t found the time to do my own research up until now. Would love a quick heads up though, maybe i´ll get into it.
If you are referring to the channel swapping issue, I am not sure, there hasn't been much activity in the relevan raspberry pi forum thread . Maybe @Nisse10000 @oomzay @phofman have some news

 

Frunse

Active Member
Joined
Feb 21, 2024
Messages
133
Likes
20
Sample rate changes on SPDIF always seem to be an issue and it would be assume if that firmware update goes through!

As it stands I think a constant sample rate source (i.e AppleTV at 48 kHz or Wiim set to 44 kHz max) is the way to go with CamillaDSP.

Michael
The Problem is if you use Multichannel HDMI in to Camilla there are different Sound Formats.
I have DAD, Blueray, and SACD that i can Play on my Bluerayplayer as an PCM Streem,
I am not sure that it has an Output samplerate that i can Setup. (And i guess it isn't kapabel to resample an 7.1 48kHz Outputstreem to 7.1 96kHz)
So i will use an Arduino UNO to detect the incomming Samplerate on I2S 1 (Raspberry 5,Multichannel and Stereo) and switch to an dedicated Camilla Setup for the right Samplerate by Adruino.
The detection works already, wait for ordered Parts than i will work on an Board for Raspberry with the Detection and I2S Switch with 4 or may be more D-Latches for more I2S Inputs. Probably not an Hat but an Board that could conected with an short Flat Cable to an Raspberry.
I use an EDATEC Aluminium closed Case and an SSD Hat already so an Flat short Cable (with right Raspberry Connector) would be for me the best option.

Its all on the way ;)

I use this Threat as an starting Point:
https://github.com/raptorlightning/I2S-Hat

Adapted it to my needings and working on an Prototype right now with an 4x20 Character I2C display and I2C Port extension (2x PCF8574 for I/O to Raspberry or directly with I2C, need to look into it) and also with an RS485 Output (9 RS485 Outs for Multipoint comunication), to all my Speaker Amps with an integrated Volumencontrol (Relais based) on that Amps.
Each Amp becomes an Arduino NANO with an ttl to RS485 Board (less than 10€ for one Amp) and 2 XLR Inputs (Ethernetkabel 4x twisted Pairs, 2 for Anaolge in (tweeter and Midbass), 1 for RS485 and 1 for ground and +12V) So i have an Central Volumecontrol on my Mediaplayer CamillaDSP Device to all Amps (7.2)

Also want to have an Flirc Remote on Raspberry and Volumecontroll to that Arduino (Up, Down, I2S Input Switching, Mute and more)

Robert
 
Last edited:

dobrynin

Member
Joined
Dec 21, 2023
Messages
22
Likes
2
Hello everyone.
I installed Camilla on RPi 3 according to the instructions from the first message. I'm streaming music on Airplay and it stutters (interrupts). Can you tell me what the problem might be?
 

Attachments

  • 2024-04-12 17.11.34.jpg
    2024-04-12 17.11.34.jpg
    113.5 KB · Views: 11
Last edited:
OP
M

mdsimon2

Major Contributor
Forum Donor
Joined
Oct 20, 2020
Messages
2,516
Likes
3,380
Location
Detroit, MI
Hello everyone.
I installed Camilla on RPi 3 according to the instructions from the first message. I'm streaming music on Airplay and it stutters (interrupts). Can you tell me what the problem might be?

View attachment 363257

Does anything appear in the log when it stutters? How often does it stutter?

I have not used the headphone output so I am not sure if this is typical.

The only thing I see in your configuration is you do not have rate adjust enabled which you will need to avoid buffer over / under runs. It may also help to increase chunk size.

Michael
 

dobrynin

Member
Joined
Dec 21, 2023
Messages
22
Likes
2
Does anything appear in the log when it stutters? How often does it stutter?

I have not used the headphone output so I am not sure if this is typical.

The only thing I see in your configuration is you do not have rate adjust enabled which you will need to avoid buffer over / under runs. It may also help to increase chunk size.

Michael
I don't know how to describe stuttering)) It plays for a few seconds and disappears for a fraction of a second, and so cyclically. I also noticed that the output signal level is very low, the volume on the amplifier needs to be raised very much.

Here's what's in the playback log:


1712938335815.png
 

phofman

Addicted to Fun and Learning
Joined
Apr 13, 2021
Messages
504
Likes
329
I wonder what the default:CARD=XXX actually does. IMO it's mixing dsnoop on capture and dmix on playback + plug. IMO it should be changed to hw:CARD=XXX, or optionally plughw:CARD=XXX.

Rate adjust - Loopback runs at RPi clock. The "headphones" PWM device integrated in the GPU part is most likely clocked from the same crystal + PLL (as there is only one crystal, IIRC).
 

dobrynin

Member
Joined
Dec 21, 2023
Messages
22
Likes
2
I wonder what the default:CARD=XXX actually does. IMO it's mixing dsnoop on capture and dmix on playback + plug. IMO it should be changed to hw:CARD=XXX, or optionally plughw:CARD=XXX.

Rate adjust - Loopback runs at RPi clock. The "headphones" PWM device integrated in the GPU part is most likely clocked from the same crystal + PLL (as there is only one crystal, IIRC).
Here are such capture and playback devices: Which ones should you choose in your opinion?
 

Attachments

  • 1.png
    1.png
    142.6 KB · Views: 19
  • 2.png
    2.png
    260.7 KB · Views: 15
Last edited:
Top Bottom