How To Make All Output 16 Bit?

Raspberry Pi related support

How To Make All Output 16 Bit?

Postby R101 » 23 Jul 2018, 11:42

I need a Rune player which will always output 16 bits, and would be grateful for some help.

A previous posting by Frank implies that adding
Code: Select all
 format "*:16:*"
to /etc/mpd.conf and restarting mpd will do this temporarily, but root does not have permission to edit the file, or to change the permissions.

My USB interface is not listed in /srv/http/db/redis_acards_details, so how would I make the configuration permanent?
(Pi 3B, rAudio-1, JLS I2S over USB)
R101
 
Posts: 343
Joined: 29 Apr 2016, 16:16

Re: How To Make All Output 16 Bit?

Postby hondagx35 » 23 Jul 2018, 18:01

Hi R101,

, but root does not have permission to edit the file, or to change the permissions.

Root should have the permission to change mpd.conf.
If not you changed something or your filesystem is read only.
Try:
Code: Select all
chattr -i /etc/mpd.conf


My USB interface is not listed in /srv/http/db/redis_acards_details, so how would I make the configuration permanent?

Post your debug info and i will try to help you to find the correct entries for "redis_acards_details".

Frank
User avatar
hondagx35
 
Posts: 3042
Joined: 11 Sep 2014, 22:06
Location: Germany

Re: How To Make All Output 16 Bit?

Postby R101 » 23 Jul 2018, 20:53

Thanks Frank. My mpd.conf is now writeable, but adding the format line to the file and restarting mpd does not make any difference. If I play an mp3 stream, the playback display shows 24 bit, and this is confirmed with a 'scope on the hardware.

I would be interested to know how this should work. Does MPD re-quantize the output from whatever software decodes the mp3, or does it instruct the mp3 decoder to output 16 bits?



https://pastebin.com/Wi7L6Dg6
(Pi 3B, rAudio-1, JLS I2S over USB)
R101
 
Posts: 343
Joined: 29 Apr 2016, 16:16

Re: How To Make All Output 16 Bit?

Postby s.k. » 24 Jul 2018, 08:12

Hi,
I think this will do the trick
http://www.runeaudio.com/forum/using-soxr-resampling-with-rune-0-4-beta-t5835.html
If you have upgrade the MPD to the latest, maybe it works just with the new entrys on mpd.conf
Give a try
8-)
RPi2B Rev 1.1, Allo DigiOne, ATXRaspi, 16x2 OLED display - running rAudio
s.k.
 
Posts: 113
Joined: 04 Jan 2017, 08:38

Re: How To Make All Output 16 Bit?

Postby R101 » 24 Jul 2018, 11:09

Thanks s.k., but I previously tried using soxr that way and could not get it to work. MPD just seems to ignore the added mpd.conf entries. As my music files are mostly 16 bit flac, the ideal solution would be to decode all non-PCM streams to 16 bit PCM rather than 24 bit, so that there is no need to re-quantize. I do not know if that is possible.
(Pi 3B, rAudio-1, JLS I2S over USB)
R101
 
Posts: 343
Joined: 29 Apr 2016, 16:16

Re: How To Make All Output 16 Bit?

Postby hondagx35 » 24 Jul 2018, 17:08

Hi R101,

i did a quick test and it works like it should.
The info on the playback screen is not the actual playing format it is the format from the file.

Playing a 32 Bit File with untouched mpd.conf
Code: Select all
audio_output {
        name            "PianoDACPlus"
        type            "alsa"
        device          "hw:1,0"
        mixer_control   "Digital"
        mixer_type      "hardware"
        mixer_device    "hw:1"
        auto_resample   "no"
        auto_format     "no"
        format "*:16:*"
}


Code: Select all
cat /proc/asound/card*/pcm*p/sub*/hw_params

Code: Select all
closed
closed
closed
closed
closed
closed
closed
closed
closed
access: RW_INTERLEAVED
format: S32_LE
subformat: STD
channels: 2
rate: 192000 (192000/1)
period_size: 16384
buffer_size: 65536


Now with modified mpd.conf
Code: Select all
audio_output {
        name            "PianoDACPlus"
        type            "alsa"
        device          "hw:1,0"
        mixer_control   "Digital"
        mixer_type      "hardware"
        mixer_device    "hw:1"
        auto_resample   "no"
        auto_format     "no"
        format "*:16:*"
}


Code: Select all
cat /proc/asound/card*/pcm*p/sub*/hw_params

