Upgrading my Chumby 8 kernel half 8: audio
After getting lots of the PXA16x peripherals working in trendy Linux kernels throughout my Chumby 8 kernel improve saga (listed below are hyperlinks to elements 1, 2, 3, 4, 5, 6, and 7), I actually felt like I used to be beginning to attain the end line. The show was working effectively sufficient to play low-resolution movies, I had fundamental 2D acceleration up and operating, the touchscreen was operational, and Wi-Fi labored flawlessly. Audio was the one main part left to sort out. The Chumby 8 has built-in audio system, a headphone jack, and a microphone.
The Linux sound subsystem is one thing I had precisely zero expertise with previous to this venture, so it felt very intimidating. It took me some time to get conversant in it. The related venture is Advanced Linux Sound Architecture (ALSA) and particularly, the ALSA System on Chip (ASoC) layer is the place most of my work can be for this venture.
Before digging in too deep, I wanted to have a look at the Chumby 8 schematics and work out what I might be coping with. With no prior audio expertise to lean on, I wasn’t certain what to anticipate. Let’s check out the related part of the schematic:

Okay, so it’s utilizing a Wolfson WM8961 audio codec. This chip was discontinued in 2013. I’m going to be sincere — this “codec” terminology confused me at first. I assumed an audio codec was extra like a knowledge format, comparable to MP3, AAC, Vorbis, and so forth. It seems it’s a kind of conditions the place {hardware} and software program folks use the identical phrase with totally different meanings. My understanding was appropriate for the software program aspect, however on the {hardware} aspect, the phrase codec is used to check with an ADC/DAC for changing between analog and digital indicators.
The manner the WM8961 works is you write a bunch of register values over I2C (the SCLK and SDIN pins) to set it up, after which ship/obtain audio information to/from it utilizing I2S. Despite the names being related, I2S will not be associated to I2C. After enjoying with it a bit, I truly assume it’s fairly much like SPI. There are a bit clock and information out and in pins identical to SPI. The important distinction is SPI has a chip choose sign to specify when the chip needs to be paying consideration, whereas I2S has an LRCLK sign that signifies which channel (left or proper) the information corresponds with.
As you may see above there are SPK_LP/LN and SPK_RP/RN outputs for the audio system. These find yourself going to a connector on the PCB the place the audio system plug in. There’s moreover a bunch of filtering circuitry that I positively don’t have sufficient expertise to know. The microphone can also be hooked as much as this chip (LINPUT). There can also be an unused proper enter channel.
The headphone output can also be offered by the WM8961 (HP_L and HP_R). The headphone jack has a detection sign which is used to activate a transistor to regulate a sign (HP_IN) which can let me know when headphones are plugged in. HP_IN goes straight to one of many PXA166’s GPIO pins.


Here is the place the I2C bus goes. The schematic calls it PWR_SCL/SDA, however it’s also referred to as twsi2 in Linux’s pxa168.dtsi file.

As for the I2S indicators, they go into the PXA166’s SSP1 peripheral:

