mpdPup - Simplified MPD Music Server/Jukebox - v0.9.3
I got an E-MU 0404 USB "sound card" for testing, which is used as external DAC, and I need to get it working with mpdPup.
It works (kind of) - the problem is that it does NOT swich sample rates automatically: I need to use "alsamixer" and manually set "Clock rate", where e.g. 100% is used for hi-res 24/192 sample rates, and if I turn it off completely, then it's good for playing 16/41... So, for every track that uses different sample rate, I should change clock rate in alsamixer manually
If I use wrong sample rate ("Clock rate") while playing track with a different sample rate (e.g. when I use a 100% setting in alsamixer for a track which has 16/41 rate), I get horribly distorted, tinny sound.
On other newer Linux distros this DAC/sound card seems to be working OK (i.e. sample rate is switched/changed automatically, without the need for "manual" intervention).
Anyone has any idea what could be done to solve this in mpdPup - i.e. to handle the sample rate (clock rate) automatically?
It works (kind of) - the problem is that it does NOT swich sample rates automatically: I need to use "alsamixer" and manually set "Clock rate", where e.g. 100% is used for hi-res 24/192 sample rates, and if I turn it off completely, then it's good for playing 16/41... So, for every track that uses different sample rate, I should change clock rate in alsamixer manually
If I use wrong sample rate ("Clock rate") while playing track with a different sample rate (e.g. when I use a 100% setting in alsamixer for a track which has 16/41 rate), I get horribly distorted, tinny sound.
On other newer Linux distros this DAC/sound card seems to be working OK (i.e. sample rate is switched/changed automatically, without the need for "manual" intervention).
Anyone has any idea what could be done to solve this in mpdPup - i.e. to handle the sample rate (clock rate) automatically?
- Attachments
-
- alsamix-emu0404.jpg
- alsamixer E-MU 0404 USB
- (34.9 KiB) Downloaded 3447 times
any ideas how to upgrade?
Looks like Ildose is busy or taking a well deserved break.
Does anyone know how to upgrade MPDPUP to use MPD 18?
Does anyone know how to upgrade MPDPUP to use MPD 18?
Well, further to my problem with E-MU 0404 USB DAC:
- I tried compiling newer alsa (alsa-driver, alsa-firmware, etc.), but to no avail: the compiled alsa-driver throws errors when used (and I seem to be missing "alsamixer"), so I gave that up
But, since this is Linux we're dealing with, I realized that there's more ways to skin a cat
If I can't make this DAC "behave" properly, I could do a "manual" change of DAC sample rate on every track change - and automate it!
I'm working on a bash script that will take output from
where the output of the above command looks like this:
and, taking just the first two digits after the equal sign, see which sample rate the track uses, compare it to currently active DAC sample rate, and change it accordingly if it differs... It should all be done during the first half a second of the new track, so that there's no audible "glitches"...
Easier said than done.... I'm still struggling (never did any bash scripting to speak of), but I'm getting close...
Unless anyone has a better idea?
- I tried compiling newer alsa (alsa-driver, alsa-firmware, etc.), but to no avail: the compiled alsa-driver throws errors when used (and I seem to be missing "alsamixer"), so I gave that up
But, since this is Linux we're dealing with, I realized that there's more ways to skin a cat
If I can't make this DAC "behave" properly, I could do a "manual" change of DAC sample rate on every track change - and automate it!
I'm working on a bash script that will take output from
Code: Select all
cat /proc/asound/card1/stream0 | grep Momentary
Code: Select all
Momentary freq = 44098 Hz (0x5.8320)
Easier said than done.... I'm still struggling (never did any bash scripting to speak of), but I'm getting close...
Unless anyone has a better idea?
Re: any ideas how to upgrade?
- second that.wlowes wrote:Looks like Ildose is busy or taking a well deserved break.
Hope everything is well, Idolse -
- enjoying the fruit of your work almost daily
Re: any ideas how to upgrade?
We haven't heard from Idolse in a while, I sure do hope he's OK..willemoes wrote:
- second that.
Hope everything is well, Idolse -
- enjoying the fruit of your work almost daily
Likewise, I am enjoying his work on mpdPup on a daily basis
And, Idolse, please contact me at
denple AT gmail.com
- I promised you a hardware donation, which is still waiting for you
Yes if you can post it Denis P that would be good to have a look at the Emu chip.
If you could get that analogue input pin going even better, I don't think the Alsa people have quite finished the job on the Emu chip, but it is pretty good when used with Jack and audio programs. Up to 192khz available (if anyone can spot the difference between 88.2khz+192khz).
If you could get that analogue input pin going even better, I don't think the Alsa people have quite finished the job on the Emu chip, but it is pretty good when used with Jack and audio programs. Up to 192khz available (if anyone can spot the difference between 88.2khz+192khz).
Well, here's the script. Perhaps I should not post such ugly hacks, but, hey - it worksSmithy wrote:Yes if you can post it Denis P that would be good to have a look at the Emu chip.
Unfortunately, I had to return the E-MU 0404 device - I just had to make it work for someone else. Hopefully, the owner will be satisfied...
Anyway, here's the script:
Code: Select all
#!/bin/bash
# if this is the first run, EMU-rate does not exist,create it
if [ ! -f /dev/shm/EMU-rate ]; then # file does not exist
echo "00" > /dev/shm/EMU-rate
fi
while : ; do
mpc idle
# stuff below executes when mpc is not idle
sleep 0.4 # wait for actual track to start playing (fist 0,4 sec., to determine the sample rate)
old_rate=$(cat /dev/shm/EMU-rate)
# echo "old rate:$old_rate"
sRateStr=$(cat /proc/asound/card1/stream0 | grep Momentary)
# echo "full line: " $sRateStr
cur_rate=${sRateStr:21:2} # here we get just the first two digits (44, 48, 96, etc.)
# echo "cur rate:$cur_rate"
# if $cur_rate is empty, next iteration ("continue")
if [ -z "$cur_rate" ] # string is empty
then
# echo "No song playing"
continue # $cur_rate is null/empty, nothing to do, wait for next iteration
fi
# echo "Track sample rate: $cur_rate"
if [ "$old_rate" = "$cur_rate" ]
then
# echo "The rates are the same"
continue # rates are the same, nothing to do, wait for next iteration
fi
# here we actually compare rates and take appropriate action (change EMU clock rate using "amixer")
# E-MU 0404 is visible as "card 1" on my system, i.e. it needs switch "-c1" for manipulation
case $cur_rate in
44)
amixer -c1 set 'Clock rate Selector' 0
echo "$cur_rate" > /dev/shm/EMU-rate
continue
;;
48)
amixer -c1 set 'Clock rate Selector' 1
echo "$cur_rate" > /dev/shm/EMU-rate
continue
;;
88)
amixer -c1 set 'Clock rate Selector' 2
echo "$cur_rate" > /dev/shm/EMU-rate
continue
;;
96)
amixer -c1 set 'Clock rate Selector' 3
echo "$cur_rate" > /dev/shm/EMU-rate
continue
;;
17)
amixer -c1 set 'Clock rate Selector' 4
echo "$cur_rate" > /dev/shm/EMU-rate
continue
;;
19)
amixer -c1 set 'Clock rate Selector' 5
echo "$cur_rate" > /dev/shm/EMU-rate
continue
;;
esac
echo "$cur_rate" > /dev/shm/EMU-rate
done
The reason is simple: "00" (two zeros) are intentionally WRONG - so that any sample rate that the E-MU "wakes up" with when it's turned on will show that the sample rates (of the currently playing song and the one written as "previous" in the E-MU sample rate file under /dev/shm) are always different, and the rest of the script (automatic adjustment) is always invoked... I think I had some problems without that solution...Smithy wrote:Looks alright to me Denis P, especially as it did the job!
Just wondering,
did you think that it was possible to add 16khz and 22khz or does the first zero switch mean that the lowest it would go was 44.1 khz?
So, it's just something I thought would take care of the situation when "/dev/shm/EMU-rate" file does not yet exist (when the computer is turned on), and the first song is e.g. in 24/192 (I think that the E-MU "wakes up" with sample rate 16/48 by default....).
As for other sample rates, the guy using it does not have any tracks with sample rates below 16/41, and in general does not listen to MP3 tracks (and those are usually in 320Kbps) - so there was no need to add any other sample rates.
The E-MU supports the following rates (with corresponding settings in alsamixer "Clock rate Selector"):
Code: Select all
Clock rate Sample rate "/dev/shm/EMU-rate"
setting shorthand code
0 44100 44
1 48000 48
2 88200 88
3 96000 96
4 176400 17
5 192000 19
Still enjoying it
For the record, I continue to enjoy this version of mpdpup.
I will likely need to move on to get to newer release, but as of this day, still enjoying it.
Thanks Ildose..
I will likely need to move on to get to newer release, but as of this day, still enjoying it.
Thanks Ildose..
So do I. With my Alix 1, SOTM USB card and two linear power supplies I still think it is among the best quality music server out there. And I listened to many others including some that are sold for big bucks ...
Anyone out there who knows how to compile an upgraded version with latest alsa and mpd versions? I would be game to create that, but I am missing a bit of detailed knowledge on how to tackle something like that..
Anyone out there who knows how to compile an upgraded version with latest alsa and mpd versions? I would be game to create that, but I am missing a bit of detailed knowledge on how to tackle something like that..
mpdpup
Here's another great fan and user of mpdpup! Sad to see there is no development anymore. I hope idolse is ok and in good health!? He has made a terrific piece of software. Together with the app mpad it's the best i know. It has given me many many hours of musical pleasure!
stepped over to Runeaudio
Hi Walter, good to 'hear' from you! This spring I stepped over to Raspberry Pi and Runeaudio. In my setup this bested atom-mpdpup.
Now i'm tinkering with Hummingboard-Volumio (but didn't yet succeed to mount the NAS).
I'm looking out to a real digital DIY kit like
http://hifimediy.com/amplifiers/ready-m ... -amplifier
It would be great to go from I2S to analogue in 1 step (no USB, no SPDIF, no DAC, just I2s to analogue in 1 chip!)
Have fun, all!
Douwe
Now i'm tinkering with Hummingboard-Volumio (but didn't yet succeed to mount the NAS).
I'm looking out to a real digital DIY kit like
http://hifimediy.com/amplifiers/ready-m ... -amplifier
It would be great to go from I2S to analogue in 1 step (no USB, no SPDIF, no DAC, just I2s to analogue in 1 chip!)
Have fun, all!
Douwe
Mpdpuppy and Brutefir
Hi all,
I am very sad that we have not seen Idolse in last months.
I have a problem but I think that it is very unlikely that I will find a solution.
There's anybody, please , that can guide me step by step in Brutefir installation and configuration with mpdpup?
I hope...
I am very sad that we have not seen Idolse in last months.
I have a problem but I think that it is very unlikely that I will find a solution.
There's anybody, please , that can guide me step by step in Brutefir installation and configuration with mpdpup?
I hope...
-
- Posts: 33
- Joined: Sat 28 Jul 2012, 17:52
Help help help
I know that this distro is dead far long time ago...bit is the best player i've heard!!!
I only Need to integrate brutefir in It!!! Can anyone help me with a step by step guide for newbye???
I only Need to integrate brutefir in It!!! Can anyone help me with a step by step guide for newbye???