Code: Select all
closed
closed
closed
closed
closed
closed
closed
closed
closed
access: RW_INTERLEAVED
format: S16_LE
subformat: STD
channels: 2
rate: 192000 (192000/1)
period_size: 16384
buffer_size: 65536


Frank
User avatar
hondagx35
 
Posts: 3042
Joined: 11 Sep 2014, 22:06
Location: Germany

Re: How To Make All Output 16 Bit?

Postby R101 » 24 Jul 2018, 21:28

Hi Frank,

I have tried again, but nothing changes whether mpd.conf is modified or not. Files and streams retain their native bit depth all the way up to 32 bits. I was interested to see that AAC is decoded to 32 bits. I think I owe janui an apology for dismissing his reply on a previous thread about Sox. It looks as if this is just the way XMOS USB works.

I can choose the bit depth of the PCM files I play, but mp3/m4a decoder outputs are a problem unless the decoder output format can be configured somehow.

My output of cat /proc/asound/card*/pcm*p/sub*/hw_params does not change at all.

Code: Select all
root@runeaudio(rw):~# cat /proc/asound/card*/pcm*p/sub*/hw_params
access: RW_INTERLEAVED
format: S32_LE
subformat: STD
channels: 2
rate: 44100 (44100/1)
period_size: 5513
buffer_size: 22050
closed
closed
closed
closed
closed
closed
closed
closed
closed
root@runeaudio(rw):~#
(Pi 3B, rAudio-1, JLS I2S over USB)
R101
 
Posts: 343
Joined: 29 Apr 2016, 16:16

Re: How To Make All Output 16 Bit?

Postby tml3nr » 25 Jul 2018, 04:25

hondagx35 wrote:Hi R101,

i did a quick test and it works like it should.
The info on the playback screen is not the actual playing format it is the format from the file.

Playing a 32 Bit File with untouched mpd.conf
Code: Select all
audio_output {
        name            "PianoDACPlus"
        type            "alsa"
        device          "hw:1,0"
        mixer_control   "Digital"
        mixer_type      "hardware"
        mixer_device    "hw:1"
        auto_resample   "no"
        auto_format     "no"
}


Code: Select all
cat /proc/asound/card*/pcm*p/sub*/hw_params

Code: Select all
closed
closed
closed
closed
closed
closed
closed
closed
closed
access: RW_INTERLEAVED
format: S32_LE
subformat: STD
channels: 2
rate: 192000 (192000/1)
period_size: 16384
buffer_size: 65536


Now with modified mpd.conf
Code: Select all
audio_output {
        name            "PianoDACPlus"
        type            "alsa"
        device          "hw:1,0"
        mixer_control   "Digital"
        mixer_type      "hardware"
        mixer_device    "hw:1"
        auto_resample   "no"
        auto_format     "no"
        format "*:16:*"
}


Code: Select all
cat /proc/asound/card*/pcm*p/sub*/hw_params

Code: Select all
closed
closed
closed
closed
closed
closed
closed
closed
closed
access: RW_INTERLEAVED
format: S16_LE
subformat: STD
channels: 2
rate: 192000 (192000/1)
period_size: 16384
buffer_size: 65536


Frank

Sorry for thread hijack. But contents in untouched mpd.conf and modified mpd.conf are the same?
tml3nr
 
Posts: 56
Joined: 02 Apr 2016, 07:43

Re: How To Make All Output 16 Bit?

Postby R101 » 25 Jul 2018, 13:04

Well spotted tml3nr!

Frank,

I think I might have found the answer. It looks as if it is the XMOS interface which has to demand 16 bit from Rune, rather than the other way round. I had the interface set to have a left justified output. This passes on any bit depth sent from Rune, up to 32 bits. If I set the interface to output right justified 16 bits, that is what I get, whatever the input source and whether or not mpd.conf is modified.

I might have overlooked something, so no celebration yet, but there does not appear to be any crude truncation taking place.
(Pi 3B, rAudio-1, JLS I2S over USB)
R101
 
Posts: 343
Joined: 29 Apr 2016, 16:16

Re: How To Make All Output 16 Bit?

Postby hondagx35 » 25 Jul 2018, 16:07

Hi tml3nr,

thanks for pointing that out.

Frank
User avatar
hondagx35
 
Posts: 3042
Joined: 11 Sep 2014, 22:06
Location: Germany

support RuneAudio Donate with PayPal

Next

Return to Raspberry Pi

Who is online

Users browsing this forum: No registered users and 1 guest