There can also be an additional I2S_CDCLK0 sign that goes to the MCLK enter of the WM8961. This is named the “grasp clock” and is a separate clock that’s wanted by the codec chip. Typically, primarily based on my understanding, it’s purported to be a a number of of the pattern fee you’re working with. I opted to make it 256 instances the pattern fee (256Fs). So for instance, if I’m enjoying a 44.1 kHz sound, MCLK can be 11.2896 MHz. It was pretty troublesome for me to glean this requirement primarily based on studying the datasheets, however after random discussions on-line and different pattern code it grew to become clearer.
All proper, in order that gave me sufficient info to get began. I wanted to configure the codec chip over I2C on TWSI2, arrange I2S audio on SSP1, output MCLK on AC97_SYSCLK, and detect headphone insertion on GPIO_97. How on this planet would I get began?
By trying on the outdated Chumby 2.6.28 kernel, in fact. I checked out Chumby’s initialization scripts and bought an concept of what the dependencies can be for enjoying a sound. Being in a position to play a sound in 2.6.28 can be a superb first step, and it could give me a reference to match in opposition to if I bumped into any points with the newer kernel. I already had a minimal rootfs arrange from after I was getting Wi-Fi working, so I simply needed to copy some extra binaries, libraries, config recordsdata, and so forth. out of the unique Chumby rootfs into my minimal rootfs for two.6.28. One factor that was useful was to make use of strace to see what was taking place after I tried to run instructions like amixer and aplay. Eventually after I bought sufficient of the underlying libraries and config recordsdata discovered, I got here up with this considerably hacky sequence of instructions I might run to play a sound within the outdated Chumby kernel:
modprobe i2c-pxa modprobe snd-soc-wm8961 modprobe snd-soc-silvermoon mdev -s mkdir /dev/snd cp -R /dev/controlC0 /dev/pcmC0D0* /dev/timer /dev/snd/ amixer set Speaker 127 aplay /smw_game_over.wav
This performed the Super Mario World sport over sound for me (right here’s the place I bought it). Yay, I had a easy working take a look at setup within the outdated kernel. Next up, I checked out how all the things was attached in that older model. Most of the enjoyable was within the snd/soc/pxa listing — particularly, I noticed that snd-soc-pxa3xx, snd-soc-pxa3xx-ssp, and snd-soc-silvermoon have been modules being constructed. silvermoon_wm8961.c appeared to comprise the glue to hook all the things collectively. snd/soc/codecs/wm8961.c had some Chumby-specific hacks. I additionally found, unsurprisingly, that the PXA3xx sound driver principally simply appeared like a bunch of DMA (direct reminiscence entry) setup stuff. This makes quite a lot of sense. Once you’ve got all the things up and operating, you’re primarily simply frequently utilizing DMA to maintain the information flowing to the codec.
I attempted to seek out trendy equivalents to those drivers within the mainline kernel. The WM8961 driver nonetheless existed, however didn’t assist gadget tree. The sound/soc/pxa listing was additionally nonetheless there, however there was nothing particular to the PXA3xx. Instead, I noticed some PXA2xx drivers. It nonetheless appeared like these can be useful. I additionally discovered some older, unmerged patches including PXA168 assist from 2010. I figured I might take a look at these and attempt to match them in with the newer kernel.
Here’s an summary of what I wanted to perform:
- Enable I2C assist for the PXA168
- Enable DMA assist for the PXA168
- Port the outdated unmerged PXA168 patches to a contemporary kernel
- Update the WM8961 driver to work with gadget tree and hook it up
- Figure out the way to reference the PXA audio drivers from gadget tree
- Figure out the way to create an audio card (hopefully, simple-audio-card) to attach the SoC and codec collectively.
- Enable ALSA instruments in buildroot
- Get the Super Mario World sport over sound enjoying over the audio system
- Figure out the way to play sound by means of the headphone jack
- Detect when headphones are plugged in
Yikes, that’s truly quite a lot of stuff to do. Some of it’s easy, however I can see why no person (to my information) has ever bothered getting the Chumby’s audio engaged on trendy kernels. When I’m overwhelmed with a zillion stipulations like this, I like to interrupt it up into child steps and give attention to one factor at a time.
Let’s begin with I2C assist. That needs to be pretty easy. It seems that the mainline kernel’s gadget tree embrace file for the PXA16x already has the TWSI units enabled! TWSI is the identify utilized by Marvell for what is basically their I2C controller IP. This was fairly straightforward to activate in my kernel config. I simply wanted to allow CONFIG_I2C_PXA and activate twsi1 and twsi2 within the gadget tree. As a part of this I additionally attached the onboard AT24C08 “character EEPROM” to twsi1. This would offer a straightforward method to confirm that I2C was working. It seems twsi2 wasn’t enabled mechanically at startup, so I hacked in a repair to U-Boot to make sure they have been each enabled. I believe the Linux clocking ought to have been in a position to deal with that, however I used to be extra centered on simply getting it working.
This all went very well. After doing that, I noticed kernel messages at startup concerning the newly-enabled controllers and the EEPROM:
i2c i2c-0: PXA I2C adapter
i2c i2c-1: PXA I2C adapter
at24 0-0050: provide vcc not discovered, utilizing dummy regulator
at24 0-0050: 1024 byte 24c08 EEPROM, writable, 1 bytes/write
I used to be in a position to dump the EEPROM with a easy command:
cat /sys/class/i2c-dev/i2c-0/gadget/0-0050/eeprom > /tmp/eeprom-backup.bin
This dump file contained strings like “sexi”, “chum”, “vers”, and so forth. so I used to be fairly assured that I had succeeded. I2C was formally working! I find it irresistible when all the things within the kernel simply works the best way it’s purported to.
Let’s transfer onto DMA. DMA is essential as a result of in case you’re sending a bunch of audio information over I2S, you don’t need the CPU to be accountable for manually sending all of that audio information. That can be loopy. You wish to enable the DMA controller to do it within the background to be able to release the CPU to do different extra essential stuff. Also, it was fairly clear from trying on the present audio code that DMA can be a dependency of the audio assist.
DMA is one other factor that already had a driver within the kernel. I simply needed to discover it, after which hook it up within the gadget tree, which additionally entailed specifying the DMA channels for the assorted peripherals. I stuffed them out for the SSP units. I additionally needed to allow the driving force within the kernel config.
Amazingly sufficient, this all simply appeared to magically work:
pxa-dma d4000000.dma-controller: initialized 32 channels on 100 requestors
The kernel was spitting out a bunch of errors at startup although:
pxa-dma d4000000.dma-controller: error -ENXIO: IRQ index 1 not discovered
pxa-dma d4000000.dma-controller: error -ENXIO: IRQ index 2 not discovered
pxa-dma d4000000.dma-controller: error -ENXIO: IRQ index 3 not discovered
...
pxa-dma d4000000.dma-controller: error -ENXIO: IRQ index 31 not discovered
I later ended up discovering that these errors have been truly innocent and I submitted a patch to the upstream kernel to repair it. The additional IRQs are non-compulsory — solely IRQ 0 is used on the PXA168. Thus, the driving force wanted to be utilizing platform_get_irq_optional() as a substitute of platform_get_irq(). This repair landed in kernel 6.1 and was backported to a bunch of older kernels.
By the best way, in case you look carefully at my submitted patch for the DMA bug, I screwed up the “Fixes” tag and forgot so as to add a closing “)” to the top of the road. I believe the present parentheses close to the top of the road confused my mind. Luckily it was caught earlier than it made its method to Linus for Linux 6.1-rc5.
I assumed I would want to truly make some progress on the audio to be able to take a look at the DMA, however I discovered that DMA was already working at this level. That’s as a result of I attached the right DMA channels to the SSP controllers, and as you could recall from the final publish, the touchscreen makes use of SPI. It seems that utilizing DMA with the touchscreen truly bogged it manner down. The touchscreen nonetheless labored, however it had change into a lot much less responsive after I turned on DMA.
This puzzled me for a short second, after which a light-weight bulb went off in my head. My touchscreen driver does very, very small SSP transactions (16 bits) separately in a thread. For small particular person transactions like this, going by means of the entire technique of establishing DMA ended up being a lot slower than simply letting the CPU do it. I labored round this by growing the minimal DMA burst dimension within the SSP driver. It had been arrange to make use of DMA even on 1-byte transactions. I pulled a quantity out of skinny air and determined to inform it to solely use DMA on transactions which are at the very least 8 bytes. That fully mounted the touchscreen. I used to be nonetheless glad this occurred as a result of it helped me confirm that DMA was working.
Next up, I knew that the WM8961 audio codec can be wanted to be able to get this setup working. All I wanted to do was add assist for gadget tree to the driving force. I made a decision to ship this alteration straight to the mainline kernel, simply in case somebody would possibly attempt to take away the driving force as a result of it not getting used anyplace. The precise code was fairly easy — the toughest half was truly getting the gadget tree documentation appropriate. It took me two tries to get it merged as a result of I made a couple of errors in my first try (V1, V2). Sometimes the code overview course of could be a bit intimidating, however on the finish of the day it’s all about making certain good high quality of code and shouldn’t be taken personally. I’m glad this wasn’t my first submitted patch or I might need been scared away!
That took care of many of the low-hanging fruit. With DMA and I2C working, and the codec out there so as to add to the gadget tree, I had many of the stipulations out of the best way in order that I might begin tinkering with precise audio stuff. This is the place it began to get harder to separate the work up as a result of there have been interdependencies between the totally different parts, so issues bought a little bit hectic. I’m nonetheless in a little bit little bit of disbelief that I figured this all out, so it could be troublesome to logically clarify all of it. I’ll attempt to step by means of it as finest as I can.
I did a bunch of analysis and observed that there had been some prior patches so as to add assist for the PXA168 to ASoC. In explicit, this one was fairly fascinating as a result of it had a desk with a bunch of hardcoded register setups for numerous bit charges. I used to be fairly certain I’d want one thing related to be able to configure the PXA168 to have appropriate MCLK and bit clock frequencies.
I principally began tossing issues collectively to attempt to get it working. I ensured the ASoC pxa-ssp driver was allowed to be enabled with this structure, after which added a port of the customized PXA168 logic in a few commits (1, 2). Then I attempted to combine all of it right into a simple-audio-card within the gadget tree. I didn’t actually know what I used to be doing right here, however I used different boards as examples to attempt to stroll myself by means of it. The math getting used within the MCLK/BCLK tables within the unique patch equipped by the Marvell worker confused me, so I went with my very own calculation primarily based on an MCLK of 256Fs as mentioned earlier. With 16 bits per pattern and a couple of channels, this meant I would want to divide MCLK by 256/16/2 = 8 to finish up with the right bit clock.
I knew I would want to configure SSP1 to make use of this new configurable clock versus one of many hardwired fixed clocks it may use, so I took care of that as effectively. I opted to reconfigure the clock supply in U-Boot out of simplicity. I’m considering that the frequent clock framework would have been a greater place for all of this clocking setup. At this level I simply needed to get it working!
With all the things form of attached, I gave it a shot. I attempted to play my sound with aplay:
aplay /smw_game_over.wav
As anticipated, it didn’t work proper out of the gates.
wm8961 1-004a: MCLK has not been specified
wm8961 1-004a: ASoC: error at snd_soc_dai_hw_params on wm8961-hifi: -22
ssp-dai0-wm8961-hifi: ASoC: __soc_pcm_hw_params() failed (-22)
I consider I had the clocking attached fallacious, and simply hacked one thing collectively by including:
system-clock-frequency = <11289600>;
…to the codec part of the simple-audio-card, however that was only a non permanent stopgap answer. That quantity is precisely 256 instances 44,100 (44.1 kHz). I didn’t take the most effective notes about what I did right here as a result of I used to be making an attempt every kind of issues, however I finally didn’t want that line anymore. I consider this ended up being the higher answer in order that it labored correctly with totally different bit charges:
mclk-fs = <256>;
This bought me a bit additional. Next I used to be getting a null pointer dereference:
Unable to deal with kernel NULL pointer dereference at digital tackle 00000000
[00000000] *pgd=00000000
Internal error: Oops: 5 [#1] PREEMPT ARM
Modules linked in: libertas_sdio libertas sha256_generic libsha256 cfg80211 snd_soc_pxa_ssp snd_soc_simple_card rfkill snd_pxa2xx_lib snd_soc_wm8961 snd_soc_simple_card_utils snd_pcm_dmaengine snd_soc_core snd_pcm chumby8_ts snd_timer snd soundcore spi_pxa2xx_platform ssp
CPU: 0 PID: 193 Comm: aplay Not tainted 5.18.9 #3
Hardware identify: Marvell PXA168 (Device Tree Support)
PC is at snd_dmaengine_pcm_get_chan+0x14/0x1c [snd_pcm_dmaengine]
LR is at pxa2xx_pcm_hw_params+0x2c/0xec [snd_pxa2xx_lib]
...
Backtrace:
snd_dmaengine_pcm_get_chan [snd_pcm_dmaengine] from pxa2xx_pcm_hw_params+0x2c/0xec [snd_pxa2xx_lib]
pxa2xx_pcm_hw_params [snd_pxa2xx_lib] from pxa2xx_soc_pcm_hw_params+0x18/0x1c [snd_pxa2xx_lib]
pxa2xx_soc_pcm_hw_params [snd_pxa2xx_lib] from snd_soc_pcm_component_hw_params+0x48/0xb8 [snd_soc_core]
snd_soc_pcm_component_hw_params [snd_soc_core] from __soc_pcm_hw_params+0x504/0x6a8 [snd_soc_core]
__soc_pcm_hw_params [snd_soc_core] from soc_pcm_hw_params+0x38/0x50 [snd_soc_core]
soc_pcm_hw_params [snd_soc_core] from snd_pcm_hw_params+0x158/0x420 [snd_pcm]
snd_pcm_hw_params [snd_pcm] from snd_pcm_ioctl+0x280/0x19ac [snd_pcm]
snd_pcm_ioctl [snd_pcm] from sys_ioctl+0x538/0xcd4
sys_ioctl from ret_fast_syscall+0x0/0x1c
Inspecting the code additional, I tracked the issue right down to being attributable to pxa2xx_pcm_open() returning early as a result of snd_soc_dai_get_dma_data() was returning null. Comparing the pxa-ssp driver to different related drivers, it appeared totally different. Loads of different drivers arrange the DMA of their probe features, however the pxa-ssp driver was doing it within the startup/shutdown features. I merely modified the pxa-ssp driver to be extra just like the others and arrange the DMA within the probe operate. Was this the right answer? I don’t know — however the truth that different drivers did it this fashion made me really feel like I used to be getting into the best route. It positively mounted the problem.
With this in place, I truly bought one thing to play some sound — form of. It by no means labored the very first time I might attempt to play a sound. I needed to take away and reinsert the kernel module to be able to get it to work. Also, the pitch was fallacious, and it sounded type of scratchy, however hey, it was enjoying a sound!
I used to be completely stoked! I bought sound working! It wasn’t excellent, however at this level I felt assured I might be capable to determine it out. I tackled the assorted issues one after the other. It seems that I had so as to add particular code within the PXA168 SSP setup to manually activate MCLK instantly, as a result of by default the WM8961 can’t be configured until it’s actively receiving MCLK. This solved the problem of sound solely working after the second time the kernel module was loaded.
As for the wrong pitch, the SSP controller was being arrange with an preliminary “dummy” bit, so it was sending out 17 bits per pattern as a substitute of 16. This triggered the sound to play slower. There are totally different information codecs supported by the WM8961 together with I2S mode, left-justified, and right-justified. I2S mode is bizarre in that it expects LRCLK to vary 1 cycle earlier than the precise information for the brand new channel needs to be transmitted. I consider this was the explanation for the dummy bit. However, including it triggered a complete of 17 bits to be despatched per pattern as a substitute of 16. I’m nonetheless unsure if this can be a mistake within the Linux driver for all PXAxxx chips, or if the PXA168’s controller behaves barely otherwise from the others. It’s laborious to know for certain with out different PXA2xx/3xx {hardware} to check with.
Either manner, the answer was straightforward: change to left-justified mode as a substitute. Left-justified mode is similar to I2S mode, besides the brand new information begins at the very same time because the LRCLK transition, and the LRCLK polarity is inverted. What I imply by inverted is that in left-justified mode, a excessive LRCLK means it’s left channel information, whereas in I2S mode, a excessive LRCLK means it’s proper channel information.
Since the modes are very related, it was straightforward sufficient to easily add left-justified assist to the PXA audio driver. I do really feel like my change was a little bit messy for this although.
With left-justified mode applied, I truly bought excellent audio playback! The scratchiness and incorrect pitch have been gone.
As you may see, someday throughout this course of I additionally modified to the precise Chumby brand. The colourful display within the first video was helpful for ensuring I had the colours mapped appropriately within the LCD controller.
I in all probability might have known as it adequate at this level, however it was round now that I remembered the Chumby 8 additionally has a microphone. I couldn’t resist making an attempt to get the microphone working. At face worth it didn’t appear too scary, particularly since a Chumby developer had offered some pattern instructions used for his or her manufacturing unit microphone testing. Of course, this led me down one other loopy rabbit gap.
It began out easy. I attached the microphone and MICBIAS in gadget tree, which did take a little bit of analysis and different instance boards, however it wasn’t too unhealthy. Then I attempted recording however it didn’t work in any respect. I finally found that the mic did work, however I needed to document in stereo, and the microphone information was exhibiting up in the best channel as a substitute of the left channel. This led me to understand that I truly had LRCLK inverted from what it was purported to be. That was essential as a result of the mic is mono and solely hooked to the left channel within the Chumby. I hadn’t observed after I switched to left-justified mode that LRCLK wanted to be backwards from the way it was arrange in I2S mode. That was fairly easy to repair.
That was solely the start of this saga although. After I did that, I observed that after I was enjoying audio, the information for the 2 audio channels was being despatched out of order. I used to be sending left sounds to the best speaker and vice-versa. So my backwards LRCLK was simply taking place to work beforehand as a result of I used to be offering the information within the fallacious order! I couldn’t work out the way to swap the 2 16-bit channels earlier than sending them out over I2S. It’s attainable that there’s some magic answer to inform the DMA controller to swap the 16-bit channels in every 32-bit phrase being transmitted. I don’t know — I couldn’t determine it out.
I ended up studying intimately concerning the SSP controller within the PXA168. In explicit I observed that it helps one thing known as community mode, the place you may allocate time slots devoted for information to be despatched. It seems the Linux driver truly used to make use of community mode however ultimately switched away from it. It was unclear to me precisely why this alteration was made in 2009. The PXA168 datasheet particularly says community mode is for emulating the I2S protocol. I’m certain there was an excellent purpose for switching away, however I discovered that community mode was simply what I wanted for making certain the information was being despatched out within the appropriate order. It wasn’t too troublesome to modify the driving force over, and it allowed me to take away an unpleasant hack I had wanted for the outdated technique.
With the change to community mode all applied, my rabbit gap journey was full and audio playback and recording labored nice, proper?
Wrong. Somehow I managed to find one other bug. Sometimes if I performed a mono sound with aplay, the left channel sounded high-quality however the best channel would play again as random static noise as a substitute of silence prefer it was purported to. The bizarre half is it could solely occur after I had tried recording! And typically recording would repair the problem and make the static go away.
I used to be deliberately disabling the best channel when enjoying again mono sound. There shouldn’t have been any information in any respect on the best channel. But one thing was inflicting it to play again random noise despite the fact that it was supposedly disabled. And why wouldn’t it solely occur after recording?
I nonetheless haven’t any rationalization for why this occurred. It smells like a silicon bug to me, however it would possibly simply be my lack of expertise of how the SSP peripheral works. Maybe weirdness like this was why the kernel builders switched away from community mode. I actually needed to make use of community mode, although. It was excellent for what I wanted, other than this unusual bug. What I ended up doing was eradicating the second channel altogether when enjoying again mono sound, moderately than disabling it. Removing the channel and including 16 bits of dummy information to switch it fully solved the problem. This repair was included with my closing commit I linked earlier.
So yeah. If I’m being 100% sincere with myself, I’m nonetheless not completely certain how I bought this all working or if my answer is appropriate. I got here up with a considerably hacky repair that works, however appears to go in opposition to intentional choices made by kernel builders 15 years in the past. I can play audio reliably and the microphone works too. I’m penning this publish over a yr after I first figured it out, and I’m nonetheless afraid of even enthusiastic about making an attempt to upstream my audio fixes. I can’t present nice causes for why the random points I noticed occurred, and I don’t know whether or not my fixes are actually the most effective strategy. I believe at minimal, I would want to wash up the clocking to make use of the frequent clock framework. Also, I would want to check in opposition to different PXA2xx/3xx units to see if they’re additionally affected by the “17 as a substitute of 16 bits” pitch/pace shift situation. I really feel like different kernel builders would have observed that although, so I’m tempted to imagine it’s one thing bizarre concerning the PXA168. The backside line is that I believe for the foreseeable future, my PXA audio fixes are going to remain in my department.
By the best way, I additionally bought headphone jack detection working. It was tremendous straightforward to arrange. This commit I linked earlier provides the detection. All I needed to do was add this line to the right part of my gadget tree:
simple-audio-card,hp-det-gpio = <&gpio 97 GPIO_ACTIVE_LOW>;
The mapping of GPIO 97 matches the schematic diagram I confirmed in the beginning of this publish. That was very easy! Back within the 2.6.28 days, the Chumby kernel had Chumby-specific hacks within the WM8961 driver so as to add headphone plugin/elimination detection. It was fairly cool seeing how a lot less complicated issues have gotten since then. A one-line addition to the gadget tree is quite a bit simpler than vendor-specific kernel hacks!
Here’s a fast demo of how the headphone detection works. It creates an enter gadget you could take a look at to detect whether or not headphones are plugged in. evtest is an easy utility that may monitor it:
# evtest
No gadget specified, making an attempt to scan all of /dev/enter/occasion*
Available units:
/dev/enter/event0: Chumby Speaker Headphones
/dev/enter/event1: Chumby 8 touchscreen
Select the gadget occasion quantity [0-1]: 0
Input driver model is 1.0.1
Input gadget ID: bus 0x0 vendor 0x0 product 0x0 model 0x0
Input gadget identify: "Chumby Speaker Headphones"
Supported occasions:
Event sort 0 (EV_SYN)
Event sort 5 (EV_SW)
Event code 2 (SW_HEADPHONE_INSERT) state 0
Properties:
Testing ... (interrupt to exit)
Event: time 1713155219.026612, sort 5 (EV_SW), code 2 (SW_HEADPHONE_INSERT), worth 1
Event: time 1713155219.026612, -------------- SYN_REPORT ------------
Event: time 1713155224.496627, sort 5 (EV_SW), code 2 (SW_HEADPHONE_INSERT), worth 0
Event: time 1713155224.496627, -------------- SYN_REPORT ------------
I began out with no headphones inserted, then plugged them in, and at last eliminated them 5 seconds later. I consider there’s userspace software program that may acknowledge this explicit change occasion and is aware of to allow/disable the headphone and speaker as essential. I also can manually management headphone and speaker quantity independently with amixer:
amixer set Headphone 25%
amixer set Speaker 70%
I must also add that I used to be involved about any attainable variations between the outdated kernel and the brand new kernel when it comes to how the WM8961 was arrange. The WM8961 setup is principally only a bunch of register writes over I2C. I painstakingly in contrast what the outdated and new kernels have been doing. It appeared like Chumby’s kernel defaulted to the next speaker AC acquire (7 as a substitute of three), and likewise did some tweaks to the amount and mic bias controls to carry them out to the person individually and restrict the volumes. Nothing appeared too loopy. I used to be principally involved about making an attempt to drive the audio system louder than they need to be, so for now I’ll simply make certain to not drive the amount too excessive.
Interestingly, it seems the Infocast and Chumby 8 had barely totally different limits. The Infocast was restricted to a most of 121 for the headphone quantity and 119 for the audio system, whereas the Chumby 8 had the complete restrict of 127 on each of them. I don’t know if that was a requirement from Insignia, or if the {hardware} modified a bit between revisions. Either manner, it looks as if with my default acquire of three, it sounds high-quality even after I go as much as 127 on the Infocast.
Whew! That was quite a bit to determine. What it comes right down to is I struggled quite a bit with implementing audio assist on the Chumby 8, however I bought it working effectively sufficient. This was in all probability essentially the most troublesome a part of my whole Chumby kernel modernization. I believe the principle purpose for that’s my lack of expertise with ALSA. It was nonetheless fairly spectacular that the overwhelming majority of the infrastructure for audio assist on the PXA168 was already there within the mainline kernel. I primarily simply had so as to add a little bit little bit of glue code for the PXA168 and repair some random points. I’d nonetheless like to know whether or not different PXA units utilizing the identical driver play their sounds barely too slowly.
At this level with the Chumby 8’s show, touchscreen, Wi-Fi, and audio working, there wasn’t a lot left to do, however I’m not carried out writing about this venture but. I’ll offer you a little bit teaser for the following publish. I’d like to speak a couple of unusual situation I observed. The CPU was all the time exhibiting up as being 100% loaded, even with nothing operating. The unique Chumby 2.6.28 kernel positively didn’t do that. What was taking place to trigger the CPU to be so busy? Stay tuned for the following publish to seek out out all about it.
HI-FI News
by way of Lobsters https://lobste.rs/
April 15, 2024 at 08:16PM
-
Product on sale
Audiophile Vinyl Records Cleaning BundleOriginal price was: €69.90.€59.90Current price is: €59.90. incl. VAT -
Product on sale
Easy Start Vinyl Records Cleaning KitOriginal price was: €69.90.€59.90Current price is: €59.90. incl. VAT -
Vinyl Records Cleaner Easy Groove Concentrate€34.95 incl. VAT -
Easy Groove Super Set€199.00 incl. VAT -
Easy Groove Enzycaster – vinyl records prewash cleaner€34.95 incl. VAT -
Easy Groove Extreme MK. II- vinyl records prewash cleaner€45.00 incl. VAT -
Vinyl Records Cleaner – Easy Groove Virgin Concentrate€35.00 incl. VAT -
Easy Groove Spray&Wipe vinyl records cleaner€34.95 incl. VAT








